Built motion from commit (unavailable).|2.4.20
[motion2.git] / server / services / ami / preview / util / util.js
index 7b18ec7..1ceca64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d34=['calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','ringtime','logLookAgent','UserId','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','channelAgent','from-sip','timeout','totalGlobal','cloneAction','clone','scheduledAt','active','scheduledat','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','not_inuse','reachable','getDiff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','membername','countbusyretry','countnoanswerretry','countglobal','callback','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-dialurl','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','match','util','lodash','moment','../../../../config/logger','env','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname'];(function(_0x13cf27,_0x38a69d){var _0x547dab=function(_0x4aca88){while(--_0x4aca88){_0x13cf27['push'](_0x13cf27['shift']());}};_0x547dab(++_0x38a69d);}(_0x6d34,0xf7));var _0x46d3=function(_0xe50e23,_0x3106d8){_0xe50e23=_0xe50e23-0x0;var _0x29c617=_0x6d34[_0xe50e23];return _0x29c617;};'use strict';var util=require(_0x46d3('0x0'));var _=require(_0x46d3('0x1'));var moment=require(_0x46d3('0x2'));var logger=require(_0x46d3('0x3'))('preview');var ipAgi=process[_0x46d3('0x4')]['XCALLY_IP_AGI']||_0x46d3('0x5');function getSeconds(_0x194970,_0x3cf80a){var _0x4b4f65=moment(_0x194970)['milliseconds'](0x0);var _0x57dcc8=moment(_0x3cf80a)[_0x46d3('0x6')](0x0);return _0x4b4f65[_0x46d3('0x7')](_0x57dcc8,_0x46d3('0x8'));}exports['loggerCatch']=function(_0x735a93){return function(_0x30780a){logger[_0x46d3('0x9')](_0x735a93,util[_0x46d3('0xa')](_0x30780a,{'showHidden':![],'depth':null}));};};exports[_0x46d3('0xb')]=function(_0x16a192,_0x4abd6e){logger[_0x46d3('0xc')](_0x16a192,util['inspect'](_0x4abd6e,{'showHidden':![],'depth':null}));};exports[_0x46d3('0xd')]=function(_0x433acc,_0xce6013){logger[_0x46d3('0x9')](_0x433acc,util[_0x46d3('0xa')](_0xce6013,{'showHidden':![],'depth':null}));};exports[_0x46d3('0xe')]=function(_0x2fae06){return function(_0x55127b){logger['info'](_0x2fae06,util[_0x46d3('0xa')](_0x55127b,{'showHidden':![],'depth':null}));};};exports[_0x46d3('0xf')]=function(_0xb88399,_0x24de99,_0x214b5b){return{'message':_0xb88399,'unlock':_0x24de99,'active':_0x214b5b};};exports[_0x46d3('0x10')]=function(_0x2bd66d,_0xbbe4a7,_0x495fce){if(!_[_0x46d3('0x11')](_0x495fce)&&_0x46d3('0x12')===typeof _0x495fce&&!_[_0x46d3('0x13')](_0x495fce)){if(!_[_0x46d3('0x11')](_0xbbe4a7)&&_0x46d3('0x12')===typeof _0xbbe4a7&&!_['isEmpty'](_0xbbe4a7)){return util[_0x46d3('0x14')](_0x46d3('0x15'),_0xbbe4a7,_0x495fce);}return util['format']('\x22%s\x22\x20<%s>',_0x495fce,_0x495fce);}if(!_['isUndefined'](_0x2bd66d)&&_0x46d3('0x12')===typeof _0x2bd66d&&!_[_0x46d3('0x13')](_0x2bd66d)){return _0x2bd66d;}return _0x46d3('0x16');};exports[_0x46d3('0x17')]=function(_0xfc8cda){if(_[_0x46d3('0x18')](_0xfc8cda)){return![];}return _0xfc8cda;};exports[_0x46d3('0x19')]=function(_0xcdeb76,_0xea927,_0x16683b,_0x3b5d9d,_0x21edfb,_0x33aed4){var _0x567bbd={'XMD-QUEUE':_0xea927[_0x46d3('0x1a')]?_0xea927['Queue'][_0x46d3('0x1b')]:'','XMD-CALLERID':_0x3b5d9d,'XMD-CALLERID-PREVIEW':_0x33aed4?util[_0x46d3('0x14')](_0x46d3('0x15'),_0x33aed4[_0x46d3('0x1c')],_0x33aed4[_0x46d3('0x1d')]):_0x3b5d9d,'XMD-DIALID':_0x21edfb,'XMD-CONTACTID':_0xea927['ContactId'],'XMD-CDRTYPE':_0x46d3('0x1e'),'CALLERID(all)':_0x3b5d9d,'XMD-VOICEQUEUEID':_0xea927[_0x46d3('0x1f')],'XMD-DIALCHANNEL':_0x16683b,'XMD-DIALTIMEOUT':_0xcdeb76[_0x46d3('0x20')]||0x1e,'XMD-DIALOPTIONS':util[_0x46d3('0x14')](_0x46d3('0x21'),_0xcdeb76[_0x46d3('0x22')]?'g':'',_[_0x46d3('0x13')](_0xcdeb76['monitor_format'])?'':_0x46d3('0x23')),'XMD-DIALURL':_0xcdeb76[_0x46d3('0x24')]||'','XMD-AGI':_0xcdeb76['dialQueueProject']?util[_0x46d3('0x14')](_0x46d3('0x25'),ipAgi,_0xcdeb76[_0x46d3('0x26')]):_0x46d3('0x27'),'XMD-AGIAFTER':_0xcdeb76[_0x46d3('0x22')]?util[_0x46d3('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0xcdeb76[_0x46d3('0x22')]):_0x46d3('0x27'),'XMD-ORIGINATECALLERIDNUM':_0x33aed4?_0x33aed4[_0x46d3('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x33aed4?_0x33aed4[_0x46d3('0x29')]:'','XMD-DESTINATION':_0x46d3('0x2a')};if(!_[_0x46d3('0x13')](_0xcdeb76[_0x46d3('0x2b')])){_0x567bbd[util[_0x46d3('0x14')]('%s',_0x46d3('0x2c'))]=_0xcdeb76[_0x46d3('0x2b')];_0x567bbd[util[_0x46d3('0x14')]('%s',_0x46d3('0x2d'))]=_0x21edfb;}if(_0xea927&&_0xea927[_0x46d3('0x2e')]){for(var _0x1c4e93 in _0xea927[_0x46d3('0x2e')]){if(_0xea927[_0x46d3('0x2e')][_0x46d3('0x2f')](_0x1c4e93)){if(!_['isNil'](_0xea927['Contact'][_0x1c4e93])&&_0x1c4e93!=='id'&&_0x1c4e93!==_0x46d3('0x30')&&_0x1c4e93!==_0x46d3('0x31')&&_0x1c4e93!==_0x46d3('0x32')){_0x567bbd[util['format'](_0x46d3('0x33'),_0x46d3('0x34'),_[_0x46d3('0x35')](_0x1c4e93))]=_0xea927[_0x46d3('0x2e')][_0x1c4e93];}}}}return _0x567bbd;};exports[_0x46d3('0x36')]=function(_0x5f5916){var _0x282192={};for(var _0x1b4ab6 in _0x5f5916){if(_0x5f5916[_0x46d3('0x2f')](_0x1b4ab6)){_0x282192[util['format']('%s',_[_0x46d3('0x37')](_0x1b4ab6))]=_0x5f5916[_0x1b4ab6];}}return{'variables':_0x282192};};exports[_0x46d3('0x38')]=function(_0x25c163,_0x3be4ca){if(!_['isNil'](_0x25c163)){if(_0x25c163[_0x46d3('0x2f')](_0x46d3('0x39'))){if(_0x25c163[_0x46d3('0x39')]>0x0){_0x25c163[_0x46d3('0x39')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3be4ca);}}}else{logger[_0x46d3('0x9')](_0x46d3('0x3a'),_0x3be4ca);}};exports[_0x46d3('0x3b')]=function(_0x3cb1ab){var _0x554531=moment()[_0x46d3('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x3cb1ab['state']=0xd;_0x3cb1ab['statedesc']=_0x46d3('0x3c');_0x3cb1ab[_0x46d3('0x3d')]=_0x554531;_0x3cb1ab[_0x46d3('0x3e')]=_0x554531;_0x3cb1ab[_0x46d3('0x3f')]=_0x554531;};exports[_0x46d3('0x40')]=function(_0x55f302,_0x56bb7e,_0x3e99a3){var _0x17ba36=moment()[_0x46d3('0x14')](_0x46d3('0x41'));_0x55f302[_0x46d3('0x42')]=_0x56bb7e;_0x55f302[_0x46d3('0x43')]=_0x3e99a3;_0x55f302['responsetime']=_0x17ba36;_0x55f302[_0x46d3('0x44')]=getSeconds(_0x55f302[_0x46d3('0x3e')],_0x55f302['starttime']);};exports[_0x46d3('0x45')]=function(_0x1904fa,_0x273b1d,_0xb37db7){_0x1904fa['membername']=_0x273b1d;_0x1904fa[_0x46d3('0x46')]=_0xb37db7;};exports['logCustomer']=function(_0x206151,_0x24658f,_0x1bcb20){var _0x4508e5=moment()[_0x46d3('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x206151[_0x46d3('0x42')]=_0x24658f;_0x206151[_0x46d3('0x43')]=_0x1bcb20;_0x206151[_0x46d3('0x3e')]=_0x206151[_0x46d3('0x3e')]?_0x206151[_0x46d3('0x3e')]:_0x4508e5;_0x206151[_0x46d3('0x3f')]=_0x206151[_0x46d3('0x3f')]?_0x206151['endtime']:_0x4508e5;_0x206151[_0x46d3('0x44')]=getSeconds(_0x206151['responsetime']||0x0,_0x206151[_0x46d3('0x3d')]||0x0);_0x206151[_0x46d3('0x47')]=_0x206151[_0x46d3('0x48')]?getSeconds(_0x206151[_0x46d3('0x3f')],_0x206151['answertime']):0x0;};exports[_0x46d3('0x49')]=function(_0x51ec4c){return _0x51ec4c===_0x46d3('0x4a');};exports['variablesAction']=function(_0x167145,_0x186507,_0x1560ad,_0x25c79f,_0x2d9de3){var _0x585b24=_0x25c79f?_0x46d3('0x4b'):_0x167145[_0x46d3('0x1c')];_0x585b24=_0x2d9de3?_0x46d3('0x4c'):_0x585b24;return{'actionid':_0x167145[_0x46d3('0x4d')],'action':'originate','channel':_0x167145[_0x46d3('0x4e')],'callerid':util['format'](_0x46d3('0x15'),_0x585b24,_0x167145[_0x46d3('0x1d')]),'Exten':'xcally-motion-preview','Context':_0x46d3('0x4f'),'Priority':'1','variable':_0x1560ad,'timeout':(_0x186507[_0x46d3('0x50')]||0x1e)*0x3e8,'async':!![],'channelid':_0x167145[_0x46d3('0x4d')]};};exports[_0x46d3('0x51')]=function(_0x4c9678){return _0x4c9678['countbusyretry']+_0x4c9678['countcongestionretry']+_0x4c9678['countnoanswerretry'];};exports[_0x46d3('0x52')]=function(_0x1a59f4){var _0x54caf7=_[_0x46d3('0x53')](_0x1a59f4);_0x54caf7[_0x46d3('0x42')]=0xf;_0x54caf7[_0x46d3('0x43')]='Global';return _0x54caf7;};exports[_0x46d3('0x54')]=function(_0x111eb5,_0x5d14ee,_0x50dafd){var _0xb8046f={};_0xb8046f[_0x5d14ee]=_0x111eb5[_0x5d14ee];_0xb8046f[_0x46d3('0x55')]=![];_0xb8046f[_0x46d3('0x56')]=moment()['add'](_0x50dafd,_0x46d3('0x57'))['format'](_0x46d3('0x41'));_0xb8046f[_0x46d3('0x58')]=_0x111eb5['ContactId'];_0xb8046f['ListId']=_0x111eb5[_0x46d3('0x59')];_0xb8046f[_0x46d3('0x1f')]=_0x111eb5['VoiceQueueId']||undefined;return _0xb8046f;};exports[_0x46d3('0x5a')]=function(_0x5b0e01,_0x1f5e7f){if(!_['isNil'](_0x5b0e01)){if(_0x5b0e01[_0x46d3('0x5b')]>0x0){_0x5b0e01[_0x46d3('0x5b')]-=0x1;}else{logger[_0x46d3('0x9')](_0x1f5e7f,_0x46d3('0x5c'));}}else{logger[_0x46d3('0x9')](_0x1f5e7f,_0x46d3('0x5d'));}};exports['IsNotLoggedIn']=function(_0x2fd21b){if(_0x2fd21b<=0x0){return!![];}return![];};exports[_0x46d3('0x5e')]=function(_0x19b204,_0x2bce37){_0x19b204[_0x46d3('0x5f')]=_0x2bce37;_0x19b204[_0x46d3('0x1b')]=_0x19b204[_0x46d3('0x60')];_0x19b204['interface']=_0x19b204[_0x46d3('0x4e')];return _0x19b204;};exports['buildAcw']=function(_0xac77dd){var _0x2c1b5b={};_0x2c1b5b[_0x46d3('0x60')]=_0xac77dd['queue'];_0x2c1b5b[_0x46d3('0x61')]=_0xac77dd[_0x46d3('0x4e')];_0x2c1b5b['uniqueid']=_0xac77dd['uniqueid'];return _0x2c1b5b;};exports['agentReadyId']=function(_0x223997){var _0x1eee37=[];for(var _0x3ed5f1 in _0x223997){if(_0x223997['hasOwnProperty'](_0x3ed5f1)){if(!_[_0x46d3('0x18')](_0x223997[_0x3ed5f1])&&_0x223997[_0x3ed5f1][_0x46d3('0x42')]===_0x46d3('0x62')&&_0x223997[_0x3ed5f1]['status']===_0x46d3('0x63')){_0x1eee37['push'](_0x223997[_0x3ed5f1]['id']);}}}return _0x1eee37;};exports[_0x46d3('0x64')]=function(_0x441fbe){var _0x54ce31=moment()[_0x46d3('0x6')](0x0);var _0x12a7c5=moment(_0x441fbe)[_0x46d3('0x6')](0x0);return _0x54ce31[_0x46d3('0x7')](_0x12a7c5,_0x46d3('0x8'));};exports[_0x46d3('0x65')]=function(_0x1eb124){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1eb124[_0x46d3('0x58')],'ListId':_0x1eb124[_0x46d3('0x59')],'VoiceQueueId':_0x1eb124[_0x46d3('0x1f')]||undefined,'CampaignId':_0x1eb124[_0x46d3('0x66')]||undefined};};exports[_0x46d3('0x67')]=function(_0x488e12){if(_0x488e12==='uniqueid'||_0x488e12===_0x46d3('0x68')||_0x488e12===_0x46d3('0x60')||_0x488e12==='type'||_0x488e12===_0x46d3('0x69')||_0x488e12===_0x46d3('0x6a')||_0x488e12===_0x46d3('0x6b')||_0x488e12===_0x46d3('0x4e')||_0x488e12===_0x46d3('0x1c')||_0x488e12===_0x46d3('0x55')||_0x488e12===_0x46d3('0x1d')||_0x488e12===_0x46d3('0x56')||_0x488e12===_0x46d3('0x6c')||_0x488e12==='countcongestionretry'||_0x488e12===_0x46d3('0x6d')||_0x488e12===_0x46d3('0x6e')||_0x488e12===_0x46d3('0x6f')||_0x488e12==='callbackuniqueid'||_0x488e12==='callbackat'||_0x488e12===_0x46d3('0x70')||_0x488e12===_0x46d3('0x58')||_0x488e12==='ListId'||_0x488e12===_0x46d3('0x46')||_0x488e12===_0x46d3('0x1f')||_0x488e12===_0x46d3('0x71')||_0x488e12===_0x46d3('0x72')||_0x488e12==='xmd-queue'||_0x488e12===_0x46d3('0x73')||_0x488e12==='xmd-listid'||_0x488e12===_0x46d3('0x74')||_0x488e12==='xmd-dialtimeout'||_0x488e12==='xmd-dialoptions'||_0x488e12===_0x46d3('0x75')||_0x488e12===_0x46d3('0x76')||_0x488e12===_0x46d3('0x77')||_0x488e12===_0x46d3('0x78')||_0x488e12===_0x46d3('0x79')||_0x488e12===_0x46d3('0x7a')||_0x488e12==='xmd-agi'||_0x488e12==='rtpaudioqos'||_0x488e12===_0x46d3('0x7b')||_0x488e12==='rtpaudioqosjitter'||_0x488e12==='rtpaudioqosjitterbridged'||_0x488e12===_0x46d3('0x7c')||_0x488e12===_0x46d3('0x7d')||_0x488e12==='rtpaudioqosrtt'||_0x488e12===_0x46d3('0x7e')||_0x488e12===_0x46d3('0x7f')||_0x488e12===_0x46d3('0x7b')||_0x488e12===_0x46d3('0x80')||_0x488e12===_0x46d3('0x81')||_0x488e12===_0x46d3('0x7c')||_0x488e12===_0x46d3('0x7d')||_0x488e12===_0x46d3('0x82')||_0x488e12===_0x46d3('0x7e')||_0x488e12===_0x46d3('0x83')||_0x488e12===_0x46d3('0x84')||_0x488e12===_0x46d3('0x42')||_0x488e12===_0x46d3('0x43')){return![];}return!![];};exports[_0x46d3('0x85')]=function(_0x38fc6e,_0x2d2e06){var _0x1a87cb,_0x52bee6,_0x3c3b76;if(_0x2d2e06<=0x0){_0x2d2e06=0x1;}_0x1a87cb=new RegExp('\x5cw{0,'+_0x2d2e06+'}$');_0x52bee6=Math[_0x46d3('0x86')](0xa,_0x2d2e06-0x1);_0x3c3b76=Math[_0x46d3('0x86')](0xa,_0x2d2e06)-0x1;return util[_0x46d3('0x14')]('%s',_[_0x46d3('0x87')](_0x38fc6e,_0x1a87cb,_[_0x46d3('0x88')](_0x52bee6,_0x3c3b76)));};exports['extractCalleridName']=function(_0x1639be){var _0x3e792b=_0x1639be[_0x46d3('0x89')](/"(.*?)"/);return _0x3e792b?_0x3e792b[0x1]:_0x1639be;};exports['extractCalleridNumber']=function(_0x341ae1){var _0x1f975a=_0x341ae1['match'](/<(.*?)>/);return _0x1f975a?_0x1f975a[0x1]:_0x341ae1;};
\ No newline at end of file
+var _0xf8de=['responsetime','endtime','logAgent','ringtime','starttime','logLookAgent','membername','UserId','answertime','isFailure','Failure','variablesAction','calleridname','BOOKED','uniqueid','originate','channelAgent','timeout','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','active','scheduledat','add','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','name','queue','interface','buildAcw','agentReadyId','not_inuse','status','reachable','push','diff','seconds','createBody','ListId','CampaignId','idContact','campaigntype','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-contactid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosloss','getCallerIdRandom','pow','replace','random','extractCalleridName','match','lodash','moment','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','loggerCatch','logger','info','inspect','loggerError','error','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist'];(function(_0x4cc0d9,_0x294d28){var _0x7df00d=function(_0x2e1f89){while(--_0x2e1f89){_0x4cc0d9['push'](_0x4cc0d9['shift']());}};_0x7df00d(++_0x294d28);}(_0xf8de,0x1d4));var _0xef8d=function(_0x303603,_0x1e148a){_0x303603=_0x303603-0x0;var _0x1dde8d=_0xf8de[_0x303603];return _0x1dde8d;};'use strict';var util=require('util');var _=require(_0xef8d('0x0'));var moment=require(_0xef8d('0x1'));var logger=require('../../../../config/logger')(_0xef8d('0x2'));var ipAgi=process['env'][_0xef8d('0x3')]||_0xef8d('0x4');function getSeconds(_0x3cdc6d,_0x58851e){var _0x19af2a=moment(_0x3cdc6d)[_0xef8d('0x5')](0x0);var _0x586e39=moment(_0x58851e)[_0xef8d('0x5')](0x0);return _0x19af2a['diff'](_0x586e39,'seconds');}exports[_0xef8d('0x6')]=function(_0x3e74f1){return function(_0x18b179){logger['error'](_0x3e74f1,util['inspect'](_0x18b179,{'showHidden':![],'depth':null}));};};exports[_0xef8d('0x7')]=function(_0x2af297,_0x1c74ab){logger[_0xef8d('0x8')](_0x2af297,util[_0xef8d('0x9')](_0x1c74ab,{'showHidden':![],'depth':null}));};exports[_0xef8d('0xa')]=function(_0x337459,_0x4364be){logger[_0xef8d('0xb')](_0x337459,util[_0xef8d('0x9')](_0x4364be,{'showHidden':![],'depth':null}));};exports[_0xef8d('0xc')]=function(_0x306468){return function(_0xf48324){logger[_0xef8d('0x8')](_0x306468,util[_0xef8d('0x9')](_0xf48324,{'showHidden':![],'depth':null}));};};exports[_0xef8d('0xd')]=function(_0x585d14,_0x47e289,_0x3d306f){return{'message':_0x585d14,'unlock':_0x47e289,'active':_0x3d306f};};exports['getCallerId']=function(_0x309135,_0x39c206,_0x4135a4){if(!_[_0xef8d('0xe')](_0x4135a4)&&'string'===typeof _0x4135a4&&!_['isEmpty'](_0x4135a4)){if(!_[_0xef8d('0xe')](_0x39c206)&&_0xef8d('0xf')===typeof _0x39c206&&!_[_0xef8d('0x10')](_0x39c206)){return util[_0xef8d('0x11')](_0xef8d('0x12'),_0x39c206,_0x4135a4);}return util['format'](_0xef8d('0x12'),_0x4135a4,_0x4135a4);}if(!_[_0xef8d('0xe')](_0x309135)&&_0xef8d('0xf')===typeof _0x309135&&!_[_0xef8d('0x10')](_0x309135)){return _0x309135;}return _0xef8d('0x13');};exports[_0xef8d('0x14')]=function(_0x5cf793){if(_[_0xef8d('0x15')](_0x5cf793)){return![];}return _0x5cf793;};exports[_0xef8d('0x16')]=function(_0x18d24d,_0x23d0d9,_0x1cf384,_0x586168,_0x2deb31,_0x475bd0){var _0x369c3e={'XMD-QUEUE':_0x23d0d9[_0xef8d('0x17')]?_0x23d0d9[_0xef8d('0x17')]['name']:'','XMD-CALLERID':_0x586168,'XMD-CALLERID-PREVIEW':_0x475bd0?util[_0xef8d('0x11')]('\x22%s\x22\x20<%s>',_0x475bd0['calleridname'],_0x475bd0[_0xef8d('0x18')]):_0x586168,'XMD-DIALID':_0x2deb31,'XMD-CONTACTID':_0x23d0d9[_0xef8d('0x19')],'XMD-CDRTYPE':_0xef8d('0x1a'),'CALLERID(all)':_0x586168,'XMD-VOICEQUEUEID':_0x23d0d9[_0xef8d('0x1b')],'XMD-DIALCHANNEL':_0x1cf384,'XMD-DIALTIMEOUT':_0x18d24d[_0xef8d('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xef8d('0x11')](_0xef8d('0x1d'),_0x18d24d['dialQueueProject2']?'g':'',_[_0xef8d('0x10')](_0x18d24d['monitor_format'])?'':_0xef8d('0x1e')),'XMD-DIALURL':_0x18d24d[_0xef8d('0x1f')]||'','XMD-AGI':_0x18d24d[_0xef8d('0x20')]?util[_0xef8d('0x11')](_0xef8d('0x21'),ipAgi,_0x18d24d[_0xef8d('0x20')]):_0xef8d('0x22'),'XMD-AGIAFTER':_0x18d24d['dialQueueProject2']?util[_0xef8d('0x11')](_0xef8d('0x21'),ipAgi,_0x18d24d[_0xef8d('0x23')]):_0xef8d('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x475bd0?_0x475bd0[_0xef8d('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x475bd0?_0x475bd0[_0xef8d('0x25')]:'','XMD-DESTINATION':_0xef8d('0x26')};if(!_[_0xef8d('0x10')](_0x18d24d[_0xef8d('0x27')])){_0x369c3e[util[_0xef8d('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x18d24d[_0xef8d('0x27')];_0x369c3e[util[_0xef8d('0x11')]('%s',_0xef8d('0x28'))]=_0x2deb31;}if(_0x23d0d9&&_0x23d0d9[_0xef8d('0x29')]){for(var _0x1a3b18 in _0x23d0d9['Contact']){if(_0x23d0d9[_0xef8d('0x29')][_0xef8d('0x2a')](_0x1a3b18)){if(!_['isNil'](_0x23d0d9[_0xef8d('0x29')][_0x1a3b18])&&_0x1a3b18!=='id'&&_0x1a3b18!==_0xef8d('0x2b')&&_0x1a3b18!=='createdAt'&&_0x1a3b18!==_0xef8d('0x2c')){_0x369c3e[util[_0xef8d('0x11')]('%s%s','XMD-',_[_0xef8d('0x2d')](_0x1a3b18))]=_0x23d0d9[_0xef8d('0x29')][_0x1a3b18];}}}}return _0x369c3e;};exports[_0xef8d('0x2e')]=function(_0x42d421){var _0x4b4a6e={};for(var _0x5c2383 in _0x42d421){if(_0x42d421['hasOwnProperty'](_0x5c2383)){_0x4b4a6e[util[_0xef8d('0x11')]('%s',_['toLower'](_0x5c2383))]=_0x42d421[_0x5c2383];}}return{'variables':_0x4b4a6e};};exports[_0xef8d('0x2f')]=function(_0x4c2993,_0x20446a){if(!_[_0xef8d('0x15')](_0x4c2993)){if(_0x4c2993[_0xef8d('0x2a')](_0xef8d('0x30'))){if(_0x4c2993[_0xef8d('0x30')]>0x0){_0x4c2993['originated']-=0x1;}else{logger[_0xef8d('0xb')](_0xef8d('0x31'),_0x20446a);}}}else{logger['error'](_0xef8d('0x32'),_0x20446a);}};exports[_0xef8d('0x33')]=function(_0x13b05b){var _0x326089=moment()[_0xef8d('0x11')](_0xef8d('0x34'));_0x13b05b[_0xef8d('0x35')]=0xd;_0x13b05b[_0xef8d('0x36')]=_0xef8d('0x37');_0x13b05b['starttime']=_0x326089;_0x13b05b[_0xef8d('0x38')]=_0x326089;_0x13b05b[_0xef8d('0x39')]=_0x326089;};exports[_0xef8d('0x3a')]=function(_0x4212a5,_0x14c291,_0x4e256a){var _0x107e12=moment()[_0xef8d('0x11')](_0xef8d('0x34'));_0x4212a5[_0xef8d('0x35')]=_0x14c291;_0x4212a5[_0xef8d('0x36')]=_0x4e256a;_0x4212a5[_0xef8d('0x38')]=_0x107e12;_0x4212a5[_0xef8d('0x3b')]=getSeconds(_0x4212a5[_0xef8d('0x38')],_0x4212a5[_0xef8d('0x3c')]);};exports[_0xef8d('0x3d')]=function(_0x563376,_0x37e001,_0x4f6521){_0x563376[_0xef8d('0x3e')]=_0x37e001;_0x563376[_0xef8d('0x3f')]=_0x4f6521;};exports['logCustomer']=function(_0x5bf459,_0x32004b,_0x343302){var _0x3e1df6=moment()['format'](_0xef8d('0x34'));_0x5bf459['state']=_0x32004b;_0x5bf459[_0xef8d('0x36')]=_0x343302;_0x5bf459[_0xef8d('0x38')]=_0x5bf459[_0xef8d('0x38')]?_0x5bf459[_0xef8d('0x38')]:_0x3e1df6;_0x5bf459['endtime']=_0x5bf459['endtime']?_0x5bf459[_0xef8d('0x39')]:_0x3e1df6;_0x5bf459[_0xef8d('0x3b')]=getSeconds(_0x5bf459[_0xef8d('0x38')]||0x0,_0x5bf459[_0xef8d('0x3c')]||0x0);_0x5bf459['talktime']=_0x5bf459[_0xef8d('0x40')]?getSeconds(_0x5bf459[_0xef8d('0x39')],_0x5bf459['answertime']):0x0;};exports[_0xef8d('0x41')]=function(_0x5c2a69){return _0x5c2a69===_0xef8d('0x42');};exports[_0xef8d('0x43')]=function(_0x517316,_0x592f7f,_0x511197,_0x2f6de2,_0x49142f){var _0x2b618e=_0x2f6de2?'RECALL':_0x517316[_0xef8d('0x44')];_0x2b618e=_0x49142f?_0xef8d('0x45'):_0x2b618e;return{'actionid':_0x517316[_0xef8d('0x46')],'action':_0xef8d('0x47'),'channel':_0x517316[_0xef8d('0x48')],'callerid':util[_0xef8d('0x11')](_0xef8d('0x12'),_0x2b618e,_0x517316[_0xef8d('0x18')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x511197,'timeout':(_0x592f7f[_0xef8d('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x517316[_0xef8d('0x46')]};};exports['totalGlobal']=function(_0x1b0a43){return _0x1b0a43['countbusyretry']+_0x1b0a43[_0xef8d('0x4a')]+_0x1b0a43[_0xef8d('0x4b')];};exports[_0xef8d('0x4c')]=function(_0xff0a86){var _0x4ec637=_[_0xef8d('0x4d')](_0xff0a86);_0x4ec637[_0xef8d('0x35')]=0xf;_0x4ec637[_0xef8d('0x36')]=_0xef8d('0x4e');return _0x4ec637;};exports['scheduledAt']=function(_0x27765b,_0x1b35fa,_0x2caed8){var _0x52fd05={};_0x52fd05[_0x1b35fa]=_0x27765b[_0x1b35fa];_0x52fd05[_0xef8d('0x4f')]=![];_0x52fd05[_0xef8d('0x50')]=moment()[_0xef8d('0x51')](_0x2caed8,'minutes')[_0xef8d('0x11')](_0xef8d('0x34'));_0x52fd05[_0xef8d('0x19')]=_0x27765b['ContactId'];_0x52fd05['ListId']=_0x27765b['ListId'];_0x52fd05[_0xef8d('0x1b')]=_0x27765b['VoiceQueueId']||undefined;return _0x52fd05;};exports[_0xef8d('0x52')]=function(_0x57953f,_0x20be36){if(!_['isNil'](_0x57953f)){if(_0x57953f[_0xef8d('0x53')]>0x0){_0x57953f[_0xef8d('0x53')]-=0x1;}else{logger[_0xef8d('0xb')](_0x20be36,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xef8d('0xb')](_0x20be36,_0xef8d('0x54'));}};exports['IsNotLoggedIn']=function(_0x2784dd){if(_0x2784dd<=0x0){return!![];}return![];};exports[_0xef8d('0x55')]=function(_0x187907,_0x367834){_0x187907[_0xef8d('0x56')]=_0x367834;_0x187907[_0xef8d('0x57')]=_0x187907[_0xef8d('0x58')];_0x187907[_0xef8d('0x59')]=_0x187907[_0xef8d('0x48')];return _0x187907;};exports[_0xef8d('0x5a')]=function(_0xfa1bd4){var _0x5bfa3a={};_0x5bfa3a[_0xef8d('0x58')]=_0xfa1bd4[_0xef8d('0x58')];_0x5bfa3a[_0xef8d('0x59')]=_0xfa1bd4[_0xef8d('0x48')];_0x5bfa3a[_0xef8d('0x46')]=_0xfa1bd4[_0xef8d('0x46')];return _0x5bfa3a;};exports[_0xef8d('0x5b')]=function(_0x17c747){var _0xee2035=[];for(var _0x57f082 in _0x17c747){if(_0x17c747[_0xef8d('0x2a')](_0x57f082)){if(!_[_0xef8d('0x15')](_0x17c747[_0x57f082])&&_0x17c747[_0x57f082]['state']===_0xef8d('0x5c')&&_0x17c747[_0x57f082][_0xef8d('0x5d')]===_0xef8d('0x5e')){_0xee2035[_0xef8d('0x5f')](_0x17c747[_0x57f082]['id']);}}}return _0xee2035;};exports['getDiff']=function(_0x35a0c1){var _0x2d7778=moment()[_0xef8d('0x5')](0x0);var _0x3dc6a6=moment(_0x35a0c1)[_0xef8d('0x5')](0x0);return _0x2d7778[_0xef8d('0x60')](_0x3dc6a6,_0xef8d('0x61'));};exports[_0xef8d('0x62')]=function(_0x9828fa){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x9828fa[_0xef8d('0x19')],'ListId':_0x9828fa[_0xef8d('0x63')],'VoiceQueueId':_0x9828fa['VoiceQueueId']||undefined,'CampaignId':_0x9828fa[_0xef8d('0x64')]||undefined};};exports['filterKey']=function(_0x20e1f6){if(_0x20e1f6===_0xef8d('0x46')||_0x20e1f6===_0xef8d('0x65')||_0x20e1f6==='queue'||_0x20e1f6==='type'||_0x20e1f6===_0xef8d('0x66')||_0x20e1f6==='dialAnswer'||_0x20e1f6==='membername'||_0x20e1f6===_0xef8d('0x48')||_0x20e1f6===_0xef8d('0x44')||_0x20e1f6===_0xef8d('0x4f')||_0x20e1f6===_0xef8d('0x18')||_0x20e1f6===_0xef8d('0x50')||_0x20e1f6===_0xef8d('0x67')||_0x20e1f6===_0xef8d('0x4a')||_0x20e1f6===_0xef8d('0x4b')||_0x20e1f6===_0xef8d('0x68')||_0x20e1f6===_0xef8d('0x69')||_0x20e1f6===_0xef8d('0x6a')||_0x20e1f6===_0xef8d('0x6b')||_0x20e1f6===_0xef8d('0x6c')||_0x20e1f6==='ContactId'||_0x20e1f6===_0xef8d('0x63')||_0x20e1f6===_0xef8d('0x3f')||_0x20e1f6===_0xef8d('0x1b')||_0x20e1f6===_0xef8d('0x6d')||_0x20e1f6===_0xef8d('0x6e')||_0x20e1f6==='xmd-queue'||_0x20e1f6===_0xef8d('0x6f')||_0x20e1f6==='xmd-listid'||_0x20e1f6===_0xef8d('0x70')||_0x20e1f6===_0xef8d('0x71')||_0x20e1f6==='xmd-dialoptions'||_0x20e1f6===_0xef8d('0x72')||_0x20e1f6==='xmd-dialchannel'||_0x20e1f6===_0xef8d('0x73')||_0x20e1f6==='xmd-cdrtype'||_0x20e1f6==='xmd-callerid'||_0x20e1f6===_0xef8d('0x74')||_0x20e1f6===_0xef8d('0x75')||_0x20e1f6===_0xef8d('0x76')||_0x20e1f6===_0xef8d('0x77')||_0x20e1f6==='rtpaudioqosjitter'||_0x20e1f6===_0xef8d('0x78')||_0x20e1f6==='rtpaudioqosloss'||_0x20e1f6==='rtpaudioqoslossbridged'||_0x20e1f6===_0xef8d('0x79')||_0x20e1f6===_0xef8d('0x7a')||_0x20e1f6==='rtpaudioqos'||_0x20e1f6===_0xef8d('0x77')||_0x20e1f6===_0xef8d('0x7b')||_0x20e1f6===_0xef8d('0x78')||_0x20e1f6===_0xef8d('0x7c')||_0x20e1f6==='rtpaudioqoslossbridged'||_0x20e1f6===_0xef8d('0x79')||_0x20e1f6===_0xef8d('0x7a')||_0x20e1f6==='bridgepeer'||_0x20e1f6==='bridgepvtcallid'||_0x20e1f6===_0xef8d('0x35')||_0x20e1f6===_0xef8d('0x36')){return![];}return!![];};exports[_0xef8d('0x7d')]=function(_0x4c497c,_0x4a643b){var _0x1c1fc1,_0x12edba,_0x4bb357;if(_0x4a643b<=0x0){_0x4a643b=0x1;}_0x1c1fc1=new RegExp('\x5cw{0,'+_0x4a643b+'}$');_0x12edba=Math[_0xef8d('0x7e')](0xa,_0x4a643b-0x1);_0x4bb357=Math[_0xef8d('0x7e')](0xa,_0x4a643b)-0x1;return util['format']('%s',_[_0xef8d('0x7f')](_0x4c497c,_0x1c1fc1,_[_0xef8d('0x80')](_0x12edba,_0x4bb357)));};exports[_0xef8d('0x81')]=function(_0x3cab3d){var _0x1d6220=_0x3cab3d[_0xef8d('0x82')](/"(.*?)"/);return _0x1d6220?_0x1d6220[0x1]:_0x3cab3d;};exports['extractCalleridNumber']=function(_0x26374e){var _0x487bc6=_0x26374e[_0xef8d('0x82')](/<(.*?)>/);return _0x487bc6?_0x487bc6[0x1]:_0x26374e;};
\ No newline at end of file