Built motion from commit a8c4dd89.|2.6.33
[motion2.git] / server / services / ami / preview / util / util.js
index 0566e6b..c83b2a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe167=['replace','extractCalleridName','match','extractCalleridNumber','keys','variables','forEach','toLowerCase','buildNoAnswerEventPayload','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','info','loggerError','error','inspect','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','toLower','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','logLookAgent','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','originate','channelAgent','timeout','uniqueid','totalGlobal','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','active','scheduledat','add','minutes','ListId','decrementTalking','pTalking','[decrementTalking]\x20object\x20talking\x20is\x20negative','[decrementTalking]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','agentReadyId','reachable','push','getDiff','milliseconds','diff','CampaignId','filterKey','idContact','campaigntype','dialAnswer','membername','calleridname','countbusyretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqos','rtpaudioqosloss','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow'];(function(_0x66874,_0x5dfa3){var _0x5c4e4a=function(_0x3d367f){while(--_0x3d367f){_0x66874['push'](_0x66874['shift']());}};_0x5c4e4a(++_0x5dfa3);}(_0xe167,0x1b6));var _0x7e16=function(_0x4de9b8,_0x261fca){_0x4de9b8=_0x4de9b8-0x0;var _0x131a97=_0xe167[_0x4de9b8];return _0x131a97;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x7e16('0x0'));var logger=require('../../../../config/logger')(_0x7e16('0x1'));var ipAgi=process[_0x7e16('0x2')][_0x7e16('0x3')]||_0x7e16('0x4');var utils=require(_0x7e16('0x5'));exports[_0x7e16('0x6')]=function(_0x10dd24){return function(_0x49a151){logger['error'](_0x10dd24,util['inspect'](_0x49a151,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x4065f7,_0x32fcec){logger[_0x7e16('0x7')](_0x4065f7,util['inspect'](_0x32fcec,{'showHidden':![],'depth':null}));};exports[_0x7e16('0x8')]=function(_0x5d17f3,_0x124916){logger[_0x7e16('0x9')](_0x5d17f3,util[_0x7e16('0xa')](_0x124916,{'showHidden':![],'depth':null}));};exports[_0x7e16('0xb')]=function(_0x58aff1){return function(_0x17f0d7){logger[_0x7e16('0x7')](_0x58aff1,util['inspect'](_0x17f0d7,{'showHidden':![],'depth':null}));};};exports[_0x7e16('0xc')]=function(_0x3969e4,_0x410836,_0x2a3d6d){return{'message':_0x3969e4,'unlock':_0x410836,'active':_0x2a3d6d};};exports[_0x7e16('0xd')]=function(_0x42ab5d,_0x3a26a2,_0x5a00ea){if(!_[_0x7e16('0xe')](_0x5a00ea)&&_0x7e16('0xf')===typeof _0x5a00ea&&!_[_0x7e16('0x10')](_0x5a00ea)){if(!_[_0x7e16('0xe')](_0x3a26a2)&&_0x7e16('0xf')===typeof _0x3a26a2&&!_['isEmpty'](_0x3a26a2)){return util[_0x7e16('0x11')]('\x22%s\x22\x20<%s>',_0x3a26a2,_0x5a00ea);}return util[_0x7e16('0x11')](_0x7e16('0x12'),_0x5a00ea,_0x5a00ea);}if(!_['isUndefined'](_0x42ab5d)&&_0x7e16('0xf')===typeof _0x42ab5d&&!_[_0x7e16('0x10')](_0x42ab5d)){return _0x42ab5d;}return'\x22\x22\x20<>';};exports[_0x7e16('0x13')]=function(_0x3f78ca){if(_[_0x7e16('0x14')](_0x3f78ca)){return![];}return _0x3f78ca;};exports[_0x7e16('0x15')]=function(_0xa49e86,_0x204b5f,_0x464823,_0x5bc690,_0x3a957e,_0x5d4738){var _0x3c82f1={'XMD-QUEUE':_0x204b5f[_0x7e16('0x16')]?_0x204b5f[_0x7e16('0x16')][_0x7e16('0x17')]:'','XMD-CALLERID':_0x5bc690,'XMD-CALLERID-PREVIEW':_0x5d4738?util[_0x7e16('0x11')](_0x7e16('0x12'),_0x5d4738['calleridname'],_0x5d4738[_0x7e16('0x18')]):_0x5bc690,'XMD-DIALID':_0x3a957e,'XMD-CONTACTID':_0x204b5f[_0x7e16('0x19')],'XMD-CDRTYPE':_0x7e16('0x1a'),'CALLERID(all)':_0x5bc690,'XMD-VOICEQUEUEID':_0x204b5f[_0x7e16('0x1b')],'XMD-DIALCHANNEL':_0x464823,'XMD-DIALTIMEOUT':_0xa49e86[_0x7e16('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x7e16('0x1d'),_0xa49e86[_0x7e16('0x1e')]?'g':'',_['isEmpty'](_0xa49e86[_0x7e16('0x1f')])?'':_0x7e16('0x20')),'XMD-DIALURL':_0xa49e86[_0x7e16('0x21')]||'','XMD-AGI':_0xa49e86[_0x7e16('0x22')]?util['format'](_0x7e16('0x23'),ipAgi,_0xa49e86[_0x7e16('0x22')]):'NONE','XMD-AGIAFTER':_0xa49e86[_0x7e16('0x1e')]?util['format'](_0x7e16('0x23'),ipAgi,_0xa49e86[_0x7e16('0x1e')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x5d4738?_0x5d4738[_0x7e16('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x5d4738?_0x5d4738['originatecalleridname']:'','XMD-DESTINATION':_0x7e16('0x25'),'SIPADDHEADER':_0x7e16('0x26')};if(!_[_0x7e16('0x10')](_0xa49e86[_0x7e16('0x1f')])){_0x3c82f1[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0xa49e86[_0x7e16('0x1f')];_0x3c82f1[util[_0x7e16('0x11')]('%s',_0x7e16('0x27'))]=_0x3a957e;}return _0x3c82f1;};exports[_0x7e16('0x28')]=function(_0x45df21){var _0x14014e={};for(var _0x35c91a in _0x45df21){if(_0x45df21['hasOwnProperty'](_0x35c91a)){_0x14014e[util[_0x7e16('0x11')]('%s',_[_0x7e16('0x29')](_0x35c91a))]=_0x45df21[_0x35c91a];}}return{'variables':_0x14014e};};exports[_0x7e16('0x2a')]=function(_0x49f8ff){var _0x4631d2=moment()[_0x7e16('0x11')](_0x7e16('0x2b'));_0x49f8ff[_0x7e16('0x2c')]=0xd;_0x49f8ff[_0x7e16('0x2d')]=_0x7e16('0x2e');_0x49f8ff[_0x7e16('0x2f')]=_0x4631d2;_0x49f8ff[_0x7e16('0x30')]=_0x4631d2;_0x49f8ff[_0x7e16('0x31')]=_0x4631d2;};exports[_0x7e16('0x32')]=function(_0x48dd22,_0x1c2232,_0x14603b){var _0x88fc16=moment()[_0x7e16('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x48dd22['state']=_0x1c2232;_0x48dd22[_0x7e16('0x2d')]=_0x14603b;_0x48dd22[_0x7e16('0x30')]=_0x88fc16;_0x48dd22[_0x7e16('0x33')]=utils[_0x7e16('0x34')](_0x48dd22[_0x7e16('0x30')],_0x48dd22[_0x7e16('0x2f')]);};exports[_0x7e16('0x35')]=function(_0x45d3fd,_0x4b4330,_0x5600d1){_0x45d3fd['membername']=_0x4b4330;_0x45d3fd['UserId']=_0x5600d1;};exports[_0x7e16('0x36')]=function(_0xf65f2b,_0x159cfc,_0x1fd607){var _0x2790ed=moment()[_0x7e16('0x11')](_0x7e16('0x2b'));_0xf65f2b[_0x7e16('0x2c')]=_0x159cfc;_0xf65f2b[_0x7e16('0x2d')]=_0x1fd607;_0xf65f2b['responsetime']=_0xf65f2b[_0x7e16('0x30')]?_0xf65f2b[_0x7e16('0x30')]:_0x2790ed;_0xf65f2b['endtime']=_0xf65f2b[_0x7e16('0x31')]?_0xf65f2b['endtime']:_0x2790ed;_0xf65f2b[_0x7e16('0x33')]=utils[_0x7e16('0x34')](_0xf65f2b['responsetime']||0x0,_0xf65f2b[_0x7e16('0x2f')]||0x0);_0xf65f2b[_0x7e16('0x37')]=_0xf65f2b[_0x7e16('0x38')]?utils[_0x7e16('0x34')](_0xf65f2b[_0x7e16('0x31')],_0xf65f2b[_0x7e16('0x38')]):0x0;};exports[_0x7e16('0x39')]=function(_0x6bbb54){return _0x6bbb54===_0x7e16('0x3a');};exports[_0x7e16('0x3b')]=function(_0x43447d,_0x208bb3,_0x378b03,_0x416295,_0x38796d){var _0x2ece34=_0x416295?_0x7e16('0x3c'):_0x43447d['calleridname'];_0x2ece34=_0x38796d?'BOOKED':_0x2ece34;return{'actionid':_0x43447d['uniqueid'],'action':_0x7e16('0x3d'),'channel':_0x43447d[_0x7e16('0x3e')],'callerid':util['format'](_0x7e16('0x12'),_0x2ece34,_0x43447d[_0x7e16('0x18')]),'Exten':_0x7e16('0x25'),'Context':'from-sip','Priority':'1','variable':_0x378b03,'timeout':(_0x208bb3[_0x7e16('0x3f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x43447d[_0x7e16('0x40')]};};exports[_0x7e16('0x41')]=function(_0x1ffcef){return _0x1ffcef['countbusyretry']+_0x1ffcef[_0x7e16('0x42')]+_0x1ffcef['countnoanswerretry']+_0x1ffcef[_0x7e16('0x43')]+_0x1ffcef[_0x7e16('0x44')];};exports[_0x7e16('0x45')]=function(_0x42acb7){var _0x1e0dba=_[_0x7e16('0x46')](_0x42acb7);_0x1e0dba[_0x7e16('0x2c')]=0xf;_0x1e0dba[_0x7e16('0x2d')]=_0x7e16('0x47');return _0x1e0dba;};exports['scheduledAt']=function(_0x4f9161,_0xfa4719,_0x487939){var _0x456e7e={};_0x456e7e[_0xfa4719]=_0x4f9161[_0xfa4719];_0x456e7e[_0x7e16('0x48')]=![];_0x456e7e[_0x7e16('0x49')]=moment()[_0x7e16('0x4a')](_0x487939,_0x7e16('0x4b'))['format'](_0x7e16('0x2b'));_0x456e7e[_0x7e16('0x19')]=_0x4f9161['ContactId'];_0x456e7e['ListId']=_0x4f9161[_0x7e16('0x4c')];_0x456e7e['VoiceQueueId']=_0x4f9161[_0x7e16('0x1b')]||undefined;return _0x456e7e;};exports[_0x7e16('0x4d')]=function(_0x158633,_0xf8800c){if(!_[_0x7e16('0x14')](_0x158633)){if(_0x158633[_0x7e16('0x4e')]>0x0){_0x158633[_0x7e16('0x4e')]-=0x1;}else{logger[_0x7e16('0x7')](_0xf8800c,_0x7e16('0x4f'));}}else{logger[_0x7e16('0x9')](_0xf8800c,_0x7e16('0x50'));}};exports[_0x7e16('0x51')]=function(_0x1731cf){if(_0x1731cf<=0x0){return!![];}return![];};function buildObj(_0x5b7f71,_0x32d6be,_0x5a4c80){_0x5b7f71['lastevent']=_0x32d6be;_0x5b7f71['name']=_0x5b7f71[_0x7e16('0x52')];_0x5b7f71[_0x7e16('0x53')]=_0x5b7f71[_0x7e16('0x3e')];_0x5b7f71[_0x7e16('0x54')]=_0x7e16('0x55');if(_0x5a4c80){_0x5b7f71['mandatoryDisposition']=_0x5a4c80[_0x7e16('0x56')];}return _0x5b7f71;}exports[_0x7e16('0x57')]=buildObj;exports[_0x7e16('0x58')]=function(_0x1a8e63){var _0x523783=[];for(var _0x4b4d9b in _0x1a8e63){if(_0x1a8e63['hasOwnProperty'](_0x4b4d9b)){if(!_[_0x7e16('0x14')](_0x1a8e63[_0x4b4d9b])&&_0x1a8e63[_0x4b4d9b][_0x7e16('0x2c')]==='not_inuse'&&_0x1a8e63[_0x4b4d9b]['status']===_0x7e16('0x59')){_0x523783[_0x7e16('0x5a')](_0x1a8e63[_0x4b4d9b]['id']);}}}return _0x523783;};exports[_0x7e16('0x5b')]=function(_0x150720){var _0x31da22=moment()[_0x7e16('0x5c')](0x0);var _0x421f4b=moment(_0x150720)[_0x7e16('0x5c')](0x0);return _0x31da22[_0x7e16('0x5d')](_0x421f4b,'seconds');};exports['createBody']=function(_0x2882c9){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2882c9[_0x7e16('0x19')],'ListId':_0x2882c9[_0x7e16('0x4c')],'VoiceQueueId':_0x2882c9['VoiceQueueId']||undefined,'CampaignId':_0x2882c9[_0x7e16('0x5e')]||undefined};};exports[_0x7e16('0x5f')]=function(_0x214ab5){if(_0x214ab5==='uniqueid'||_0x214ab5===_0x7e16('0x60')||_0x214ab5===_0x7e16('0x52')||_0x214ab5==='type'||_0x214ab5===_0x7e16('0x61')||_0x214ab5===_0x7e16('0x62')||_0x214ab5===_0x7e16('0x63')||_0x214ab5===_0x7e16('0x3e')||_0x214ab5===_0x7e16('0x64')||_0x214ab5===_0x7e16('0x48')||_0x214ab5==='calleridnum'||_0x214ab5===_0x7e16('0x49')||_0x214ab5===_0x7e16('0x65')||_0x214ab5==='countcongestionretry'||_0x214ab5===_0x7e16('0x66')||_0x214ab5===_0x7e16('0x67')||_0x214ab5===_0x7e16('0x68')||_0x214ab5===_0x7e16('0x69')||_0x214ab5===_0x7e16('0x6a')||_0x214ab5===_0x7e16('0x6b')||_0x214ab5===_0x7e16('0x19')||_0x214ab5===_0x7e16('0x4c')||_0x214ab5===_0x7e16('0x6c')||_0x214ab5===_0x7e16('0x1b')||_0x214ab5===_0x7e16('0x6d')||_0x214ab5===_0x7e16('0x6e')||_0x214ab5===_0x7e16('0x6f')||_0x214ab5===_0x7e16('0x70')||_0x214ab5===_0x7e16('0x71')||_0x214ab5===_0x7e16('0x72')||_0x214ab5===_0x7e16('0x73')||_0x214ab5===_0x7e16('0x74')||_0x214ab5===_0x7e16('0x75')||_0x214ab5===_0x7e16('0x76')||_0x214ab5==='xmd-contactid'||_0x214ab5===_0x7e16('0x77')||_0x214ab5==='xmd-callerid'||_0x214ab5===_0x7e16('0x78')||_0x214ab5===_0x7e16('0x79')||_0x214ab5==='rtpaudioqos'||_0x214ab5===_0x7e16('0x7a')||_0x214ab5==='rtpaudioqosjitter'||_0x214ab5===_0x7e16('0x7b')||_0x214ab5==='rtpaudioqosloss'||_0x214ab5===_0x7e16('0x7c')||_0x214ab5===_0x7e16('0x7d')||_0x214ab5==='rtpaudioqosrttbridged'||_0x214ab5===_0x7e16('0x7e')||_0x214ab5==='rtpaudioqosbridged'||_0x214ab5==='rtpaudioqosjitter'||_0x214ab5==='rtpaudioqosjitterbridged'||_0x214ab5===_0x7e16('0x7f')||_0x214ab5===_0x7e16('0x7c')||_0x214ab5==='rtpaudioqosrtt'||_0x214ab5===_0x7e16('0x80')||_0x214ab5===_0x7e16('0x81')||_0x214ab5===_0x7e16('0x82')||_0x214ab5===_0x7e16('0x2c')||_0x214ab5===_0x7e16('0x2d')){return![];}return!![];};exports[_0x7e16('0x83')]=function(_0x564e6b,_0x7d21b5){var _0x3f0e22,_0x42c9d7,_0x1b1a5a;if(_0x7d21b5<=0x0){_0x7d21b5=0x1;}_0x3f0e22=new RegExp(_0x7e16('0x84')+_0x7d21b5+'}$');_0x42c9d7=Math[_0x7e16('0x85')](0xa,_0x7d21b5-0x1);_0x1b1a5a=Math['pow'](0xa,_0x7d21b5)-0x1;return util['format']('%s',_[_0x7e16('0x86')](_0x564e6b,_0x3f0e22,_['random'](_0x42c9d7,_0x1b1a5a)));};exports[_0x7e16('0x87')]=function(_0x2d0e4b){var _0x1df65b=_0x2d0e4b[_0x7e16('0x88')](/"(.*?)"/);return _0x1df65b?_0x1df65b[0x1]:_0x2d0e4b;};exports[_0x7e16('0x89')]=function(_0x191bb5){var _0x1a4e65=_0x191bb5[_0x7e16('0x88')](/<(.*?)>/);return _0x1a4e65?_0x1a4e65[0x1]:_0x191bb5;};function buildNoAnswerEventPayload(_0x558e09,_0x156465){var _0x4b844e=buildObj(_0x558e09,'noanswer');if(!_[_0x7e16('0x10')](_0x156465['variables'])){Object[_0x7e16('0x8a')](_0x156465[_0x7e16('0x8b')])[_0x7e16('0x8c')](function(_0x5d2b58){_0x4b844e[_0x5d2b58[_0x7e16('0x8d')]()]=_0x156465[_0x7e16('0x8b')][_0x5d2b58];});}return _0x4b844e;}exports[_0x7e16('0x8e')]=buildNoAnswerEventPayload;
\ No newline at end of file
+var _0x50ab=['pTalking','[decrementTalking]\x20object\x20talking\x20is\x20negative','[decrementTalking]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','agentReadyId','status','reachable','push','getDiff','milliseconds','diff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','membername','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','noanswer','variables','keys','forEach','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','loggerCatch','error','logger','info','inspect','loggerError','logger2','message','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','ringtime','getSeconds','logLookAgent','UserId','logCustomer','endtime','talktime','answertime','variablesAction','RECALL','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','add','ListId','VoiceQueueId','decrementTalking'];(function(_0x44ad29,_0x24c3f7){var _0x311885=function(_0x52d7dd){while(--_0x52d7dd){_0x44ad29['push'](_0x44ad29['shift']());}};_0x311885(++_0x24c3f7);}(_0x50ab,0x1eb));var _0xb50a=function(_0x3f9fef,_0x3577bf){_0x3f9fef=_0x3f9fef-0x0;var _0x4f29c7=_0x50ab[_0x3f9fef];return _0x4f29c7;};'use strict';var util=require(_0xb50a('0x0'));var _=require(_0xb50a('0x1'));var moment=require(_0xb50a('0x2'));var logger=require(_0xb50a('0x3'))('preview');var ipAgi=process[_0xb50a('0x4')][_0xb50a('0x5')]||_0xb50a('0x6');var utils=require('../../dialer/utils');exports[_0xb50a('0x7')]=function(_0x36dfd){return function(_0x4f1360){logger[_0xb50a('0x8')](_0x36dfd,util['inspect'](_0x4f1360,{'showHidden':![],'depth':null}));};};exports[_0xb50a('0x9')]=function(_0x2f97ba,_0x60b6c5){logger[_0xb50a('0xa')](_0x2f97ba,util[_0xb50a('0xb')](_0x60b6c5,{'showHidden':![],'depth':null}));};exports[_0xb50a('0xc')]=function(_0x22fd68,_0x27e5fc){logger[_0xb50a('0x8')](_0x22fd68,util[_0xb50a('0xb')](_0x27e5fc,{'showHidden':![],'depth':null}));};exports[_0xb50a('0xd')]=function(_0x5d6f5c){return function(_0x5c26be){logger[_0xb50a('0xa')](_0x5d6f5c,util[_0xb50a('0xb')](_0x5c26be,{'showHidden':![],'depth':null}));};};exports[_0xb50a('0xe')]=function(_0x5308b3,_0x471fc9,_0x26f772){return{'message':_0x5308b3,'unlock':_0x471fc9,'active':_0x26f772};};exports['getCallerId']=function(_0x4a139b,_0x12031,_0x448236){if(!_['isUndefined'](_0x448236)&&_0xb50a('0xf')===typeof _0x448236&&!_[_0xb50a('0x10')](_0x448236)){if(!_[_0xb50a('0x11')](_0x12031)&&_0xb50a('0xf')===typeof _0x12031&&!_['isEmpty'](_0x12031)){return util[_0xb50a('0x12')](_0xb50a('0x13'),_0x12031,_0x448236);}return util[_0xb50a('0x12')](_0xb50a('0x13'),_0x448236,_0x448236);}if(!_['isUndefined'](_0x4a139b)&&_0xb50a('0xf')===typeof _0x4a139b&&!_['isEmpty'](_0x4a139b)){return _0x4a139b;}return _0xb50a('0x14');};exports[_0xb50a('0x15')]=function(_0x478299){if(_[_0xb50a('0x16')](_0x478299)){return![];}return _0x478299;};exports[_0xb50a('0x17')]=function(_0xee4cef,_0x35c554,_0x3ccf0c,_0x171c22,_0x275ece,_0x56a0d3){var _0x438249={'XMD-QUEUE':_0x35c554['Queue']?_0x35c554[_0xb50a('0x18')][_0xb50a('0x19')]:'','XMD-CALLERID':_0x171c22,'XMD-CALLERID-PREVIEW':_0x56a0d3?util[_0xb50a('0x12')](_0xb50a('0x13'),_0x56a0d3[_0xb50a('0x1a')],_0x56a0d3[_0xb50a('0x1b')]):_0x171c22,'XMD-DIALID':_0x275ece,'XMD-CONTACTID':_0x35c554[_0xb50a('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x171c22,'XMD-VOICEQUEUEID':_0x35c554['VoiceQueueId'],'XMD-DIALCHANNEL':_0x3ccf0c,'XMD-DIALTIMEOUT':_0xee4cef['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xb50a('0x12')]('\x22rtTxX%s%s\x22',_0xee4cef[_0xb50a('0x1d')]?'g':'',_['isEmpty'](_0xee4cef['monitor_format'])?'':_0xb50a('0x1e')),'XMD-DIALURL':_0xee4cef[_0xb50a('0x1f')]||'','XMD-AGI':_0xee4cef[_0xb50a('0x20')]?util['format'](_0xb50a('0x21'),ipAgi,_0xee4cef[_0xb50a('0x20')]):'NONE','XMD-AGIAFTER':_0xee4cef[_0xb50a('0x1d')]?util[_0xb50a('0x12')](_0xb50a('0x21'),ipAgi,_0xee4cef[_0xb50a('0x1d')]):_0xb50a('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x56a0d3?_0x56a0d3[_0xb50a('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x56a0d3?_0x56a0d3['originatecalleridname']:'','XMD-DESTINATION':_0xb50a('0x24'),'SIPADDHEADER':_0xb50a('0x25')};if(!_[_0xb50a('0x10')](_0xee4cef[_0xb50a('0x26')])){_0x438249[util['format']('%s',_0xb50a('0x27'))]=_0xee4cef[_0xb50a('0x26')];_0x438249[util[_0xb50a('0x12')]('%s',_0xb50a('0x28'))]=_0x275ece;}return _0x438249;};exports[_0xb50a('0x29')]=function(_0x93ffff){var _0x5fa9b8={};for(var _0x50343d in _0x93ffff){if(_0x93ffff[_0xb50a('0x2a')](_0x50343d)){_0x5fa9b8[util['format']('%s',_[_0xb50a('0x2b')](_0x50343d))]=_0x93ffff[_0x50343d];}}return{'variables':_0x5fa9b8};};exports[_0xb50a('0x2c')]=function(_0x4310e7){var _0x59c51a=moment()[_0xb50a('0x12')](_0xb50a('0x2d'));_0x4310e7[_0xb50a('0x2e')]=0xd;_0x4310e7[_0xb50a('0x2f')]='Blacklist';_0x4310e7[_0xb50a('0x30')]=_0x59c51a;_0x4310e7[_0xb50a('0x31')]=_0x59c51a;_0x4310e7['endtime']=_0x59c51a;};exports['logAgent']=function(_0x229601,_0x237f0c,_0x32f8a6){var _0x5d2396=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x229601[_0xb50a('0x2e')]=_0x237f0c;_0x229601[_0xb50a('0x2f')]=_0x32f8a6;_0x229601['responsetime']=_0x5d2396;_0x229601[_0xb50a('0x32')]=utils[_0xb50a('0x33')](_0x229601[_0xb50a('0x31')],_0x229601['starttime']);};exports[_0xb50a('0x34')]=function(_0xbade32,_0x317e18,_0xe11c65){_0xbade32['membername']=_0x317e18;_0xbade32[_0xb50a('0x35')]=_0xe11c65;};exports[_0xb50a('0x36')]=function(_0x25d80a,_0x4bf1a4,_0x244d15){var _0x3a7ebb=moment()[_0xb50a('0x12')](_0xb50a('0x2d'));_0x25d80a[_0xb50a('0x2e')]=_0x4bf1a4;_0x25d80a['statedesc']=_0x244d15;_0x25d80a[_0xb50a('0x31')]=_0x25d80a[_0xb50a('0x31')]?_0x25d80a[_0xb50a('0x31')]:_0x3a7ebb;_0x25d80a[_0xb50a('0x37')]=_0x25d80a['endtime']?_0x25d80a['endtime']:_0x3a7ebb;_0x25d80a[_0xb50a('0x32')]=utils[_0xb50a('0x33')](_0x25d80a['responsetime']||0x0,_0x25d80a[_0xb50a('0x30')]||0x0);_0x25d80a[_0xb50a('0x38')]=_0x25d80a[_0xb50a('0x39')]?utils[_0xb50a('0x33')](_0x25d80a[_0xb50a('0x37')],_0x25d80a[_0xb50a('0x39')]):0x0;};exports['isFailure']=function(_0x3d08c6){return _0x3d08c6==='Failure';};exports[_0xb50a('0x3a')]=function(_0x5b0429,_0x5c902d,_0x333cac,_0x537e62,_0x45a251){var _0x1cd660=_0x537e62?_0xb50a('0x3b'):_0x5b0429[_0xb50a('0x1a')];_0x1cd660=_0x45a251?'BOOKED':_0x1cd660;return{'actionid':_0x5b0429[_0xb50a('0x3c')],'action':'originate','channel':_0x5b0429[_0xb50a('0x3d')],'callerid':util[_0xb50a('0x12')](_0xb50a('0x13'),_0x1cd660,_0x5b0429['calleridnum']),'Exten':_0xb50a('0x24'),'Context':_0xb50a('0x3e'),'Priority':'1','variable':_0x333cac,'timeout':(_0x5c902d[_0xb50a('0x3f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5b0429[_0xb50a('0x3c')]};};exports[_0xb50a('0x40')]=function(_0x4a1dca){return _0x4a1dca[_0xb50a('0x41')]+_0x4a1dca[_0xb50a('0x42')]+_0x4a1dca[_0xb50a('0x43')]+_0x4a1dca['countagentrejectretry']+_0x4a1dca['countnosuchnumberretry'];};exports[_0xb50a('0x44')]=function(_0x12d6b3){var _0x52d340=_[_0xb50a('0x45')](_0x12d6b3);_0x52d340[_0xb50a('0x2e')]=0xf;_0x52d340[_0xb50a('0x2f')]=_0xb50a('0x46');return _0x52d340;};exports[_0xb50a('0x47')]=function(_0x2280fe,_0x25ff25,_0x5b5417){var _0x4cec87={};_0x4cec87[_0x25ff25]=_0x2280fe[_0x25ff25];_0x4cec87[_0xb50a('0x48')]=![];_0x4cec87['scheduledat']=moment()[_0xb50a('0x49')](_0x5b5417,'minutes')[_0xb50a('0x12')](_0xb50a('0x2d'));_0x4cec87['ContactId']=_0x2280fe['ContactId'];_0x4cec87[_0xb50a('0x4a')]=_0x2280fe[_0xb50a('0x4a')];_0x4cec87['VoiceQueueId']=_0x2280fe[_0xb50a('0x4b')]||undefined;return _0x4cec87;};exports[_0xb50a('0x4c')]=function(_0x4b7408,_0x20ff41){if(!_['isNil'](_0x4b7408)){if(_0x4b7408['pTalking']>0x0){_0x4b7408[_0xb50a('0x4d')]-=0x1;}else{logger['info'](_0x20ff41,_0xb50a('0x4e'));}}else{logger['error'](_0x20ff41,_0xb50a('0x4f'));}};exports[_0xb50a('0x50')]=function(_0x1a5282){if(_0x1a5282<=0x0){return!![];}return![];};function buildObj(_0x327fe8,_0xebdc3d,_0x6065b8){_0x327fe8[_0xb50a('0x51')]=_0xebdc3d;_0x327fe8[_0xb50a('0x19')]=_0x327fe8[_0xb50a('0x52')];_0x327fe8[_0xb50a('0x53')]=_0x327fe8['channelAgent'];_0x327fe8[_0xb50a('0x54')]=_0xb50a('0x55');if(_0x6065b8){_0x327fe8[_0xb50a('0x56')]=_0x6065b8[_0xb50a('0x56')];}return _0x327fe8;}exports['buildObj']=buildObj;exports[_0xb50a('0x57')]=function(_0xb94726){var _0x164a43=[];for(var _0x29e03e in _0xb94726){if(_0xb94726[_0xb50a('0x2a')](_0x29e03e)){if(!_[_0xb50a('0x16')](_0xb94726[_0x29e03e])&&_0xb94726[_0x29e03e]['state']==='not_inuse'&&_0xb94726[_0x29e03e][_0xb50a('0x58')]===_0xb50a('0x59')){_0x164a43[_0xb50a('0x5a')](_0xb94726[_0x29e03e]['id']);}}}return _0x164a43;};exports[_0xb50a('0x5b')]=function(_0x43ae63){var _0x139993=moment()[_0xb50a('0x5c')](0x0);var _0x161635=moment(_0x43ae63)[_0xb50a('0x5c')](0x0);return _0x139993[_0xb50a('0x5d')](_0x161635,'seconds');};exports[_0xb50a('0x5e')]=function(_0x380f7a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x380f7a[_0xb50a('0x1c')],'ListId':_0x380f7a[_0xb50a('0x4a')],'VoiceQueueId':_0x380f7a[_0xb50a('0x4b')]||undefined,'CampaignId':_0x380f7a[_0xb50a('0x5f')]||undefined};};exports[_0xb50a('0x60')]=function(_0x5a7606){if(_0x5a7606==='uniqueid'||_0x5a7606===_0xb50a('0x61')||_0x5a7606===_0xb50a('0x52')||_0x5a7606==='type'||_0x5a7606===_0xb50a('0x62')||_0x5a7606===_0xb50a('0x63')||_0x5a7606===_0xb50a('0x64')||_0x5a7606==='channelAgent'||_0x5a7606===_0xb50a('0x1a')||_0x5a7606===_0xb50a('0x48')||_0x5a7606===_0xb50a('0x1b')||_0x5a7606===_0xb50a('0x65')||_0x5a7606===_0xb50a('0x41')||_0x5a7606==='countcongestionretry'||_0x5a7606==='countnoanswerretry'||_0x5a7606===_0xb50a('0x66')||_0x5a7606===_0xb50a('0x67')||_0x5a7606===_0xb50a('0x68')||_0x5a7606===_0xb50a('0x69')||_0x5a7606===_0xb50a('0x6a')||_0x5a7606===_0xb50a('0x1c')||_0x5a7606===_0xb50a('0x4a')||_0x5a7606===_0xb50a('0x35')||_0x5a7606===_0xb50a('0x4b')||_0x5a7606==='sipcallid'||_0x5a7606===_0xb50a('0x6b')||_0x5a7606===_0xb50a('0x6c')||_0x5a7606===_0xb50a('0x6d')||_0x5a7606===_0xb50a('0x6e')||_0x5a7606===_0xb50a('0x6f')||_0x5a7606===_0xb50a('0x70')||_0x5a7606===_0xb50a('0x71')||_0x5a7606===_0xb50a('0x72')||_0x5a7606===_0xb50a('0x73')||_0x5a7606===_0xb50a('0x74')||_0x5a7606===_0xb50a('0x75')||_0x5a7606===_0xb50a('0x76')||_0x5a7606===_0xb50a('0x77')||_0x5a7606===_0xb50a('0x78')||_0x5a7606===_0xb50a('0x79')||_0x5a7606===_0xb50a('0x7a')||_0x5a7606===_0xb50a('0x7b')||_0x5a7606==='rtpaudioqosjitterbridged'||_0x5a7606===_0xb50a('0x7c')||_0x5a7606===_0xb50a('0x7d')||_0x5a7606==='rtpaudioqosrtt'||_0x5a7606==='rtpaudioqosrttbridged'||_0x5a7606===_0xb50a('0x79')||_0x5a7606==='rtpaudioqosbridged'||_0x5a7606==='rtpaudioqosjitter'||_0x5a7606===_0xb50a('0x7e')||_0x5a7606===_0xb50a('0x7c')||_0x5a7606===_0xb50a('0x7d')||_0x5a7606===_0xb50a('0x7f')||_0x5a7606===_0xb50a('0x80')||_0x5a7606===_0xb50a('0x81')||_0x5a7606===_0xb50a('0x82')||_0x5a7606===_0xb50a('0x2e')||_0x5a7606===_0xb50a('0x2f')){return![];}return!![];};exports[_0xb50a('0x83')]=function(_0xbb237e,_0x5639b6){var _0x428fa1,_0x1b5853,_0x24a743;if(_0x5639b6<=0x0){_0x5639b6=0x1;}_0x428fa1=new RegExp(_0xb50a('0x84')+_0x5639b6+'}$');_0x1b5853=Math['pow'](0xa,_0x5639b6-0x1);_0x24a743=Math[_0xb50a('0x85')](0xa,_0x5639b6)-0x1;return util[_0xb50a('0x12')]('%s',_[_0xb50a('0x86')](_0xbb237e,_0x428fa1,_[_0xb50a('0x87')](_0x1b5853,_0x24a743)));};exports['extractCalleridName']=function(_0x5da9b5){var _0x527485=_0x5da9b5[_0xb50a('0x88')](/"(.*?)"/);return _0x527485?_0x527485[0x1]:_0x5da9b5;};exports['extractCalleridNumber']=function(_0x4945e0){var _0x57525c=_0x4945e0['match'](/<(.*?)>/);return _0x57525c?_0x57525c[0x1]:_0x4945e0;};function buildNoAnswerEventPayload(_0x3b7e53,_0x44524e){var _0x97f1ad=buildObj(_0x3b7e53,_0xb50a('0x89'));if(!_['isEmpty'](_0x44524e[_0xb50a('0x8a')])){Object[_0xb50a('0x8b')](_0x44524e['variables'])[_0xb50a('0x8c')](function(_0x4be676){_0x97f1ad[_0x4be676['toLowerCase']()]=_0x44524e[_0xb50a('0x8a')][_0x4be676];});}return _0x97f1ad;}exports[_0xb50a('0x8d')]=buildNoAnswerEventPayload;
\ No newline at end of file