Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / services / ami / preview / util / util.js
index 4449fc9..219a312 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76f5=['moment','../../../../config/logger','env','loggerCatch','inspect','info','loggerError','error','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','isActive','Queue','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','endtime','logAgent','state','responsetime','ringtime','logLookAgent','membername','logCustomer','getSeconds','talktime','answertime','isFailure','Failure','RECALL','calleridname','BOOKED','uniqueid','originate','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','channelAgent','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','noanswer','keys','variables','forEach','toLowerCase','util','lodash'];(function(_0x2c112a,_0x5815d4){var _0x5d22db=function(_0x3a2ea2){while(--_0x3a2ea2){_0x2c112a['push'](_0x2c112a['shift']());}};_0x5d22db(++_0x5815d4);}(_0x76f5,0x97));var _0x576f=function(_0x192f16,_0x454664){_0x192f16=_0x192f16-0x0;var _0x5b6b0b=_0x76f5[_0x192f16];return _0x5b6b0b;};'use strict';var util=require(_0x576f('0x0'));var _=require(_0x576f('0x1'));var moment=require(_0x576f('0x2'));var logger=require(_0x576f('0x3'))('preview');var ipAgi=process[_0x576f('0x4')]['XCALLY_IP_AGI']||'127.0.0.1';var utils=require('../../dialer/utils');exports[_0x576f('0x5')]=function(_0x281f2a){return function(_0x5547ad){logger['error'](_0x281f2a,util[_0x576f('0x6')](_0x5547ad,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x489ef7,_0x32cf7a){logger[_0x576f('0x7')](_0x489ef7,util['inspect'](_0x32cf7a,{'showHidden':![],'depth':null}));};exports[_0x576f('0x8')]=function(_0x556856,_0x1ba685){logger[_0x576f('0x9')](_0x556856,util[_0x576f('0x6')](_0x1ba685,{'showHidden':![],'depth':null}));};exports[_0x576f('0xa')]=function(_0x5e17df){return function(_0x1371ad){logger[_0x576f('0x7')](_0x5e17df,util[_0x576f('0x6')](_0x1371ad,{'showHidden':![],'depth':null}));};};exports[_0x576f('0xb')]=function(_0x1e01a4,_0x4ed9f,_0xbc2516){return{'message':_0x1e01a4,'unlock':_0x4ed9f,'active':_0xbc2516};};exports[_0x576f('0xc')]=function(_0xd9398b,_0x41c475,_0x1f7f02){if(!_[_0x576f('0xd')](_0x1f7f02)&&_0x576f('0xe')===typeof _0x1f7f02&&!_['isEmpty'](_0x1f7f02)){if(!_[_0x576f('0xd')](_0x41c475)&&_0x576f('0xe')===typeof _0x41c475&&!_[_0x576f('0xf')](_0x41c475)){return util['format'](_0x576f('0x10'),_0x41c475,_0x1f7f02);}return util[_0x576f('0x11')](_0x576f('0x10'),_0x1f7f02,_0x1f7f02);}if(!_['isUndefined'](_0xd9398b)&&_0x576f('0xe')===typeof _0xd9398b&&!_[_0x576f('0xf')](_0xd9398b)){return _0xd9398b;}return'\x22\x22\x20<>';};exports[_0x576f('0x12')]=function(_0xe51263){if(_['isNil'](_0xe51263)){return![];}return _0xe51263;};exports['addVariables']=function(_0x1c59d6,_0x431549,_0x44f551,_0x25ec24,_0x1effe7,_0x2ba79e){var _0x2ce909={'XMD-QUEUE':_0x431549[_0x576f('0x13')]?_0x431549['Queue']['name']:'','XMD-CALLERID':_0x25ec24,'XMD-CALLERID-PREVIEW':_0x2ba79e?util['format'](_0x576f('0x10'),_0x2ba79e['calleridname'],_0x2ba79e[_0x576f('0x14')]):_0x25ec24,'XMD-DIALID':_0x1effe7,'XMD-CONTACTID':_0x431549[_0x576f('0x15')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x25ec24,'XMD-VOICEQUEUEID':_0x431549[_0x576f('0x16')],'XMD-DIALCHANNEL':_0x44f551,'XMD-DIALTIMEOUT':_0x1c59d6[_0x576f('0x17')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x1c59d6[_0x576f('0x18')]?'g':'',_[_0x576f('0xf')](_0x1c59d6[_0x576f('0x19')])?'':_0x576f('0x1a')),'XMD-DIALURL':_0x1c59d6['dialPreviewUrl']||'','XMD-AGI':_0x1c59d6[_0x576f('0x1b')]?util['format'](_0x576f('0x1c'),ipAgi,_0x1c59d6[_0x576f('0x1b')]):_0x576f('0x1d'),'XMD-AGIAFTER':_0x1c59d6['dialQueueProject2']?util[_0x576f('0x11')](_0x576f('0x1c'),ipAgi,_0x1c59d6['dialQueueProject2']):_0x576f('0x1d'),'XMD-ORIGINATECALLERIDNUM':_0x2ba79e?_0x2ba79e[_0x576f('0x1e')]:'','XMD-ORIGINATECALLERIDNAME':_0x2ba79e?_0x2ba79e[_0x576f('0x1f')]:'','XMD-DESTINATION':_0x576f('0x20'),'SIPADDHEADER':_0x576f('0x21')};if(!_[_0x576f('0xf')](_0x1c59d6['monitor_format'])){_0x2ce909[util['format']('%s',_0x576f('0x22'))]=_0x1c59d6[_0x576f('0x19')];_0x2ce909[util[_0x576f('0x11')]('%s',_0x576f('0x23'))]=_0x1effe7;}if(_0x431549&&_0x431549['Contact']){for(var _0x5371e8 in _0x431549['Contact']){if(_0x431549[_0x576f('0x24')][_0x576f('0x25')](_0x5371e8)){if(!_['isNil'](_0x431549[_0x576f('0x24')][_0x5371e8])&&_0x5371e8!=='id'&&_0x5371e8!=='tags'&&_0x5371e8!==_0x576f('0x26')&&_0x5371e8!==_0x576f('0x27')){_0x2ce909[util[_0x576f('0x11')](_0x576f('0x28'),_0x576f('0x29'),_[_0x576f('0x2a')](_0x5371e8))]=_0x431549[_0x576f('0x24')][_0x5371e8];}}}}return _0x2ce909;};exports['toLowerVariables']=function(_0x4b822f){var _0x2dce58={};for(var _0x56f04f in _0x4b822f){if(_0x4b822f['hasOwnProperty'](_0x56f04f)){_0x2dce58[util[_0x576f('0x11')]('%s',_[_0x576f('0x2b')](_0x56f04f))]=_0x4b822f[_0x56f04f];}}return{'variables':_0x2dce58};};exports[_0x576f('0x2c')]=function(_0x583186,_0x5d42c3){if(!_[_0x576f('0x2d')](_0x583186)){if(_0x583186[_0x576f('0x25')](_0x576f('0x2e'))){if(_0x583186['originated']>0x0){_0x583186['originated']-=0x1;}else{logger[_0x576f('0x9')](_0x576f('0x2f'),_0x5d42c3);}}}else{logger[_0x576f('0x9')](_0x576f('0x30'),_0x5d42c3);}};exports[_0x576f('0x31')]=function(_0x27769f){var _0xaabaa5=moment()[_0x576f('0x11')](_0x576f('0x32'));_0x27769f['state']=0xd;_0x27769f[_0x576f('0x33')]=_0x576f('0x34');_0x27769f[_0x576f('0x35')]=_0xaabaa5;_0x27769f['responsetime']=_0xaabaa5;_0x27769f[_0x576f('0x36')]=_0xaabaa5;};exports[_0x576f('0x37')]=function(_0x141323,_0x455806,_0x40b44c){var _0x18000e=moment()['format'](_0x576f('0x32'));_0x141323[_0x576f('0x38')]=_0x455806;_0x141323[_0x576f('0x33')]=_0x40b44c;_0x141323[_0x576f('0x39')]=_0x18000e;_0x141323[_0x576f('0x3a')]=utils['getSeconds'](_0x141323[_0x576f('0x39')],_0x141323['starttime']);};exports[_0x576f('0x3b')]=function(_0x293e7c,_0x85d6f5,_0x1f13c1){_0x293e7c[_0x576f('0x3c')]=_0x85d6f5;_0x293e7c['UserId']=_0x1f13c1;};exports[_0x576f('0x3d')]=function(_0x14c381,_0x18e792,_0x3faab8){var _0x18616d=moment()[_0x576f('0x11')](_0x576f('0x32'));_0x14c381['state']=_0x18e792;_0x14c381['statedesc']=_0x3faab8;_0x14c381[_0x576f('0x39')]=_0x14c381[_0x576f('0x39')]?_0x14c381['responsetime']:_0x18616d;_0x14c381[_0x576f('0x36')]=_0x14c381[_0x576f('0x36')]?_0x14c381['endtime']:_0x18616d;_0x14c381[_0x576f('0x3a')]=utils[_0x576f('0x3e')](_0x14c381['responsetime']||0x0,_0x14c381['starttime']||0x0);_0x14c381[_0x576f('0x3f')]=_0x14c381[_0x576f('0x40')]?utils['getSeconds'](_0x14c381[_0x576f('0x36')],_0x14c381[_0x576f('0x40')]):0x0;};exports[_0x576f('0x41')]=function(_0x46f5c4){return _0x46f5c4===_0x576f('0x42');};exports['variablesAction']=function(_0x361377,_0x44cc77,_0x2a959c,_0x422d1f,_0x327397){var _0x3ad0ff=_0x422d1f?_0x576f('0x43'):_0x361377[_0x576f('0x44')];_0x3ad0ff=_0x327397?_0x576f('0x45'):_0x3ad0ff;return{'actionid':_0x361377[_0x576f('0x46')],'action':_0x576f('0x47'),'channel':_0x361377['channelAgent'],'callerid':util[_0x576f('0x11')]('\x22%s\x22\x20<%s>',_0x3ad0ff,_0x361377[_0x576f('0x14')]),'Exten':'xcally-motion-preview','Context':_0x576f('0x48'),'Priority':'1','variable':_0x2a959c,'timeout':(_0x44cc77[_0x576f('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x361377[_0x576f('0x46')]};};exports['totalGlobal']=function(_0x3e4bcd){return _0x3e4bcd[_0x576f('0x4a')]+_0x3e4bcd[_0x576f('0x4b')]+_0x3e4bcd[_0x576f('0x4c')]+_0x3e4bcd[_0x576f('0x4d')]+_0x3e4bcd['countnosuchnumberretry'];};exports[_0x576f('0x4e')]=function(_0x195baf){var _0x427e4d=_[_0x576f('0x4f')](_0x195baf);_0x427e4d['state']=0xf;_0x427e4d[_0x576f('0x33')]='Global';return _0x427e4d;};exports[_0x576f('0x50')]=function(_0x2f2453,_0x370725,_0x4ee663){var _0x493c62={};_0x493c62[_0x370725]=_0x2f2453[_0x370725];_0x493c62[_0x576f('0x51')]=![];_0x493c62['scheduledat']=moment()[_0x576f('0x52')](_0x4ee663,_0x576f('0x53'))[_0x576f('0x11')](_0x576f('0x32'));_0x493c62[_0x576f('0x15')]=_0x2f2453['ContactId'];_0x493c62[_0x576f('0x54')]=_0x2f2453[_0x576f('0x54')];_0x493c62[_0x576f('0x16')]=_0x2f2453[_0x576f('0x16')]||undefined;return _0x493c62;};exports[_0x576f('0x55')]=function(_0x3d655f,_0x3fafdf){if(!_[_0x576f('0x2d')](_0x3d655f)){if(_0x3d655f['pTalking']>0x0){_0x3d655f[_0x576f('0x56')]-=0x1;}else{logger[_0x576f('0x9')](_0x3fafdf,_0x576f('0x57'));}}else{logger[_0x576f('0x9')](_0x3fafdf,_0x576f('0x58'));}};exports['IsNotLoggedIn']=function(_0x535a74){if(_0x535a74<=0x0){return!![];}return![];};function buildObj(_0x2a182d,_0x241c23,_0x17ae0b){_0x2a182d[_0x576f('0x59')]=_0x241c23;_0x2a182d['name']=_0x2a182d[_0x576f('0x5a')];_0x2a182d[_0x576f('0x5b')]=_0x2a182d[_0x576f('0x5c')];_0x2a182d[_0x576f('0x5d')]=_0x576f('0x5e');if(_0x17ae0b){_0x2a182d[_0x576f('0x5f')]=_0x17ae0b[_0x576f('0x5f')];}return _0x2a182d;}exports[_0x576f('0x60')]=buildObj;exports[_0x576f('0x61')]=function(_0x2a87f3){var _0x1999f4={};_0x1999f4[_0x576f('0x5a')]=_0x2a87f3['queue'];_0x1999f4['interface']=_0x2a87f3[_0x576f('0x5c')];_0x1999f4[_0x576f('0x46')]=_0x2a87f3['uniqueid'];return _0x1999f4;};exports[_0x576f('0x62')]=function(_0x574f5f){var _0x3d400c=[];for(var _0x2ab938 in _0x574f5f){if(_0x574f5f[_0x576f('0x25')](_0x2ab938)){if(!_[_0x576f('0x2d')](_0x574f5f[_0x2ab938])&&_0x574f5f[_0x2ab938][_0x576f('0x38')]===_0x576f('0x63')&&_0x574f5f[_0x2ab938][_0x576f('0x64')]===_0x576f('0x65')){_0x3d400c[_0x576f('0x66')](_0x574f5f[_0x2ab938]['id']);}}}return _0x3d400c;};exports[_0x576f('0x67')]=function(_0x3ed11d){var _0x15ab67=moment()[_0x576f('0x68')](0x0);var _0xcdb906=moment(_0x3ed11d)[_0x576f('0x68')](0x0);return _0x15ab67[_0x576f('0x69')](_0xcdb906,_0x576f('0x6a'));};exports[_0x576f('0x6b')]=function(_0x459471){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x459471[_0x576f('0x15')],'ListId':_0x459471['ListId'],'VoiceQueueId':_0x459471[_0x576f('0x16')]||undefined,'CampaignId':_0x459471[_0x576f('0x6c')]||undefined};};exports[_0x576f('0x6d')]=function(_0x15ae2e){if(_0x15ae2e===_0x576f('0x46')||_0x15ae2e===_0x576f('0x6e')||_0x15ae2e===_0x576f('0x5a')||_0x15ae2e===_0x576f('0x6f')||_0x15ae2e===_0x576f('0x70')||_0x15ae2e===_0x576f('0x71')||_0x15ae2e===_0x576f('0x3c')||_0x15ae2e==='channelAgent'||_0x15ae2e==='calleridname'||_0x15ae2e===_0x576f('0x51')||_0x15ae2e==='calleridnum'||_0x15ae2e===_0x576f('0x72')||_0x15ae2e==='countbusyretry'||_0x15ae2e==='countcongestionretry'||_0x15ae2e==='countnoanswerretry'||_0x15ae2e===_0x576f('0x73')||_0x15ae2e===_0x576f('0x74')||_0x15ae2e===_0x576f('0x75')||_0x15ae2e===_0x576f('0x76')||_0x15ae2e===_0x576f('0x77')||_0x15ae2e===_0x576f('0x15')||_0x15ae2e===_0x576f('0x54')||_0x15ae2e===_0x576f('0x78')||_0x15ae2e===_0x576f('0x16')||_0x15ae2e===_0x576f('0x79')||_0x15ae2e===_0x576f('0x7a')||_0x15ae2e==='xmd-queue'||_0x15ae2e===_0x576f('0x7b')||_0x15ae2e===_0x576f('0x7c')||_0x15ae2e===_0x576f('0x7d')||_0x15ae2e==='xmd-dialtimeout'||_0x15ae2e===_0x576f('0x7e')||_0x15ae2e==='xmd-dialid'||_0x15ae2e===_0x576f('0x7f')||_0x15ae2e===_0x576f('0x80')||_0x15ae2e==='xmd-cdrtype'||_0x15ae2e===_0x576f('0x81')||_0x15ae2e===_0x576f('0x82')||_0x15ae2e===_0x576f('0x83')||_0x15ae2e==='rtpaudioqos'||_0x15ae2e===_0x576f('0x84')||_0x15ae2e===_0x576f('0x85')||_0x15ae2e===_0x576f('0x86')||_0x15ae2e===_0x576f('0x87')||_0x15ae2e===_0x576f('0x88')||_0x15ae2e===_0x576f('0x89')||_0x15ae2e===_0x576f('0x8a')||_0x15ae2e===_0x576f('0x8b')||_0x15ae2e==='rtpaudioqosbridged'||_0x15ae2e===_0x576f('0x85')||_0x15ae2e===_0x576f('0x86')||_0x15ae2e===_0x576f('0x87')||_0x15ae2e===_0x576f('0x88')||_0x15ae2e==='rtpaudioqosrtt'||_0x15ae2e===_0x576f('0x8a')||_0x15ae2e==='bridgepeer'||_0x15ae2e===_0x576f('0x8c')||_0x15ae2e===_0x576f('0x38')||_0x15ae2e===_0x576f('0x33')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x1a58a1,_0x32d334){var _0x3b142b,_0x52877a,_0x2ddbba;if(_0x32d334<=0x0){_0x32d334=0x1;}_0x3b142b=new RegExp(_0x576f('0x8d')+_0x32d334+'}$');_0x52877a=Math[_0x576f('0x8e')](0xa,_0x32d334-0x1);_0x2ddbba=Math['pow'](0xa,_0x32d334)-0x1;return util['format']('%s',_[_0x576f('0x8f')](_0x1a58a1,_0x3b142b,_[_0x576f('0x90')](_0x52877a,_0x2ddbba)));};exports[_0x576f('0x91')]=function(_0x332d32){var _0x3ea5c2=_0x332d32['match'](/"(.*?)"/);return _0x3ea5c2?_0x3ea5c2[0x1]:_0x332d32;};exports[_0x576f('0x92')]=function(_0x3f73d1){var _0x430d2d=_0x3f73d1[_0x576f('0x93')](/<(.*?)>/);return _0x430d2d?_0x430d2d[0x1]:_0x3f73d1;};function buildNoAnswerEventPayload(_0x37035f,_0x47cf97){var _0x338e37=buildObj(_0x37035f,_0x576f('0x94'));if(!_[_0x576f('0xf')](_0x47cf97['variables'])){Object[_0x576f('0x95')](_0x47cf97[_0x576f('0x96')])[_0x576f('0x97')](function(_0x30f903){_0x338e37[_0x30f903[_0x576f('0x98')]()]=_0x47cf97[_0x576f('0x96')][_0x30f903];});}return _0x338e37;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload;
\ No newline at end of file
+var _0x26c8=['rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','toLowerCase','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','loggerCatch','inspect','logger','logger2','info','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','isActive','isNil','addVariables','Queue','name','calleridname','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','logAgent','statedesc','ringtime','getSeconds','logLookAgent','membername','talktime','answertime','isFailure','Failure','RECALL','BOOKED','originate','channelAgent','calleridnum','xcally-motion-preview','from-sip','timeout','uniqueid','countbusyretry','countcongestionretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','VoiceQueueId','pTalking','error','IsNotLoggedIn','lastevent','interface','motionChannel','voice','mandatoryDisposition','buildObj','queue','hasOwnProperty','not_inuse','status','reachable','getDiff','milliseconds','diff','seconds','createBody','ListId','CampaignId','filterKey','type','dialAnswer','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqoslossbridged','rtpaudioqosrtt'];(function(_0xf8e7fe,_0x5325bb){var _0x4975d5=function(_0x3d7660){while(--_0x3d7660){_0xf8e7fe['push'](_0xf8e7fe['shift']());}};_0x4975d5(++_0x5325bb);}(_0x26c8,0x128));var _0x826c=function(_0x284da7,_0x5a8125){_0x284da7=_0x284da7-0x0;var _0x84a9d1=_0x26c8[_0x284da7];return _0x84a9d1;};'use strict';var util=require(_0x826c('0x0'));var _=require(_0x826c('0x1'));var moment=require(_0x826c('0x2'));var logger=require(_0x826c('0x3'))('preview');var ipAgi=process[_0x826c('0x4')][_0x826c('0x5')]||'127.0.0.1';var utils=require('../../dialer/utils');exports[_0x826c('0x6')]=function(_0x22d415){return function(_0x53a9bf){logger['error'](_0x22d415,util[_0x826c('0x7')](_0x53a9bf,{'showHidden':![],'depth':null}));};};exports[_0x826c('0x8')]=function(_0x13c0fb,_0x1d14ab){logger['info'](_0x13c0fb,util[_0x826c('0x7')](_0x1d14ab,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x55426d,_0x30aa94){logger['error'](_0x55426d,util[_0x826c('0x7')](_0x30aa94,{'showHidden':![],'depth':null}));};exports[_0x826c('0x9')]=function(_0x5d6c6e){return function(_0x20faa5){logger[_0x826c('0xa')](_0x5d6c6e,util[_0x826c('0x7')](_0x20faa5,{'showHidden':![],'depth':null}));};};exports[_0x826c('0xb')]=function(_0x24889a,_0x32ee84,_0x191c83){return{'message':_0x24889a,'unlock':_0x32ee84,'active':_0x191c83};};exports[_0x826c('0xc')]=function(_0x50c0b7,_0x361a1c,_0x3b71f7){if(!_[_0x826c('0xd')](_0x3b71f7)&&_0x826c('0xe')===typeof _0x3b71f7&&!_[_0x826c('0xf')](_0x3b71f7)){if(!_[_0x826c('0xd')](_0x361a1c)&&_0x826c('0xe')===typeof _0x361a1c&&!_[_0x826c('0xf')](_0x361a1c)){return util['format'](_0x826c('0x10'),_0x361a1c,_0x3b71f7);}return util[_0x826c('0x11')](_0x826c('0x10'),_0x3b71f7,_0x3b71f7);}if(!_[_0x826c('0xd')](_0x50c0b7)&&_0x826c('0xe')===typeof _0x50c0b7&&!_[_0x826c('0xf')](_0x50c0b7)){return _0x50c0b7;}return'\x22\x22\x20<>';};exports[_0x826c('0x12')]=function(_0x1220ef){if(_[_0x826c('0x13')](_0x1220ef)){return![];}return _0x1220ef;};exports[_0x826c('0x14')]=function(_0x5c4e5e,_0x1699b4,_0x6dfbb4,_0xdbad27,_0x4f9de9,_0x96bc52){var _0x325668={'XMD-QUEUE':_0x1699b4[_0x826c('0x15')]?_0x1699b4[_0x826c('0x15')][_0x826c('0x16')]:'','XMD-CALLERID':_0xdbad27,'XMD-CALLERID-PREVIEW':_0x96bc52?util[_0x826c('0x11')](_0x826c('0x10'),_0x96bc52[_0x826c('0x17')],_0x96bc52['calleridnum']):_0xdbad27,'XMD-DIALID':_0x4f9de9,'XMD-CONTACTID':_0x1699b4[_0x826c('0x18')],'XMD-CDRTYPE':_0x826c('0x19'),'CALLERID(all)':_0xdbad27,'XMD-VOICEQUEUEID':_0x1699b4['VoiceQueueId'],'XMD-DIALCHANNEL':_0x6dfbb4,'XMD-DIALTIMEOUT':_0x5c4e5e[_0x826c('0x1a')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x826c('0x1b'),_0x5c4e5e[_0x826c('0x1c')]?'g':'',_[_0x826c('0xf')](_0x5c4e5e[_0x826c('0x1d')])?'':_0x826c('0x1e')),'XMD-DIALURL':_0x5c4e5e[_0x826c('0x1f')]||'','XMD-AGI':_0x5c4e5e[_0x826c('0x20')]?util['format'](_0x826c('0x21'),ipAgi,_0x5c4e5e[_0x826c('0x20')]):'NONE','XMD-AGIAFTER':_0x5c4e5e[_0x826c('0x1c')]?util[_0x826c('0x11')](_0x826c('0x21'),ipAgi,_0x5c4e5e[_0x826c('0x1c')]):_0x826c('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x96bc52?_0x96bc52[_0x826c('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x96bc52?_0x96bc52[_0x826c('0x24')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x826c('0xf')](_0x5c4e5e['monitor_format'])){_0x325668[util[_0x826c('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x5c4e5e[_0x826c('0x1d')];_0x325668[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x4f9de9;}return _0x325668;};exports[_0x826c('0x25')]=function(_0x1c1b1d){var _0xa93257={};for(var _0x1ccb90 in _0x1c1b1d){if(_0x1c1b1d['hasOwnProperty'](_0x1ccb90)){_0xa93257[util[_0x826c('0x11')]('%s',_[_0x826c('0x26')](_0x1ccb90))]=_0x1c1b1d[_0x1ccb90];}}return{'variables':_0xa93257};};exports[_0x826c('0x27')]=function(_0xfa21f4,_0x3e640f){if(!_['isNil'](_0xfa21f4)){if(_0xfa21f4['hasOwnProperty'](_0x826c('0x28'))){if(_0xfa21f4[_0x826c('0x28')]>0x0){_0xfa21f4['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3e640f);}}}else{logger['error'](_0x826c('0x29'),_0x3e640f);}};exports[_0x826c('0x2a')]=function(_0x5c902d){var _0x2a88d4=moment()[_0x826c('0x11')](_0x826c('0x2b'));_0x5c902d[_0x826c('0x2c')]=0xd;_0x5c902d['statedesc']=_0x826c('0x2d');_0x5c902d[_0x826c('0x2e')]=_0x2a88d4;_0x5c902d[_0x826c('0x2f')]=_0x2a88d4;_0x5c902d[_0x826c('0x30')]=_0x2a88d4;};exports[_0x826c('0x31')]=function(_0x2e90f0,_0x4f6e11,_0x2864ac){var _0x30bd50=moment()[_0x826c('0x11')](_0x826c('0x2b'));_0x2e90f0['state']=_0x4f6e11;_0x2e90f0[_0x826c('0x32')]=_0x2864ac;_0x2e90f0[_0x826c('0x2f')]=_0x30bd50;_0x2e90f0[_0x826c('0x33')]=utils[_0x826c('0x34')](_0x2e90f0[_0x826c('0x2f')],_0x2e90f0[_0x826c('0x2e')]);};exports[_0x826c('0x35')]=function(_0x441a53,_0x24f61a,_0x4c06fa){_0x441a53[_0x826c('0x36')]=_0x24f61a;_0x441a53['UserId']=_0x4c06fa;};exports['logCustomer']=function(_0x32f3df,_0x6a5524,_0x3bd4b6){var _0x1ff61b=moment()['format'](_0x826c('0x2b'));_0x32f3df[_0x826c('0x2c')]=_0x6a5524;_0x32f3df[_0x826c('0x32')]=_0x3bd4b6;_0x32f3df['responsetime']=_0x32f3df[_0x826c('0x2f')]?_0x32f3df[_0x826c('0x2f')]:_0x1ff61b;_0x32f3df[_0x826c('0x30')]=_0x32f3df[_0x826c('0x30')]?_0x32f3df[_0x826c('0x30')]:_0x1ff61b;_0x32f3df[_0x826c('0x33')]=utils[_0x826c('0x34')](_0x32f3df['responsetime']||0x0,_0x32f3df[_0x826c('0x2e')]||0x0);_0x32f3df[_0x826c('0x37')]=_0x32f3df[_0x826c('0x38')]?utils[_0x826c('0x34')](_0x32f3df[_0x826c('0x30')],_0x32f3df[_0x826c('0x38')]):0x0;};exports[_0x826c('0x39')]=function(_0x32524c){return _0x32524c===_0x826c('0x3a');};exports['variablesAction']=function(_0x30f620,_0x36a1a5,_0x23f213,_0x1aaf6b,_0x3179c7){var _0x3aa466=_0x1aaf6b?_0x826c('0x3b'):_0x30f620[_0x826c('0x17')];_0x3aa466=_0x3179c7?_0x826c('0x3c'):_0x3aa466;return{'actionid':_0x30f620['uniqueid'],'action':_0x826c('0x3d'),'channel':_0x30f620[_0x826c('0x3e')],'callerid':util[_0x826c('0x11')](_0x826c('0x10'),_0x3aa466,_0x30f620[_0x826c('0x3f')]),'Exten':_0x826c('0x40'),'Context':_0x826c('0x41'),'Priority':'1','variable':_0x23f213,'timeout':(_0x36a1a5[_0x826c('0x42')]||0x1e)*0x3e8,'async':!![],'channelid':_0x30f620[_0x826c('0x43')]};};exports['totalGlobal']=function(_0x2485ca){return _0x2485ca[_0x826c('0x44')]+_0x2485ca[_0x826c('0x45')]+_0x2485ca['countnoanswerretry']+_0x2485ca[_0x826c('0x46')]+_0x2485ca['countnosuchnumberretry'];};exports[_0x826c('0x47')]=function(_0x315028){var _0x56875d=_[_0x826c('0x48')](_0x315028);_0x56875d[_0x826c('0x2c')]=0xf;_0x56875d[_0x826c('0x32')]=_0x826c('0x49');return _0x56875d;};exports[_0x826c('0x4a')]=function(_0x2dbdca,_0x588e2d,_0x54be1){var _0x51ccbe={};_0x51ccbe[_0x588e2d]=_0x2dbdca[_0x588e2d];_0x51ccbe['active']=![];_0x51ccbe[_0x826c('0x4b')]=moment()[_0x826c('0x4c')](_0x54be1,'minutes')[_0x826c('0x11')](_0x826c('0x2b'));_0x51ccbe[_0x826c('0x18')]=_0x2dbdca[_0x826c('0x18')];_0x51ccbe['ListId']=_0x2dbdca['ListId'];_0x51ccbe[_0x826c('0x4d')]=_0x2dbdca['VoiceQueueId']||undefined;return _0x51ccbe;};exports['decrementTalkink']=function(_0x4a63be,_0x3dc538){if(!_[_0x826c('0x13')](_0x4a63be)){if(_0x4a63be[_0x826c('0x4e')]>0x0){_0x4a63be[_0x826c('0x4e')]-=0x1;}else{logger[_0x826c('0x4f')](_0x3dc538,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x826c('0x4f')](_0x3dc538,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x826c('0x50')]=function(_0x5da3fa){if(_0x5da3fa<=0x0){return!![];}return![];};function buildObj(_0x49e9ca,_0x1bdc4f,_0xea4cd6){_0x49e9ca[_0x826c('0x51')]=_0x1bdc4f;_0x49e9ca[_0x826c('0x16')]=_0x49e9ca['queue'];_0x49e9ca[_0x826c('0x52')]=_0x49e9ca[_0x826c('0x3e')];_0x49e9ca[_0x826c('0x53')]=_0x826c('0x54');if(_0xea4cd6){_0x49e9ca[_0x826c('0x55')]=_0xea4cd6[_0x826c('0x55')];}return _0x49e9ca;}exports[_0x826c('0x56')]=buildObj;exports['buildAcw']=function(_0x550ae4){var _0x5b513e={};_0x5b513e[_0x826c('0x57')]=_0x550ae4['queue'];_0x5b513e[_0x826c('0x52')]=_0x550ae4[_0x826c('0x3e')];_0x5b513e[_0x826c('0x43')]=_0x550ae4[_0x826c('0x43')];return _0x5b513e;};exports['agentReadyId']=function(_0x4195ea){var _0x57bb0f=[];for(var _0x4d58c9 in _0x4195ea){if(_0x4195ea[_0x826c('0x58')](_0x4d58c9)){if(!_[_0x826c('0x13')](_0x4195ea[_0x4d58c9])&&_0x4195ea[_0x4d58c9][_0x826c('0x2c')]===_0x826c('0x59')&&_0x4195ea[_0x4d58c9][_0x826c('0x5a')]===_0x826c('0x5b')){_0x57bb0f['push'](_0x4195ea[_0x4d58c9]['id']);}}}return _0x57bb0f;};exports[_0x826c('0x5c')]=function(_0x2720b4){var _0x538bf0=moment()[_0x826c('0x5d')](0x0);var _0x4a416d=moment(_0x2720b4)[_0x826c('0x5d')](0x0);return _0x538bf0[_0x826c('0x5e')](_0x4a416d,_0x826c('0x5f'));};exports[_0x826c('0x60')]=function(_0x245a5d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x245a5d[_0x826c('0x18')],'ListId':_0x245a5d[_0x826c('0x61')],'VoiceQueueId':_0x245a5d[_0x826c('0x4d')]||undefined,'CampaignId':_0x245a5d[_0x826c('0x62')]||undefined};};exports[_0x826c('0x63')]=function(_0x22a8aa){if(_0x22a8aa==='uniqueid'||_0x22a8aa==='idContact'||_0x22a8aa===_0x826c('0x57')||_0x22a8aa===_0x826c('0x64')||_0x22a8aa==='campaigntype'||_0x22a8aa===_0x826c('0x65')||_0x22a8aa==='membername'||_0x22a8aa===_0x826c('0x3e')||_0x22a8aa===_0x826c('0x17')||_0x22a8aa==='active'||_0x22a8aa===_0x826c('0x3f')||_0x22a8aa==='scheduledat'||_0x22a8aa==='countbusyretry'||_0x22a8aa===_0x826c('0x45')||_0x22a8aa===_0x826c('0x66')||_0x22a8aa===_0x826c('0x67')||_0x22a8aa===_0x826c('0x68')||_0x22a8aa===_0x826c('0x69')||_0x22a8aa===_0x826c('0x6a')||_0x22a8aa===_0x826c('0x6b')||_0x22a8aa==='ContactId'||_0x22a8aa===_0x826c('0x61')||_0x22a8aa===_0x826c('0x6c')||_0x22a8aa===_0x826c('0x4d')||_0x22a8aa===_0x826c('0x6d')||_0x22a8aa===_0x826c('0x6e')||_0x22a8aa===_0x826c('0x6f')||_0x22a8aa==='xmd-phone'||_0x22a8aa===_0x826c('0x70')||_0x22a8aa===_0x826c('0x71')||_0x22a8aa===_0x826c('0x72')||_0x22a8aa===_0x826c('0x73')||_0x22a8aa===_0x826c('0x74')||_0x22a8aa===_0x826c('0x75')||_0x22a8aa===_0x826c('0x76')||_0x22a8aa==='xmd-cdrtype'||_0x22a8aa==='xmd-callerid'||_0x22a8aa===_0x826c('0x77')||_0x22a8aa==='xmd-agi'||_0x22a8aa===_0x826c('0x78')||_0x22a8aa===_0x826c('0x79')||_0x22a8aa==='rtpaudioqosjitter'||_0x22a8aa==='rtpaudioqosjitterbridged'||_0x22a8aa==='rtpaudioqosloss'||_0x22a8aa===_0x826c('0x7a')||_0x22a8aa===_0x826c('0x7b')||_0x22a8aa==='rtpaudioqosrttbridged'||_0x22a8aa===_0x826c('0x78')||_0x22a8aa===_0x826c('0x79')||_0x22a8aa===_0x826c('0x7c')||_0x22a8aa==='rtpaudioqosjitterbridged'||_0x22a8aa===_0x826c('0x7d')||_0x22a8aa==='rtpaudioqoslossbridged'||_0x22a8aa===_0x826c('0x7b')||_0x22a8aa===_0x826c('0x7e')||_0x22a8aa===_0x826c('0x7f')||_0x22a8aa==='bridgepvtcallid'||_0x22a8aa===_0x826c('0x2c')||_0x22a8aa===_0x826c('0x32')){return![];}return!![];};exports[_0x826c('0x80')]=function(_0x59aa10,_0x50a741){var _0x57a090,_0xcbbd1f,_0xd458d4;if(_0x50a741<=0x0){_0x50a741=0x1;}_0x57a090=new RegExp(_0x826c('0x81')+_0x50a741+'}$');_0xcbbd1f=Math[_0x826c('0x82')](0xa,_0x50a741-0x1);_0xd458d4=Math[_0x826c('0x82')](0xa,_0x50a741)-0x1;return util[_0x826c('0x11')]('%s',_[_0x826c('0x83')](_0x59aa10,_0x57a090,_[_0x826c('0x84')](_0xcbbd1f,_0xd458d4)));};exports[_0x826c('0x85')]=function(_0x20010a){var _0x31aee3=_0x20010a[_0x826c('0x86')](/"(.*?)"/);return _0x31aee3?_0x31aee3[0x1]:_0x20010a;};exports[_0x826c('0x87')]=function(_0x59f786){var _0x55ef98=_0x59f786[_0x826c('0x86')](/<(.*?)>/);return _0x55ef98?_0x55ef98[0x1]:_0x59f786;};function buildNoAnswerEventPayload(_0x33e17f,_0x2c4712){var _0x575d7b=buildObj(_0x33e17f,_0x826c('0x88'));if(!_[_0x826c('0xf')](_0x2c4712[_0x826c('0x89')])){Object[_0x826c('0x8a')](_0x2c4712[_0x826c('0x89')])['forEach'](function(_0x11aa62){_0x575d7b[_0x11aa62[_0x826c('0x8b')]()]=_0x2c4712[_0x826c('0x89')][_0x11aa62];});}return _0x575d7b;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload;
\ No newline at end of file