Built motion from commit 953226e6.|2.6.32
[motion2.git] / server / services / ami / preview / util / util.js
index 1d1c3f5..a4c5794 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf647=['countagentrejectretry','clone','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','decrementTalking','pTalking','[decrementTalking]\x20object\x20talking\x20is\x20negative','[decrementTalking]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','motionChannel','voice','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','push','milliseconds','diff','CampaignId','filterKey','idContact','type','countbusyretry','countglobal','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','replace','random','match','extractCalleridNumber','noanswer','variables','forEach','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','Blacklist','starttime','responsetime','endtime','logAgent','state','ringtime','getSeconds','membername','UserId','logCustomer','statedesc','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry'];(function(_0x5018c7,_0x2e7e3f){var _0x477ec2=function(_0x63083d){while(--_0x63083d){_0x5018c7['push'](_0x5018c7['shift']());}};_0x477ec2(++_0x2e7e3f);}(_0xf647,0x159));var _0x7f64=function(_0x1b6f25,_0x48432a){_0x1b6f25=_0x1b6f25-0x0;var _0x3af0d2=_0xf647[_0x1b6f25];return _0x3af0d2;};'use strict';var util=require(_0x7f64('0x0'));var _=require(_0x7f64('0x1'));var moment=require(_0x7f64('0x2'));var logger=require(_0x7f64('0x3'))(_0x7f64('0x4'));var ipAgi=process[_0x7f64('0x5')][_0x7f64('0x6')]||_0x7f64('0x7');var utils=require('../../dialer/utils');exports[_0x7f64('0x8')]=function(_0x4ffda0){return function(_0x295c1a){logger[_0x7f64('0x9')](_0x4ffda0,util[_0x7f64('0xa')](_0x295c1a,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x56ab76,_0x2e3251){logger[_0x7f64('0xb')](_0x56ab76,util[_0x7f64('0xa')](_0x2e3251,{'showHidden':![],'depth':null}));};exports[_0x7f64('0xc')]=function(_0x55ba3d,_0x5b0d3c){logger[_0x7f64('0x9')](_0x55ba3d,util['inspect'](_0x5b0d3c,{'showHidden':![],'depth':null}));};exports[_0x7f64('0xd')]=function(_0x41e4ac){return function(_0x32f462){logger[_0x7f64('0xb')](_0x41e4ac,util[_0x7f64('0xa')](_0x32f462,{'showHidden':![],'depth':null}));};};exports[_0x7f64('0xe')]=function(_0x57b988,_0x4ff86c,_0x4f41f8){return{'message':_0x57b988,'unlock':_0x4ff86c,'active':_0x4f41f8};};exports[_0x7f64('0xf')]=function(_0x53bc95,_0x1e10fa,_0x323244){if(!_[_0x7f64('0x10')](_0x323244)&&_0x7f64('0x11')===typeof _0x323244&&!_['isEmpty'](_0x323244)){if(!_[_0x7f64('0x10')](_0x1e10fa)&&_0x7f64('0x11')===typeof _0x1e10fa&&!_[_0x7f64('0x12')](_0x1e10fa)){return util['format'](_0x7f64('0x13'),_0x1e10fa,_0x323244);}return util[_0x7f64('0x14')](_0x7f64('0x13'),_0x323244,_0x323244);}if(!_[_0x7f64('0x10')](_0x53bc95)&&'string'===typeof _0x53bc95&&!_['isEmpty'](_0x53bc95)){return _0x53bc95;}return _0x7f64('0x15');};exports[_0x7f64('0x16')]=function(_0x25dbe3){if(_[_0x7f64('0x17')](_0x25dbe3)){return![];}return _0x25dbe3;};exports['addVariables']=function(_0x3f775a,_0x185639,_0x137c82,_0x55fe61,_0x3d2452,_0x53c231){var _0x235622={'XMD-QUEUE':_0x185639['Queue']?_0x185639[_0x7f64('0x18')][_0x7f64('0x19')]:'','XMD-CALLERID':_0x55fe61,'XMD-CALLERID-PREVIEW':_0x53c231?util[_0x7f64('0x14')]('\x22%s\x22\x20<%s>',_0x53c231[_0x7f64('0x1a')],_0x53c231[_0x7f64('0x1b')]):_0x55fe61,'XMD-DIALID':_0x3d2452,'XMD-CONTACTID':_0x185639['ContactId'],'XMD-CDRTYPE':_0x7f64('0x1c'),'CALLERID(all)':_0x55fe61,'XMD-VOICEQUEUEID':_0x185639[_0x7f64('0x1d')],'XMD-DIALCHANNEL':_0x137c82,'XMD-DIALTIMEOUT':_0x3f775a[_0x7f64('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x7f64('0x14')](_0x7f64('0x1f'),_0x3f775a['dialQueueProject2']?'g':'',_[_0x7f64('0x12')](_0x3f775a[_0x7f64('0x20')])?'':_0x7f64('0x21')),'XMD-DIALURL':_0x3f775a[_0x7f64('0x22')]||'','XMD-AGI':_0x3f775a[_0x7f64('0x23')]?util['format'](_0x7f64('0x24'),ipAgi,_0x3f775a[_0x7f64('0x23')]):'NONE','XMD-AGIAFTER':_0x3f775a[_0x7f64('0x25')]?util[_0x7f64('0x14')](_0x7f64('0x24'),ipAgi,_0x3f775a[_0x7f64('0x25')]):_0x7f64('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x53c231?_0x53c231[_0x7f64('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x53c231?_0x53c231[_0x7f64('0x28')]:'','XMD-DESTINATION':_0x7f64('0x29'),'SIPADDHEADER':_0x7f64('0x2a')};if(!_[_0x7f64('0x12')](_0x3f775a[_0x7f64('0x20')])){_0x235622[util[_0x7f64('0x14')]('%s',_0x7f64('0x2b'))]=_0x3f775a[_0x7f64('0x20')];_0x235622[util[_0x7f64('0x14')]('%s',_0x7f64('0x2c'))]=_0x3d2452;}return _0x235622;};exports[_0x7f64('0x2d')]=function(_0x10383a){var _0x5b5af3={};for(var _0x394c5e in _0x10383a){if(_0x10383a[_0x7f64('0x2e')](_0x394c5e)){_0x5b5af3[util[_0x7f64('0x14')]('%s',_[_0x7f64('0x2f')](_0x394c5e))]=_0x10383a[_0x394c5e];}}return{'variables':_0x5b5af3};};exports[_0x7f64('0x30')]=function(_0x42fb34){var _0x31e9b8=moment()[_0x7f64('0x14')](_0x7f64('0x31'));_0x42fb34['state']=0xd;_0x42fb34['statedesc']=_0x7f64('0x32');_0x42fb34[_0x7f64('0x33')]=_0x31e9b8;_0x42fb34[_0x7f64('0x34')]=_0x31e9b8;_0x42fb34[_0x7f64('0x35')]=_0x31e9b8;};exports[_0x7f64('0x36')]=function(_0x197183,_0x39f91c,_0x1b857b){var _0x37c246=moment()[_0x7f64('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x197183[_0x7f64('0x37')]=_0x39f91c;_0x197183['statedesc']=_0x1b857b;_0x197183[_0x7f64('0x34')]=_0x37c246;_0x197183[_0x7f64('0x38')]=utils[_0x7f64('0x39')](_0x197183[_0x7f64('0x34')],_0x197183[_0x7f64('0x33')]);};exports['logLookAgent']=function(_0x31b757,_0x2ea55b,_0x3ad978){_0x31b757[_0x7f64('0x3a')]=_0x2ea55b;_0x31b757[_0x7f64('0x3b')]=_0x3ad978;};exports[_0x7f64('0x3c')]=function(_0x12e760,_0x2138a4,_0x345bff){var _0x3afde7=moment()[_0x7f64('0x14')](_0x7f64('0x31'));_0x12e760[_0x7f64('0x37')]=_0x2138a4;_0x12e760[_0x7f64('0x3d')]=_0x345bff;_0x12e760[_0x7f64('0x34')]=_0x12e760[_0x7f64('0x34')]?_0x12e760[_0x7f64('0x34')]:_0x3afde7;_0x12e760['endtime']=_0x12e760[_0x7f64('0x35')]?_0x12e760[_0x7f64('0x35')]:_0x3afde7;_0x12e760[_0x7f64('0x38')]=utils[_0x7f64('0x39')](_0x12e760[_0x7f64('0x34')]||0x0,_0x12e760[_0x7f64('0x33')]||0x0);_0x12e760['talktime']=_0x12e760[_0x7f64('0x3e')]?utils[_0x7f64('0x39')](_0x12e760[_0x7f64('0x35')],_0x12e760[_0x7f64('0x3e')]):0x0;};exports[_0x7f64('0x3f')]=function(_0x5f5d56){return _0x5f5d56===_0x7f64('0x40');};exports[_0x7f64('0x41')]=function(_0x246665,_0x2485e0,_0x404a88,_0xa05b1a,_0x15ac30){var _0x1e85b7=_0xa05b1a?_0x7f64('0x42'):_0x246665['calleridname'];_0x1e85b7=_0x15ac30?'BOOKED':_0x1e85b7;return{'actionid':_0x246665[_0x7f64('0x43')],'action':_0x7f64('0x44'),'channel':_0x246665[_0x7f64('0x45')],'callerid':util[_0x7f64('0x14')]('\x22%s\x22\x20<%s>',_0x1e85b7,_0x246665[_0x7f64('0x1b')]),'Exten':_0x7f64('0x29'),'Context':_0x7f64('0x46'),'Priority':'1','variable':_0x404a88,'timeout':(_0x2485e0[_0x7f64('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x246665[_0x7f64('0x43')]};};exports[_0x7f64('0x48')]=function(_0x189c2e){return _0x189c2e['countbusyretry']+_0x189c2e[_0x7f64('0x49')]+_0x189c2e[_0x7f64('0x4a')]+_0x189c2e[_0x7f64('0x4b')]+_0x189c2e['countnosuchnumberretry'];};exports['cloneAction']=function(_0x4409f9){var _0x20a0cc=_[_0x7f64('0x4c')](_0x4409f9);_0x20a0cc[_0x7f64('0x37')]=0xf;_0x20a0cc[_0x7f64('0x3d')]=_0x7f64('0x4d');return _0x20a0cc;};exports[_0x7f64('0x4e')]=function(_0x4067b7,_0x8e4d44,_0x29ca72){var _0x2b098b={};_0x2b098b[_0x8e4d44]=_0x4067b7[_0x8e4d44];_0x2b098b[_0x7f64('0x4f')]=![];_0x2b098b[_0x7f64('0x50')]=moment()[_0x7f64('0x51')](_0x29ca72,_0x7f64('0x52'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2b098b[_0x7f64('0x53')]=_0x4067b7['ContactId'];_0x2b098b[_0x7f64('0x54')]=_0x4067b7['ListId'];_0x2b098b[_0x7f64('0x1d')]=_0x4067b7[_0x7f64('0x1d')]||undefined;return _0x2b098b;};exports[_0x7f64('0x55')]=function(_0x331d79,_0x2f61ab){if(!_[_0x7f64('0x17')](_0x331d79)){if(_0x331d79[_0x7f64('0x56')]>0x0){_0x331d79['pTalking']-=0x1;}else{logger['info'](_0x2f61ab,_0x7f64('0x57'));}}else{logger['error'](_0x2f61ab,_0x7f64('0x58'));}};exports[_0x7f64('0x59')]=function(_0x4238c8){if(_0x4238c8<=0x0){return!![];}return![];};function buildObj(_0x220e7a,_0x170444,_0x42d757){_0x220e7a[_0x7f64('0x5a')]=_0x170444;_0x220e7a[_0x7f64('0x19')]=_0x220e7a[_0x7f64('0x5b')];_0x220e7a['interface']=_0x220e7a[_0x7f64('0x45')];_0x220e7a[_0x7f64('0x5c')]=_0x7f64('0x5d');if(_0x42d757){_0x220e7a[_0x7f64('0x5e')]=_0x42d757[_0x7f64('0x5e')];}return _0x220e7a;}exports['buildObj']=buildObj;exports[_0x7f64('0x5f')]=function(_0x30d24b){var _0x2a1848=[];for(var _0x400504 in _0x30d24b){if(_0x30d24b[_0x7f64('0x2e')](_0x400504)){if(!_[_0x7f64('0x17')](_0x30d24b[_0x400504])&&_0x30d24b[_0x400504]['state']===_0x7f64('0x60')&&_0x30d24b[_0x400504][_0x7f64('0x61')]===_0x7f64('0x62')){_0x2a1848[_0x7f64('0x63')](_0x30d24b[_0x400504]['id']);}}}return _0x2a1848;};exports['getDiff']=function(_0x46d60f){var _0x3261bc=moment()['milliseconds'](0x0);var _0x6ca8be=moment(_0x46d60f)[_0x7f64('0x64')](0x0);return _0x3261bc[_0x7f64('0x65')](_0x6ca8be,'seconds');};exports['createBody']=function(_0x16bdee){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x16bdee[_0x7f64('0x53')],'ListId':_0x16bdee[_0x7f64('0x54')],'VoiceQueueId':_0x16bdee[_0x7f64('0x1d')]||undefined,'CampaignId':_0x16bdee[_0x7f64('0x66')]||undefined};};exports[_0x7f64('0x67')]=function(_0x55a075){if(_0x55a075===_0x7f64('0x43')||_0x55a075===_0x7f64('0x68')||_0x55a075===_0x7f64('0x5b')||_0x55a075===_0x7f64('0x69')||_0x55a075==='campaigntype'||_0x55a075==='dialAnswer'||_0x55a075===_0x7f64('0x3a')||_0x55a075===_0x7f64('0x45')||_0x55a075===_0x7f64('0x1a')||_0x55a075===_0x7f64('0x4f')||_0x55a075===_0x7f64('0x1b')||_0x55a075===_0x7f64('0x50')||_0x55a075===_0x7f64('0x6a')||_0x55a075===_0x7f64('0x49')||_0x55a075===_0x7f64('0x4a')||_0x55a075===_0x7f64('0x6b')||_0x55a075==='callback'||_0x55a075===_0x7f64('0x6c')||_0x55a075===_0x7f64('0x6d')||_0x55a075==='recallme'||_0x55a075===_0x7f64('0x53')||_0x55a075===_0x7f64('0x54')||_0x55a075==='UserId'||_0x55a075===_0x7f64('0x1d')||_0x55a075===_0x7f64('0x6e')||_0x55a075===_0x7f64('0x6f')||_0x55a075==='xmd-queue'||_0x55a075===_0x7f64('0x70')||_0x55a075===_0x7f64('0x71')||_0x55a075===_0x7f64('0x72')||_0x55a075==='xmd-dialtimeout'||_0x55a075===_0x7f64('0x73')||_0x55a075===_0x7f64('0x74')||_0x55a075===_0x7f64('0x75')||_0x55a075===_0x7f64('0x76')||_0x55a075===_0x7f64('0x77')||_0x55a075==='xmd-callerid'||_0x55a075===_0x7f64('0x78')||_0x55a075===_0x7f64('0x79')||_0x55a075==='rtpaudioqos'||_0x55a075===_0x7f64('0x7a')||_0x55a075===_0x7f64('0x7b')||_0x55a075===_0x7f64('0x7c')||_0x55a075===_0x7f64('0x7d')||_0x55a075===_0x7f64('0x7e')||_0x55a075===_0x7f64('0x7f')||_0x55a075==='rtpaudioqosrttbridged'||_0x55a075==='rtpaudioqos'||_0x55a075===_0x7f64('0x7a')||_0x55a075===_0x7f64('0x7b')||_0x55a075===_0x7f64('0x7c')||_0x55a075===_0x7f64('0x7d')||_0x55a075===_0x7f64('0x7e')||_0x55a075===_0x7f64('0x7f')||_0x55a075===_0x7f64('0x80')||_0x55a075===_0x7f64('0x81')||_0x55a075===_0x7f64('0x82')||_0x55a075===_0x7f64('0x37')||_0x55a075===_0x7f64('0x3d')){return![];}return!![];};exports[_0x7f64('0x83')]=function(_0x11894a,_0x288460){var _0x53835d,_0x2c3708,_0x3f80ed;if(_0x288460<=0x0){_0x288460=0x1;}_0x53835d=new RegExp('\x5cw{0,'+_0x288460+'}$');_0x2c3708=Math['pow'](0xa,_0x288460-0x1);_0x3f80ed=Math['pow'](0xa,_0x288460)-0x1;return util[_0x7f64('0x14')]('%s',_[_0x7f64('0x84')](_0x11894a,_0x53835d,_[_0x7f64('0x85')](_0x2c3708,_0x3f80ed)));};exports['extractCalleridName']=function(_0x2c2e5d){var _0x493373=_0x2c2e5d[_0x7f64('0x86')](/"(.*?)"/);return _0x493373?_0x493373[0x1]:_0x2c2e5d;};exports[_0x7f64('0x87')]=function(_0x2bdcb1){var _0x24e1c4=_0x2bdcb1[_0x7f64('0x86')](/<(.*?)>/);return _0x24e1c4?_0x24e1c4[0x1]:_0x2bdcb1;};function buildNoAnswerEventPayload(_0x3c243d,_0x5e6312){var _0x2af292=buildObj(_0x3c243d,_0x7f64('0x88'));if(!_[_0x7f64('0x12')](_0x5e6312['variables'])){Object['keys'](_0x5e6312[_0x7f64('0x89')])[_0x7f64('0x8a')](function(_0x1e5bf3){_0x2af292[_0x1e5bf3['toLowerCase']()]=_0x5e6312[_0x7f64('0x89')][_0x1e5bf3];});}return _0x2af292;}exports[_0x7f64('0x8b')]=buildNoAnswerEventPayload;
\ No newline at end of file
+var _0x4ec4=['\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','toLowerVariables','hasOwnProperty','toLower','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','getSeconds','logLookAgent','membername','UserId','logCustomer','ringtime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','calleridnum','totalGlobal','countbusyretry','countcongestionretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','ListId','decrementTalking','pTalking','[decrementTalking]\x20object\x20talking\x20is\x20negative','[decrementTalking]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','voice','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','push','getDiff','milliseconds','CampaignId','filterKey','idContact','type','dialAnswer','channelAgent','countnoanswerretry','callback','callbackuniqueid','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','pow','replace','random','match','extractCalleridNumber','variables','keys','forEach','toLowerCase','moment','preview','env','XCALLY_IP_AGI','../../dialer/utils','error','inspect','logger','info','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','ContactId','dialer','VoiceQueueId'];(function(_0x576d8a,_0x2d7bde){var _0x3dc3ef=function(_0xc76758){while(--_0xc76758){_0x576d8a['push'](_0x576d8a['shift']());}};_0x3dc3ef(++_0x2d7bde);}(_0x4ec4,0xf5));var _0x44ec=function(_0x236f98,_0x20aa59){_0x236f98=_0x236f98-0x0;var _0xff6ca6=_0x4ec4[_0x236f98];return _0xff6ca6;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x44ec('0x0'));var logger=require('../../../../config/logger')(_0x44ec('0x1'));var ipAgi=process[_0x44ec('0x2')][_0x44ec('0x3')]||'127.0.0.1';var utils=require(_0x44ec('0x4'));exports['loggerCatch']=function(_0x40f26c){return function(_0x209d31){logger[_0x44ec('0x5')](_0x40f26c,util[_0x44ec('0x6')](_0x209d31,{'showHidden':![],'depth':null}));};};exports[_0x44ec('0x7')]=function(_0x54136b,_0x11795c){logger[_0x44ec('0x8')](_0x54136b,util[_0x44ec('0x6')](_0x11795c,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x5d5e5c,_0x452be1){logger[_0x44ec('0x5')](_0x5d5e5c,util['inspect'](_0x452be1,{'showHidden':![],'depth':null}));};exports[_0x44ec('0x9')]=function(_0x3e726f){return function(_0x4c97fd){logger[_0x44ec('0x8')](_0x3e726f,util[_0x44ec('0x6')](_0x4c97fd,{'showHidden':![],'depth':null}));};};exports[_0x44ec('0xa')]=function(_0x3c1be0,_0x33f96f,_0xd7740a){return{'message':_0x3c1be0,'unlock':_0x33f96f,'active':_0xd7740a};};exports[_0x44ec('0xb')]=function(_0x6c94f7,_0x8646e4,_0x412aad){if(!_[_0x44ec('0xc')](_0x412aad)&&_0x44ec('0xd')===typeof _0x412aad&&!_[_0x44ec('0xe')](_0x412aad)){if(!_[_0x44ec('0xc')](_0x8646e4)&&_0x44ec('0xd')===typeof _0x8646e4&&!_[_0x44ec('0xe')](_0x8646e4)){return util['format'](_0x44ec('0xf'),_0x8646e4,_0x412aad);}return util[_0x44ec('0x10')](_0x44ec('0xf'),_0x412aad,_0x412aad);}if(!_[_0x44ec('0xc')](_0x6c94f7)&&'string'===typeof _0x6c94f7&&!_['isEmpty'](_0x6c94f7)){return _0x6c94f7;}return _0x44ec('0x11');};exports[_0x44ec('0x12')]=function(_0x30f8e1){if(_[_0x44ec('0x13')](_0x30f8e1)){return![];}return _0x30f8e1;};exports[_0x44ec('0x14')]=function(_0x476f70,_0x25a11f,_0x3483b5,_0x59ff2d,_0x6666f5,_0x5cc9d1){var _0x4f9d9a={'XMD-QUEUE':_0x25a11f[_0x44ec('0x15')]?_0x25a11f[_0x44ec('0x15')]['name']:'','XMD-CALLERID':_0x59ff2d,'XMD-CALLERID-PREVIEW':_0x5cc9d1?util['format'](_0x44ec('0xf'),_0x5cc9d1['calleridname'],_0x5cc9d1['calleridnum']):_0x59ff2d,'XMD-DIALID':_0x6666f5,'XMD-CONTACTID':_0x25a11f[_0x44ec('0x16')],'XMD-CDRTYPE':_0x44ec('0x17'),'CALLERID(all)':_0x59ff2d,'XMD-VOICEQUEUEID':_0x25a11f[_0x44ec('0x18')],'XMD-DIALCHANNEL':_0x3483b5,'XMD-DIALTIMEOUT':_0x476f70['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x44ec('0x10')](_0x44ec('0x19'),_0x476f70[_0x44ec('0x1a')]?'g':'',_[_0x44ec('0xe')](_0x476f70['monitor_format'])?'':_0x44ec('0x1b')),'XMD-DIALURL':_0x476f70['dialPreviewUrl']||'','XMD-AGI':_0x476f70[_0x44ec('0x1c')]?util[_0x44ec('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x476f70['dialQueueProject']):_0x44ec('0x1d'),'XMD-AGIAFTER':_0x476f70[_0x44ec('0x1a')]?util['format'](_0x44ec('0x1e'),ipAgi,_0x476f70[_0x44ec('0x1a')]):_0x44ec('0x1d'),'XMD-ORIGINATECALLERIDNUM':_0x5cc9d1?_0x5cc9d1[_0x44ec('0x1f')]:'','XMD-ORIGINATECALLERIDNAME':_0x5cc9d1?_0x5cc9d1[_0x44ec('0x20')]:'','XMD-DESTINATION':_0x44ec('0x21'),'SIPADDHEADER':_0x44ec('0x22')};if(!_[_0x44ec('0xe')](_0x476f70[_0x44ec('0x23')])){_0x4f9d9a[util['format']('%s',_0x44ec('0x24'))]=_0x476f70[_0x44ec('0x23')];_0x4f9d9a[util[_0x44ec('0x10')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x6666f5;}return _0x4f9d9a;};exports[_0x44ec('0x25')]=function(_0x4d790d){var _0x262f0b={};for(var _0x20f359 in _0x4d790d){if(_0x4d790d[_0x44ec('0x26')](_0x20f359)){_0x262f0b[util[_0x44ec('0x10')]('%s',_[_0x44ec('0x27')](_0x20f359))]=_0x4d790d[_0x20f359];}}return{'variables':_0x262f0b};};exports[_0x44ec('0x28')]=function(_0x5dbb19){var _0x38cf3c=moment()['format'](_0x44ec('0x29'));_0x5dbb19[_0x44ec('0x2a')]=0xd;_0x5dbb19[_0x44ec('0x2b')]=_0x44ec('0x2c');_0x5dbb19[_0x44ec('0x2d')]=_0x38cf3c;_0x5dbb19[_0x44ec('0x2e')]=_0x38cf3c;_0x5dbb19[_0x44ec('0x2f')]=_0x38cf3c;};exports[_0x44ec('0x30')]=function(_0x5288be,_0x45680b,_0x2b16c0){var _0x3bd82f=moment()[_0x44ec('0x10')](_0x44ec('0x29'));_0x5288be[_0x44ec('0x2a')]=_0x45680b;_0x5288be[_0x44ec('0x2b')]=_0x2b16c0;_0x5288be[_0x44ec('0x2e')]=_0x3bd82f;_0x5288be['ringtime']=utils[_0x44ec('0x31')](_0x5288be[_0x44ec('0x2e')],_0x5288be[_0x44ec('0x2d')]);};exports[_0x44ec('0x32')]=function(_0x63d336,_0x3247cd,_0x70a278){_0x63d336[_0x44ec('0x33')]=_0x3247cd;_0x63d336[_0x44ec('0x34')]=_0x70a278;};exports[_0x44ec('0x35')]=function(_0x406f6e,_0x1adebd,_0x2f717c){var _0x43bbea=moment()[_0x44ec('0x10')](_0x44ec('0x29'));_0x406f6e[_0x44ec('0x2a')]=_0x1adebd;_0x406f6e[_0x44ec('0x2b')]=_0x2f717c;_0x406f6e['responsetime']=_0x406f6e[_0x44ec('0x2e')]?_0x406f6e[_0x44ec('0x2e')]:_0x43bbea;_0x406f6e['endtime']=_0x406f6e['endtime']?_0x406f6e['endtime']:_0x43bbea;_0x406f6e[_0x44ec('0x36')]=utils['getSeconds'](_0x406f6e[_0x44ec('0x2e')]||0x0,_0x406f6e[_0x44ec('0x2d')]||0x0);_0x406f6e['talktime']=_0x406f6e['answertime']?utils[_0x44ec('0x31')](_0x406f6e[_0x44ec('0x2f')],_0x406f6e[_0x44ec('0x37')]):0x0;};exports[_0x44ec('0x38')]=function(_0x1889fb){return _0x1889fb===_0x44ec('0x39');};exports[_0x44ec('0x3a')]=function(_0x3bd07f,_0x5c69b5,_0x3a4955,_0x5c9817,_0x1910f6){var _0x21d7df=_0x5c9817?_0x44ec('0x3b'):_0x3bd07f[_0x44ec('0x3c')];_0x21d7df=_0x1910f6?_0x44ec('0x3d'):_0x21d7df;return{'actionid':_0x3bd07f[_0x44ec('0x3e')],'action':_0x44ec('0x3f'),'channel':_0x3bd07f['channelAgent'],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x21d7df,_0x3bd07f[_0x44ec('0x40')]),'Exten':_0x44ec('0x21'),'Context':'from-sip','Priority':'1','variable':_0x3a4955,'timeout':(_0x5c69b5['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3bd07f['uniqueid']};};exports[_0x44ec('0x41')]=function(_0x5731c3){return _0x5731c3[_0x44ec('0x42')]+_0x5731c3[_0x44ec('0x43')]+_0x5731c3['countnoanswerretry']+_0x5731c3['countagentrejectretry']+_0x5731c3[_0x44ec('0x44')];};exports[_0x44ec('0x45')]=function(_0x127c5a){var _0x2d3386=_[_0x44ec('0x46')](_0x127c5a);_0x2d3386[_0x44ec('0x2a')]=0xf;_0x2d3386['statedesc']=_0x44ec('0x47');return _0x2d3386;};exports[_0x44ec('0x48')]=function(_0xfcb9c5,_0x4c421c,_0x447ff5){var _0x82ab1f={};_0x82ab1f[_0x4c421c]=_0xfcb9c5[_0x4c421c];_0x82ab1f[_0x44ec('0x49')]=![];_0x82ab1f[_0x44ec('0x4a')]=moment()[_0x44ec('0x4b')](_0x447ff5,'minutes')[_0x44ec('0x10')](_0x44ec('0x29'));_0x82ab1f['ContactId']=_0xfcb9c5[_0x44ec('0x16')];_0x82ab1f[_0x44ec('0x4c')]=_0xfcb9c5[_0x44ec('0x4c')];_0x82ab1f['VoiceQueueId']=_0xfcb9c5[_0x44ec('0x18')]||undefined;return _0x82ab1f;};exports[_0x44ec('0x4d')]=function(_0x33e075,_0x8b7832){if(!_[_0x44ec('0x13')](_0x33e075)){if(_0x33e075['pTalking']>0x0){_0x33e075[_0x44ec('0x4e')]-=0x1;}else{logger[_0x44ec('0x8')](_0x8b7832,_0x44ec('0x4f'));}}else{logger[_0x44ec('0x5')](_0x8b7832,_0x44ec('0x50'));}};exports[_0x44ec('0x51')]=function(_0x14369b){if(_0x14369b<=0x0){return!![];}return![];};function buildObj(_0x2f31f1,_0xb718a3,_0xa5f427){_0x2f31f1[_0x44ec('0x52')]=_0xb718a3;_0x2f31f1[_0x44ec('0x53')]=_0x2f31f1[_0x44ec('0x54')];_0x2f31f1['interface']=_0x2f31f1['channelAgent'];_0x2f31f1['motionChannel']=_0x44ec('0x55');if(_0xa5f427){_0x2f31f1['mandatoryDisposition']=_0xa5f427[_0x44ec('0x56')];}return _0x2f31f1;}exports[_0x44ec('0x57')]=buildObj;exports[_0x44ec('0x58')]=function(_0x477cb1){var _0x203150=[];for(var _0x10deca in _0x477cb1){if(_0x477cb1[_0x44ec('0x26')](_0x10deca)){if(!_[_0x44ec('0x13')](_0x477cb1[_0x10deca])&&_0x477cb1[_0x10deca][_0x44ec('0x2a')]===_0x44ec('0x59')&&_0x477cb1[_0x10deca][_0x44ec('0x5a')]==='reachable'){_0x203150[_0x44ec('0x5b')](_0x477cb1[_0x10deca]['id']);}}}return _0x203150;};exports[_0x44ec('0x5c')]=function(_0x5399d3){var _0x218e36=moment()[_0x44ec('0x5d')](0x0);var _0x35357a=moment(_0x5399d3)[_0x44ec('0x5d')](0x0);return _0x218e36['diff'](_0x35357a,'seconds');};exports['createBody']=function(_0x212088){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x212088[_0x44ec('0x16')],'ListId':_0x212088[_0x44ec('0x4c')],'VoiceQueueId':_0x212088[_0x44ec('0x18')]||undefined,'CampaignId':_0x212088[_0x44ec('0x5e')]||undefined};};exports[_0x44ec('0x5f')]=function(_0x569b81){if(_0x569b81==='uniqueid'||_0x569b81===_0x44ec('0x60')||_0x569b81===_0x44ec('0x54')||_0x569b81===_0x44ec('0x61')||_0x569b81==='campaigntype'||_0x569b81===_0x44ec('0x62')||_0x569b81===_0x44ec('0x33')||_0x569b81===_0x44ec('0x63')||_0x569b81===_0x44ec('0x3c')||_0x569b81==='active'||_0x569b81===_0x44ec('0x40')||_0x569b81==='scheduledat'||_0x569b81===_0x44ec('0x42')||_0x569b81===_0x44ec('0x43')||_0x569b81===_0x44ec('0x64')||_0x569b81==='countglobal'||_0x569b81===_0x44ec('0x65')||_0x569b81===_0x44ec('0x66')||_0x569b81==='callbackat'||_0x569b81===_0x44ec('0x67')||_0x569b81===_0x44ec('0x16')||_0x569b81==='ListId'||_0x569b81===_0x44ec('0x34')||_0x569b81===_0x44ec('0x18')||_0x569b81===_0x44ec('0x68')||_0x569b81==='xmd-voicequeueid'||_0x569b81===_0x44ec('0x69')||_0x569b81===_0x44ec('0x6a')||_0x569b81===_0x44ec('0x6b')||_0x569b81==='xmd-dialurl'||_0x569b81==='xmd-dialtimeout'||_0x569b81===_0x44ec('0x6c')||_0x569b81===_0x44ec('0x6d')||_0x569b81===_0x44ec('0x6e')||_0x569b81===_0x44ec('0x6f')||_0x569b81===_0x44ec('0x70')||_0x569b81===_0x44ec('0x71')||_0x569b81===_0x44ec('0x72')||_0x569b81===_0x44ec('0x73')||_0x569b81===_0x44ec('0x74')||_0x569b81===_0x44ec('0x75')||_0x569b81===_0x44ec('0x76')||_0x569b81===_0x44ec('0x77')||_0x569b81===_0x44ec('0x78')||_0x569b81===_0x44ec('0x79')||_0x569b81==='rtpaudioqosrtt'||_0x569b81==='rtpaudioqosrttbridged'||_0x569b81==='rtpaudioqos'||_0x569b81===_0x44ec('0x75')||_0x569b81===_0x44ec('0x76')||_0x569b81===_0x44ec('0x77')||_0x569b81===_0x44ec('0x78')||_0x569b81===_0x44ec('0x79')||_0x569b81===_0x44ec('0x7a')||_0x569b81===_0x44ec('0x7b')||_0x569b81===_0x44ec('0x7c')||_0x569b81===_0x44ec('0x7d')||_0x569b81===_0x44ec('0x2a')||_0x569b81==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x345f41,_0x93665d){var _0x237e17,_0x4698fa,_0x20b33e;if(_0x93665d<=0x0){_0x93665d=0x1;}_0x237e17=new RegExp('\x5cw{0,'+_0x93665d+'}$');_0x4698fa=Math[_0x44ec('0x7e')](0xa,_0x93665d-0x1);_0x20b33e=Math['pow'](0xa,_0x93665d)-0x1;return util['format']('%s',_[_0x44ec('0x7f')](_0x345f41,_0x237e17,_[_0x44ec('0x80')](_0x4698fa,_0x20b33e)));};exports['extractCalleridName']=function(_0x24562a){var _0x164d21=_0x24562a[_0x44ec('0x81')](/"(.*?)"/);return _0x164d21?_0x164d21[0x1]:_0x24562a;};exports[_0x44ec('0x82')]=function(_0x62c8bb){var _0x40e218=_0x62c8bb[_0x44ec('0x81')](/<(.*?)>/);return _0x40e218?_0x40e218[0x1]:_0x62c8bb;};function buildNoAnswerEventPayload(_0x3c67d5,_0x1316c8){var _0x401f7b=buildObj(_0x3c67d5,'noanswer');if(!_[_0x44ec('0xe')](_0x1316c8[_0x44ec('0x83')])){Object[_0x44ec('0x84')](_0x1316c8[_0x44ec('0x83')])[_0x44ec('0x85')](function(_0x290ba3){_0x401f7b[_0x290ba3[_0x44ec('0x86')]()]=_0x1316c8['variables'][_0x290ba3];});}return _0x401f7b;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload;
\ No newline at end of file