Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / services / xdr / agents.controller.js
index 7a67165..69616c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2a4=['lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','CreateVoiceAgentReport','agentcalled','destuniqueid','agentcalledAt','now','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','abandoned','reason','agentconnect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','blind','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','transferexten','secondtransfererexten','transfertargetuniqueid','hangup','cause','rejected','splice','agent','util','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum'];(function(_0x58c7b0,_0x4cb178){var _0x22a17d=function(_0xdb4bc){while(--_0xdb4bc){_0x58c7b0['push'](_0x58c7b0['shift']());}};_0x22a17d(++_0x4cb178);}(_0xc2a4,0x88));var _0x4c2a=function(_0x5413ee,_0x487af3){_0x5413ee=_0x5413ee-0x0;var _0x3ea37a=_0xc2a4[_0x5413ee];return _0x3ea37a;};'use strict';var _=require('lodash');var util=require(_0x4c2a('0x0'));var utils=require(_0x4c2a('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x14a03f,_0x2edc8a){utils[_0x4c2a('0x2')](util[_0x4c2a('0x3')](_0x4c2a('0x4'),_0x14a03f[_0x4c2a('0x5')],_0x14a03f[_0x4c2a('0x6')],_0x14a03f[_0x4c2a('0x7')],_0x14a03f[_0x4c2a('0x8')],_0x14a03f[_0x4c2a('0x9')],_0x14a03f[_0x4c2a('0xa')],_0x14a03f[_0x4c2a('0xb')],_0x14a03f[_0x4c2a('0xc')]));if(_0x14a03f[_0x4c2a('0x7')]){utils[_0x4c2a('0xd')](_0x14a03f['queue'])[_0x4c2a('0xe')](function(_0x652d13){if(_0x652d13){_0x14a03f['type']=_0x652d13[_0x4c2a('0xf')];_0x14a03f[_0x4c2a('0x10')]=_0x14a03f[_0x4c2a('0x11')]?_0x652d13[_0x4c2a('0x12')]:![];_0x14a03f[_0x4c2a('0x13')]=_0x14a03f[_0x4c2a('0x10')]?_0x652d13['acwTimeout']:0x0;}utils['request'](_0x4c2a('0x14'),_0x14a03f);});}else{utils['request'](_0x4c2a('0x14'),_0x14a03f);}if(_0x2edc8a){delete transfers[_0x14a03f['uniqueid']];}else{delete agents[_0x14a03f['destuniqueid']];}}exports[_0x4c2a('0x15')]=function(_0x3e4a08){try{agents[_0x3e4a08['destuniqueid']]=_0x3e4a08;agents[_0x3e4a08[_0x4c2a('0x16')]][_0x4c2a('0x17')]=utils[_0x4c2a('0x18')]();agents[_0x3e4a08[_0x4c2a('0x16')]][_0x4c2a('0xc')]='called';agents[_0x3e4a08[_0x4c2a('0x16')]][_0x4c2a('0xb')]=null;agents[_0x3e4a08[_0x4c2a('0x16')]][_0x4c2a('0x19')]=null;}catch(_0x3ea6d6){utils[_0x4c2a('0x1a')](_0x3ea6d6[_0x4c2a('0x1b')]);}};exports[_0x4c2a('0x1c')]=function(_0x4cf791){try{if(!_[_0x4c2a('0x1d')](agents[_0x4cf791['destuniqueid']])){agents[_0x4cf791[_0x4c2a('0x16')]]['agentringnoanswer']=!![];agents[_0x4cf791[_0x4c2a('0x16')]][_0x4c2a('0x1e')]=utils[_0x4c2a('0x18')]();agents[_0x4cf791['destuniqueid']][_0x4c2a('0xc')]=_0x4c2a('0x1f');agents[_0x4cf791[_0x4c2a('0x16')]]['reason']=_0x4c2a('0x1f');agents[_0x4cf791['destuniqueid']][_0x4c2a('0x20')]=_0x4cf791[_0x4c2a('0x21')]?parseInt(_0x4cf791[_0x4c2a('0x21')])/0x3e8:0x0;agents[_0x4cf791['destuniqueid']][_0x4c2a('0x22')]=0x0;unanswered[_0x4c2a('0x23')](_0x4cf791[_0x4c2a('0x16')]);}}catch(_0x34b2de){utils[_0x4c2a('0x1a')](_0x34b2de[_0x4c2a('0x1b')]);}};exports[_0x4c2a('0x24')]=function(_0x11ac6b){try{_[_0x4c2a('0x25')](agents,function(_0x5fd525,_0x5d174a){if(_0x5fd525[_0x4c2a('0x5')]==_0x11ac6b['uniqueid']&&!_[_0x4c2a('0x26')](unanswered,_0x5fd525[_0x4c2a('0x16')])){_0x5fd525[_0x4c2a('0x1c')]=!![];_0x5fd525[_0x4c2a('0x1e')]=utils['now']();_0x5fd525['lastevent']=_0x4c2a('0x27');_0x5fd525[_0x4c2a('0x28')]=_0x4c2a('0x27');_0x5fd525[_0x4c2a('0x20')]=_0x11ac6b['holdtime'];_0x5fd525[_0x4c2a('0x22')]=0x0;writeDB(_0x5fd525);}});}catch(_0x18946a){utils[_0x4c2a('0x1a')](_0x18946a[_0x4c2a('0x1b')]);}};exports[_0x4c2a('0x29')]=function(_0x5366bb){try{if(agents[_0x5366bb[_0x4c2a('0x16')]]){agents[_0x5366bb[_0x4c2a('0x16')]][_0x4c2a('0x2a')]=utils['now']();agents[_0x5366bb[_0x4c2a('0x16')]]['connectedlinenum']=_0x5366bb[_0x4c2a('0xb')];agents[_0x5366bb[_0x4c2a('0x16')]][_0x4c2a('0x19')]=_0x5366bb[_0x4c2a('0x19')];agents[_0x5366bb[_0x4c2a('0x16')]][_0x4c2a('0x20')]=_0x5366bb[_0x4c2a('0x21')];agents[_0x5366bb[_0x4c2a('0x16')]][_0x4c2a('0xc')]=_0x4c2a('0x2b');_[_0x4c2a('0x25')](agents,function(_0x12f686,_0x33a948){if(_0x12f686['destuniqueid']!=_0x5366bb[_0x4c2a('0x16')]&&_0x12f686[_0x4c2a('0x5')]==_0x5366bb[_0x4c2a('0x5')]){_0x12f686[_0x4c2a('0x22')]=0x0;_0x12f686[_0x4c2a('0x20')]=_0x5366bb[_0x4c2a('0x21')];_0x12f686[_0x4c2a('0x1c')]=!![];_0x12f686[_0x4c2a('0x1e')]=utils['now']();_0x12f686[_0x4c2a('0xc')]=_0x4c2a('0x2c');_0x12f686['reason']=_0x4c2a('0x2c');_0x12f686[_0x4c2a('0x2d')]=_0x5366bb[_0x4c2a('0x16')];_0x12f686[_0x4c2a('0x2e')]=_0x5366bb[_0x4c2a('0x8')];writeDB(_0x12f686);}});}}catch(_0x3894a6){utils['error'](_0x3894a6[_0x4c2a('0x1b')]);}};exports[_0x4c2a('0x11')]=function(_0x557c5a){try{if(!_[_0x4c2a('0x1d')](agents[_0x557c5a[_0x4c2a('0x16')]])){agents[_0x557c5a[_0x4c2a('0x16')]][_0x4c2a('0x11')]=!![];agents[_0x557c5a['destuniqueid']][_0x4c2a('0x2f')]=utils['now']();agents[_0x557c5a[_0x4c2a('0x16')]][_0x4c2a('0x22')]=utils[_0x4c2a('0x30')](agents[_0x557c5a[_0x4c2a('0x16')]][_0x4c2a('0x2f')],agents[_0x557c5a[_0x4c2a('0x16')]]['agentconnectAt']);agents[_0x557c5a[_0x4c2a('0x16')]][_0x4c2a('0x28')]=_0x557c5a[_0x4c2a('0x28')];agents[_0x557c5a[_0x4c2a('0x16')]][_0x4c2a('0xc')]=_0x4c2a('0x31');writeDB(agents[_0x557c5a[_0x4c2a('0x16')]]);}}catch(_0x3efa4c){utils[_0x4c2a('0x1a')](_0x3efa4c[_0x4c2a('0x1b')]);}};exports[_0x4c2a('0x32')]=function(_0x58610f){try{if(!_[_0x4c2a('0x1d')](agents[_0x58610f['transfereruniqueid']])){agents[_0x58610f[_0x4c2a('0x33')]][_0x4c2a('0x34')]=!![];agents[_0x58610f[_0x4c2a('0x33')]]['transfertype']=_0x4c2a('0x35');agents[_0x58610f[_0x4c2a('0x33')]]['transferexten']=_0x58610f[_0x4c2a('0x36')];agents[_0x58610f['transfereruniqueid']][_0x4c2a('0x37')]=agents[_0x58610f['transfereruniqueid']]['uniqueid'];}}catch(_0x44886e){utils['error'](_0x44886e[_0x4c2a('0x1b')]);}};exports['attendedtransfer']=function(_0x5d9f4e){try{if(_0x5d9f4e[_0x4c2a('0x38')]==_0x5d9f4e[_0x4c2a('0x39')]){if(!_[_0x4c2a('0x1d')](agents[_0x5d9f4e[_0x4c2a('0x3a')]])){agents[_0x5d9f4e[_0x4c2a('0x3a')]][_0x4c2a('0x34')]=!![];agents[_0x5d9f4e['secondtransfereruniqueid']][_0x4c2a('0x3b')]=_0x4c2a('0x3c');agents[_0x5d9f4e['secondtransfereruniqueid']]['transferexten']=_0x5d9f4e[_0x4c2a('0x3d')];agents[_0x5d9f4e[_0x4c2a('0x3a')]][_0x4c2a('0x37')]=_0x5d9f4e[_0x4c2a('0x38')];}if(_0x5d9f4e[_0x4c2a('0x3e')]&&agents[_0x5d9f4e[_0x4c2a('0x3e')]]){agents[_0x5d9f4e[_0x4c2a('0x3e')]]['agententerreason']=0x1;transfers[_0x5d9f4e['transfereeuniqueid']]=_[_0x4c2a('0x3f')](agents[_0x5d9f4e['transfereeuniqueid']]);transfers[_0x5d9f4e['transfereeuniqueid']][_0x4c2a('0xa')]=agents[_0x5d9f4e[_0x4c2a('0x3a')]][_0x4c2a('0xa')];transfers[_0x5d9f4e[_0x4c2a('0x3e')]][_0x4c2a('0x40')]=agents[_0x5d9f4e[_0x4c2a('0x3a')]][_0x4c2a('0x40')];transfers[_0x5d9f4e[_0x4c2a('0x3e')]][_0x4c2a('0x17')]=utils[_0x4c2a('0x18')]();transfers[_0x5d9f4e[_0x4c2a('0x3e')]]['agentconnectAt']=utils['now']();transfers[_0x5d9f4e[_0x4c2a('0x3e')]][_0x4c2a('0x20')]=0x0;transfers[_0x5d9f4e[_0x4c2a('0x3e')]][_0x4c2a('0x41')]=0x2;}}else if(_0x5d9f4e[_0x4c2a('0x3a')]==_0x5d9f4e['secondtransfererlinkedid']){if(!_[_0x4c2a('0x1d')](agents[_0x5d9f4e[_0x4c2a('0x38')]])){agents[_0x5d9f4e[_0x4c2a('0x38')]][_0x4c2a('0x34')]=!![];agents[_0x5d9f4e[_0x4c2a('0x38')]][_0x4c2a('0x3b')]=_0x4c2a('0x3c');agents[_0x5d9f4e[_0x4c2a('0x38')]][_0x4c2a('0x42')]=_0x5d9f4e[_0x4c2a('0x43')];agents[_0x5d9f4e['origtransfereruniqueid']][_0x4c2a('0x37')]=_0x5d9f4e[_0x4c2a('0x3a')];}if(_0x5d9f4e['transfertargetuniqueid']&&agents[_0x5d9f4e[_0x4c2a('0x44')]]){agents[_0x5d9f4e[_0x4c2a('0x44')]]['agententerreason']=0x1;transfers[_0x5d9f4e[_0x4c2a('0x44')]]=_['clone'](agents[_0x5d9f4e[_0x4c2a('0x44')]]);transfers[_0x5d9f4e[_0x4c2a('0x44')]][_0x4c2a('0xa')]=agents[_0x5d9f4e['origtransfereruniqueid']][_0x4c2a('0xa')];transfers[_0x5d9f4e['transfertargetuniqueid']][_0x4c2a('0x40')]=agents[_0x5d9f4e[_0x4c2a('0x38')]]['calleridname'];transfers[_0x5d9f4e[_0x4c2a('0x44')]][_0x4c2a('0x17')]=utils[_0x4c2a('0x18')]();transfers[_0x5d9f4e[_0x4c2a('0x44')]][_0x4c2a('0x2a')]=utils[_0x4c2a('0x18')]();transfers[_0x5d9f4e[_0x4c2a('0x44')]][_0x4c2a('0x20')]=0x0;transfers[_0x5d9f4e[_0x4c2a('0x44')]]['agententerreason']=0x2;}}}catch(_0x3a75e0){utils[_0x4c2a('0x1a')](_0x3a75e0['stack']);}};exports[_0x4c2a('0x45')]=function(_0x833c39){try{if(agents[_0x833c39['uniqueid']]&&agents[_0x833c39[_0x4c2a('0x5')]][_0x4c2a('0x28')]===_0x4c2a('0x1f')){if(_0x833c39[_0x4c2a('0x46')]==='21'){agents[_0x833c39[_0x4c2a('0x5')]][_0x4c2a('0x28')]=_0x4c2a('0x47');agents[_0x833c39['uniqueid']]['lastevent']=_0x4c2a('0x47');}writeDB(agents[_0x833c39[_0x4c2a('0x5')]]);var _0x43046f=unanswered['indexOf'](_0x833c39[_0x4c2a('0x5')]);if(_0x43046f>-0x1)unanswered[_0x4c2a('0x48')](_0x43046f,0x1);}if(transfers[_0x833c39['uniqueid']]){transfers[_0x833c39[_0x4c2a('0x5')]][_0x4c2a('0x11')]=!![];transfers[_0x833c39[_0x4c2a('0x5')]][_0x4c2a('0x2f')]=utils[_0x4c2a('0x18')]();transfers[_0x833c39[_0x4c2a('0x5')]][_0x4c2a('0x22')]=utils[_0x4c2a('0x30')](transfers[_0x833c39[_0x4c2a('0x5')]][_0x4c2a('0x2f')],transfers[_0x833c39['uniqueid']][_0x4c2a('0x2a')]);transfers[_0x833c39[_0x4c2a('0x5')]][_0x4c2a('0x28')]=_0x4c2a('0x49');transfers[_0x833c39['uniqueid']][_0x4c2a('0xc')]=_0x4c2a('0x31');writeDB(transfers[_0x833c39[_0x4c2a('0x5')]],!![]);}if(agents[_0x833c39[_0x4c2a('0x5')]]&&agents[_0x833c39[_0x4c2a('0x5')]][_0x4c2a('0x2a')]){agents[_0x833c39['uniqueid']]['agentcomplete']=!![];agents[_0x833c39[_0x4c2a('0x5')]][_0x4c2a('0x2f')]=utils[_0x4c2a('0x18')]();agents[_0x833c39[_0x4c2a('0x5')]]['talktime']=utils[_0x4c2a('0x30')](agents[_0x833c39[_0x4c2a('0x5')]][_0x4c2a('0x2f')],agents[_0x833c39['uniqueid']][_0x4c2a('0x2a')]);agents[_0x833c39[_0x4c2a('0x5')]][_0x4c2a('0x28')]=agents[_0x833c39['uniqueid']]['transfer']?_0x4c2a('0x34'):_0x4c2a('0x49');agents[_0x833c39[_0x4c2a('0x5')]][_0x4c2a('0xc')]=_0x4c2a('0x31');writeDB(agents[_0x833c39[_0x4c2a('0x5')]]);}}catch(_0x20d0be){utils[_0x4c2a('0x1a')](_0x20d0be[_0x4c2a('0x1b')]);}};
\ No newline at end of file
+var _0x0bb5=['called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','agentringnoanswer','agentringnoanswerAt','now','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','timeout','cause','rejected','indexOf','splice','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt'];(function(_0x1196bd,_0xba4aea){var _0x26014f=function(_0x542a3d){while(--_0x542a3d){_0x1196bd['push'](_0x1196bd['shift']());}};_0x26014f(++_0xba4aea);}(_0x0bb5,0x148));var _0x50bb=function(_0x12b7f3,_0x59c581){_0x12b7f3=_0x12b7f3-0x0;var _0x113ec7=_0x0bb5[_0x12b7f3];return _0x113ec7;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5a12b6,_0x348380){utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x4'),_0x5a12b6[_0x50bb('0x5')],_0x5a12b6[_0x50bb('0x6')],_0x5a12b6[_0x50bb('0x7')],_0x5a12b6[_0x50bb('0x8')],_0x5a12b6['interface'],_0x5a12b6['calleridnum'],_0x5a12b6[_0x50bb('0x9')],_0x5a12b6[_0x50bb('0xa')]));if(_0x5a12b6[_0x50bb('0x7')]){utils[_0x50bb('0xb')](_0x5a12b6['queue'])['then'](function(_0x2bede8){if(_0x2bede8){_0x5a12b6[_0x50bb('0xc')]=_0x2bede8[_0x50bb('0xc')];_0x5a12b6[_0x50bb('0xd')]=_0x5a12b6['agentcomplete']?_0x2bede8[_0x50bb('0xe')]:![];_0x5a12b6[_0x50bb('0xf')]=_0x5a12b6[_0x50bb('0xd')]?_0x2bede8[_0x50bb('0x10')]:0x0;}utils[_0x50bb('0x11')](_0x50bb('0x12'),_0x5a12b6);});}else{utils[_0x50bb('0x11')]('CreateVoiceAgentReport',_0x5a12b6);}if(_0x348380){delete transfers[_0x5a12b6[_0x50bb('0x5')]];}else{delete agents[_0x5a12b6['destuniqueid']];}}exports[_0x50bb('0x13')]=function(_0xd8ab27){try{utils[_0x50bb('0x14')](util['format'](_0x50bb('0x15'),_0xd8ab27[_0x50bb('0x5')]),_0xd8ab27);agents[_0xd8ab27[_0x50bb('0x16')]]=_0xd8ab27;agents[_0xd8ab27['destuniqueid']][_0x50bb('0x17')]=utils['now']();agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0xa')]=_0x50bb('0x18');agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0x9')]=null;agents[_0xd8ab27['destuniqueid']][_0x50bb('0x19')]=null;utils[_0x50bb('0x2')](util['format'](_0x50bb('0x1a'),_0xd8ab27['uniqueid'],agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0x8')],_0xd8ab27['destuniqueid']));}catch(_0x4f1c0a){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x15'),_0xd8ab27[_0x50bb('0x5')]),_0x4f1c0a);}};exports['agentringnoanswer']=function(_0x19dc5d){try{if(!_[_0x50bb('0x1c')](agents[_0x19dc5d[_0x50bb('0x16')]])){utils['debug'](util[_0x50bb('0x3')](_0x50bb('0x1d'),_0x19dc5d[_0x50bb('0x5')]),_0x19dc5d);utils['info'](util[_0x50bb('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x19dc5d[_0x50bb('0x5')],agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x8')],_0x19dc5d[_0x50bb('0x16')]));agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x1e')]=!![];agents[_0x19dc5d['destuniqueid']][_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0xa')]='timeout';agents[_0x19dc5d[_0x50bb('0x16')]]['reason']='timeout';agents[_0x19dc5d[_0x50bb('0x16')]]['holdtime']=_0x19dc5d['ringtime']?parseInt(_0x19dc5d[_0x50bb('0x21')])/0x3e8:0x0;agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x22')]=0x0;unanswered[_0x50bb('0x23')](_0x19dc5d[_0x50bb('0x16')]);}}catch(_0x269479){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')]('[%s][agents][agentringnoanswer]',_0x19dc5d[_0x50bb('0x5')]),_0x269479);}};exports[_0x50bb('0x24')]=function(_0x15ee2e){try{_[_0x50bb('0x25')](agents,function(_0x560b07,_0x13dc3c){if(_0x560b07[_0x50bb('0x5')]==_0x15ee2e[_0x50bb('0x5')]&&!_[_0x50bb('0x26')](unanswered,_0x560b07[_0x50bb('0x16')])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x27'),_0x15ee2e[_0x50bb('0x5')]),_0x15ee2e);utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x28'),_0x15ee2e['uniqueid'],_0x560b07[_0x50bb('0x8')],_0x560b07[_0x50bb('0x16')]));_0x560b07[_0x50bb('0x1e')]=!![];_0x560b07[_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();_0x560b07[_0x50bb('0xa')]=_0x50bb('0x29');_0x560b07[_0x50bb('0x2a')]=_0x50bb('0x29');_0x560b07[_0x50bb('0x2b')]=_0x15ee2e[_0x50bb('0x2b')];_0x560b07['talktime']=0x0;writeDB(_0x560b07);}});}catch(_0x364ea0){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x27'),_0x15ee2e[_0x50bb('0x5')]),_0x364ea0);}};exports[_0x50bb('0x2c')]=function(_0x53600a){try{if(agents[_0x53600a['destuniqueid']]){utils[_0x50bb('0x14')](util['format'](_0x50bb('0x2d'),_0x53600a[_0x50bb('0x5')]),_0x53600a);utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x2e'),_0x53600a['uniqueid'],agents[_0x53600a[_0x50bb('0x16')]]['membername'],_0x53600a[_0x50bb('0x16')]));agents[_0x53600a[_0x50bb('0x16')]][_0x50bb('0x2f')]=utils['now']();agents[_0x53600a['destuniqueid']][_0x50bb('0x9')]=_0x53600a[_0x50bb('0x9')];agents[_0x53600a[_0x50bb('0x16')]][_0x50bb('0x19')]=_0x53600a['connectedlinename'];agents[_0x53600a[_0x50bb('0x16')]]['holdtime']=_0x53600a['ringtime'];agents[_0x53600a[_0x50bb('0x16')]]['lastevent']=_0x50bb('0x30');_[_0x50bb('0x25')](agents,function(_0x1ef231,_0x1f156e){if(_0x1ef231[_0x50bb('0x16')]!=_0x53600a[_0x50bb('0x16')]&&_0x1ef231[_0x50bb('0x5')]==_0x53600a[_0x50bb('0x5')]){_0x1ef231[_0x50bb('0x22')]=0x0;_0x1ef231[_0x50bb('0x2b')]=_0x53600a['ringtime'];_0x1ef231['agentringnoanswer']=!![];_0x1ef231[_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();_0x1ef231[_0x50bb('0xa')]=_0x50bb('0x31');_0x1ef231['reason']=_0x50bb('0x31');_0x1ef231['answeredelsewheredestinationuniqueid']=_0x53600a[_0x50bb('0x16')];_0x1ef231[_0x50bb('0x32')]=_0x53600a[_0x50bb('0x8')];writeDB(_0x1ef231);}});}}catch(_0x40748d){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x2d'),_0x53600a[_0x50bb('0x5')]),_0x40748d);}};exports[_0x50bb('0x33')]=function(_0x46c1c3){try{if(!_[_0x50bb('0x1c')](agents[_0x46c1c3[_0x50bb('0x16')]])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x34'),_0x46c1c3[_0x50bb('0x5')]),_0x46c1c3);utils['info'](util[_0x50bb('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x46c1c3[_0x50bb('0x5')],agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x8')],_0x46c1c3[_0x50bb('0x16')]));agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x33')]=!![];agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x35')]=utils[_0x50bb('0x20')]();agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x22')]=utils[_0x50bb('0x36')](agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x35')],agents[_0x46c1c3['destuniqueid']][_0x50bb('0x2f')]);agents[_0x46c1c3['destuniqueid']][_0x50bb('0x2a')]=_0x46c1c3[_0x50bb('0x2a')];agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0xa')]=_0x50bb('0x37');writeDB(agents[_0x46c1c3[_0x50bb('0x16')]]);}}catch(_0x133dd9){utils[_0x50bb('0x1b')](util['format'](_0x50bb('0x34'),_0x46c1c3[_0x50bb('0x5')]),_0x133dd9);}};exports[_0x50bb('0x38')]=function(_0x13afe2){try{if(!_[_0x50bb('0x1c')](agents[_0x13afe2['transfereruniqueid']])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x39'),_0x13afe2[_0x50bb('0x5')]),_0x13afe2);utils[_0x50bb('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x13afe2[_0x50bb('0x5')],agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x8')],agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x5')]));agents[_0x13afe2[_0x50bb('0x3a')]][_0x50bb('0x3b')]=!![];agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x3c')]=_0x50bb('0x3d');agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x3e')]=_0x13afe2[_0x50bb('0x3f')];agents[_0x13afe2[_0x50bb('0x3a')]][_0x50bb('0x40')]=agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x5')];}}catch(_0x46b51e){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x39'),_0x13afe2['uniqueid']),_0x46b51e);}};exports[_0x50bb('0x41')]=function(_0x50943a){try{utils[_0x50bb('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x50943a[_0x50bb('0x42')]),_0x50943a);if(_0x50943a['origtransfereruniqueid']==_0x50943a['origtransfererlinkedid']){if(!_[_0x50bb('0x1c')](agents[_0x50943a[_0x50bb('0x43')]])){utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x44'),_0x50943a[_0x50bb('0x42')],agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x8')]));agents[_0x50943a['secondtransfereruniqueid']]['transfer']=!![];agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x3c')]=_0x50bb('0x45');agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x3e')]=_0x50943a[_0x50bb('0x46')];agents[_0x50943a[_0x50bb('0x43')]]['transferuniqueid']=_0x50943a[_0x50bb('0x42')];}if(_0x50943a[_0x50bb('0x47')]&&agents[_0x50943a[_0x50bb('0x47')]]){agents[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x48')]=0x1;transfers[_0x50943a['transfereeuniqueid']]=_[_0x50bb('0x49')](agents[_0x50943a[_0x50bb('0x47')]]);transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x4a')]=agents[_0x50943a[_0x50bb('0x43')]]['calleridnum'];transfers[_0x50943a[_0x50bb('0x47')]]['calleridname']=agents[_0x50943a['secondtransfereruniqueid']][_0x50bb('0x4b')];transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x17')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x2f')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x2b')]=0x0;transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x48')]=0x2;}}else if(_0x50943a['secondtransfereruniqueid']==_0x50943a[_0x50bb('0x4c')]){if(!_['isNil'](agents[_0x50943a[_0x50bb('0x42')]])){utils[_0x50bb('0x2')](util['format'](_0x50bb('0x44'),_0x50943a[_0x50bb('0x42')],agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x8')]));agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3b')]=!![];agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3c')]='ATTENDED';agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3e')]=_0x50943a[_0x50bb('0x4d')];agents[_0x50943a['origtransfereruniqueid']][_0x50bb('0x40')]=_0x50943a[_0x50bb('0x43')];}if(_0x50943a[_0x50bb('0x4e')]&&agents[_0x50943a[_0x50bb('0x4e')]]){agents[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x48')]=0x1;transfers[_0x50943a['transfertargetuniqueid']]=_[_0x50bb('0x49')](agents[_0x50943a[_0x50bb('0x4e')]]);transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x4a')]=agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x4a')];transfers[_0x50943a['transfertargetuniqueid']][_0x50bb('0x4b')]=agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x4b')];transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x17')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x2f')]=utils[_0x50bb('0x20')]();transfers[_0x50943a['transfertargetuniqueid']][_0x50bb('0x2b')]=0x0;transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x48')]=0x2;}}}catch(_0x2d2463){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x4f'),_0x50943a[_0x50bb('0x42')]),_0x2d2463);}};exports[_0x50bb('0x50')]=function(_0x578ff3){try{utils['debug'](util['format'](_0x50bb('0x51'),_0x578ff3['uniqueid']),_0x578ff3);if(agents[_0x578ff3['uniqueid']]&&agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')]===_0x50bb('0x52')){if(_0x578ff3[_0x50bb('0x53')]==='21'){agents[_0x578ff3['uniqueid']][_0x50bb('0x2a')]=_0x50bb('0x54');agents[_0x578ff3['uniqueid']][_0x50bb('0xa')]='rejected';}utils[_0x50bb('0x2')](util[_0x50bb('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x578ff3[_0x50bb('0x5')],agents[_0x578ff3['uniqueid']][_0x50bb('0x8')],agents[_0x578ff3[_0x50bb('0x5')]]['reason'],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]));writeDB(agents[_0x578ff3[_0x50bb('0x5')]]);var _0x51142c=unanswered[_0x50bb('0x55')](_0x578ff3[_0x50bb('0x5')]);if(_0x51142c>-0x1){unanswered[_0x50bb('0x56')](_0x51142c,0x1);}}if(transfers[_0x578ff3[_0x50bb('0x5')]]){transfers[_0x578ff3['uniqueid']][_0x50bb('0x33')]=!![];transfers[_0x578ff3[_0x50bb('0x5')]]['agentcompleteAt']=utils['now']();transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x22')]=utils['diffTime'](transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2f')]);transfers[_0x578ff3[_0x50bb('0x5')]]['reason']='agent';transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]=_0x50bb('0x37');utils[_0x50bb('0x2')](util['format'](_0x50bb('0x57'),_0x578ff3['uniqueid'],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x8')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]));writeDB(transfers[_0x578ff3[_0x50bb('0x5')]],!![]);}if(agents[_0x578ff3['uniqueid']]&&agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2f')]){agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x33')]=!![];agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')]=utils[_0x50bb('0x20')]();agents[_0x578ff3['uniqueid']][_0x50bb('0x22')]=utils[_0x50bb('0x36')](agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')],agents[_0x578ff3[_0x50bb('0x5')]]['agentconnectAt']);agents[_0x578ff3['uniqueid']][_0x50bb('0x2a')]=agents[_0x578ff3['uniqueid']][_0x50bb('0x3b')]?_0x50bb('0x3b'):'agent';agents[_0x578ff3['uniqueid']][_0x50bb('0xa')]=_0x50bb('0x37');utils[_0x50bb('0x2')](util['format'](_0x50bb('0x57'),_0x578ff3[_0x50bb('0x5')],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x8')],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')],agents[_0x578ff3[_0x50bb('0x5')]]['lastevent']));writeDB(agents[_0x578ff3['uniqueid']]);}}catch(_0x28c99d){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x51'),_0x578ff3[_0x50bb('0x5')]),_0x28c99d);}};
\ No newline at end of file