Built motion from commit a679711e.|2.6.15
[motion2.git] / server / services / ami / dialer / models / action.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xc5a9=['util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','firstName','lastName','number','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','dialCutDigit','substring','exports'];(function(_0x6fea4c,_0x3f33c3){var _0x222265=function(_0x5d8816){while(--_0x5d8816){_0x6fea4c['push'](_0x6fea4c['shift']());}};_0x222265(++_0x3f33c3);}(_0xc5a9,0x114));var _0x9c5a=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0xc5a9[_0x489b87];return _0x1823b6;};'use strict';var util=require(_0x9c5a('0x0'));var _=require(_0x9c5a('0x1'));var moment=require(_0x9c5a('0x2'));function checkNameSurname(_0x1f8f8f,_0x3c146e,_0x54c21f){var _0x3229c2='';if(!_[_0x9c5a('0x3')](_0x3c146e)&&_0x9c5a('0x4')===typeof _0x3c146e){_0x3229c2+=_0x3c146e;}if(!_[_0x9c5a('0x3')](_0x54c21f)&&'string'===typeof _0x54c21f){_0x3229c2+='\x20'+_0x54c21f;}if(_0x3229c2!==''){return _0x3229c2;}return _0x1f8f8f;}function Action(_0x21c59b,_0x389395,_0x36eb0d){this[_0x9c5a('0x5')]=_0x21c59b;this[_0x9c5a('0x6')]=_0x36eb0d||undefined;this['name']=checkNameSurname(_0x389395[_0x9c5a('0x7')][_0x9c5a('0x8')],_0x389395['Contact'][_0x9c5a('0x9')],_0x389395[_0x9c5a('0x7')][_0x9c5a('0xa')]);this[_0x9c5a('0xb')]=_0x389395['phone'];this[_0x9c5a('0xc')]=_0x21c59b[_0x9c5a('0xd')];this[_0x9c5a('0xe')]=_0x389395[_0x9c5a('0xe')]||![];this[_0x9c5a('0xf')]=_0x21c59b[_0x9c5a('0xf')];this['dialQueueTimeout']=_0x21c59b[_0x9c5a('0x10')]||0x3;this[_0x9c5a('0x11')]=_0x389395[_0x9c5a('0x11')];this[_0x9c5a('0x12')]=_0x389395[_0x9c5a('0x12')];this[_0x9c5a('0x13')]=_0x389395[_0x9c5a('0x13')];this[_0x9c5a('0x14')]=_0x389395[_0x9c5a('0x14')];this['countnosuchnumberretry']=_0x389395[_0x9c5a('0x15')];this[_0x9c5a('0x16')]=_0x389395['countdropretry'];this[_0x9c5a('0x17')]=_0x389395[_0x9c5a('0x17')];this[_0x9c5a('0x18')]=_0x389395[_0x9c5a('0x18')];this['countagentrejectretry']=_0x389395[_0x9c5a('0x19')];this[_0x9c5a('0x1a')]=_0x389395[_0x9c5a('0x1a')];this[_0x9c5a('0x1b')]=_0x389395[_0x9c5a('0x1b')];this[_0x9c5a('0x1c')]=_0x389395[_0x9c5a('0x1c')];this[_0x9c5a('0x1d')]=_0x389395[_0x9c5a('0x1d')];this[_0x9c5a('0x1e')]=_0x389395['CampaignId'];this['idHopper']=_0x389395['id'];this[_0x9c5a('0x1f')]=_0x389395[_0x9c5a('0x7')][_0x9c5a('0x9')]||'';this[_0x9c5a('0x20')]=moment()[_0x9c5a('0x21')](_0x9c5a('0x22'));this['callback']=_0x389395[_0x9c5a('0x23')];this[_0x9c5a('0x24')]=_0x389395[_0x9c5a('0x24')];this['callbackat']=_0x389395[_0x9c5a('0x25')];this[_0x9c5a('0x26')]=_0x389395['recallme'];this[_0x9c5a('0x27')]='';this[_0x9c5a('0x28')]='';}Action[_0x9c5a('0x29')][_0x9c5a('0x2a')]=function(){return util[_0x9c5a('0x21')]('\x22%s\x22\x20<%s>',this[_0x9c5a('0xd')],this[_0x9c5a('0x5')][_0x9c5a('0x2b')]>0x0?this['number'][_0x9c5a('0x2c')](this['voiceQueue'][_0x9c5a('0x2b')]):this[_0x9c5a('0xb')]);};Action[_0x9c5a('0x29')]['getQueue']=function(){return this['queue'];};module[_0x9c5a('0x2d')]=Action;