Built motion from commit da617fac.|2.6.6
[motion2.git] / server / services / xdr / agents.controller.js
index f2cdff5..24e555f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97e7=['CreateVoiceAgentReport','request','uniqueid','destuniqueid','now','called','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','abandoned','agentconnect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheremembername','membername','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','agentcalledAt','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','agent','lodash','util','info','format','channel','queue','interface','connectedlinenum','lastevent','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout'];(function(_0x436c29,_0x4d858d){var _0x5d21ba=function(_0x7d161a){while(--_0x7d161a){_0x436c29['push'](_0x436c29['shift']());}};_0x5d21ba(++_0x4d858d);}(_0x97e7,0x7a));var _0x797e=function(_0x10a532,_0x43857f){_0x10a532=_0x10a532-0x0;var _0x581ab1=_0x97e7[_0x10a532];return _0x581ab1;};'use strict';var _=require(_0x797e('0x0'));var util=require(_0x797e('0x1'));var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x6d250a,_0x4762f3){utils[_0x797e('0x2')](util[_0x797e('0x3')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x6d250a['uniqueid'],_0x6d250a[_0x797e('0x4')],_0x6d250a[_0x797e('0x5')],_0x6d250a['membername'],_0x6d250a[_0x797e('0x6')],_0x6d250a['calleridnum'],_0x6d250a[_0x797e('0x7')],_0x6d250a[_0x797e('0x8')]));if(_0x6d250a[_0x797e('0x5')]){utils['getVoiceQueueByName'](_0x6d250a[_0x797e('0x5')])[_0x797e('0x9')](function(_0x559d02){if(_0x559d02){_0x6d250a[_0x797e('0xa')]=_0x559d02[_0x797e('0xa')];_0x6d250a[_0x797e('0xb')]=_0x6d250a[_0x797e('0xc')]?_0x559d02[_0x797e('0xd')]:![];_0x6d250a[_0x797e('0xe')]=_0x6d250a['agentacw']?_0x559d02[_0x797e('0xf')]:0x0;}utils['request'](_0x797e('0x10'),_0x6d250a);});}else{utils[_0x797e('0x11')](_0x797e('0x10'),_0x6d250a);}if(_0x4762f3){delete transfers[_0x6d250a[_0x797e('0x12')]];}else{delete agents[_0x6d250a['destuniqueid']];}}exports['agentcalled']=function(_0x4ede69){try{agents[_0x4ede69['destuniqueid']]=_0x4ede69;agents[_0x4ede69[_0x797e('0x13')]]['agentcalledAt']=utils[_0x797e('0x14')]();agents[_0x4ede69[_0x797e('0x13')]][_0x797e('0x8')]=_0x797e('0x15');agents[_0x4ede69[_0x797e('0x13')]]['connectedlinenum']=null;agents[_0x4ede69[_0x797e('0x13')]]['connectedlinename']=null;}catch(_0x3f2039){utils[_0x797e('0x16')](_0x3f2039[_0x797e('0x17')]);}};exports[_0x797e('0x18')]=function(_0x2c7922){try{if(!_[_0x797e('0x19')](agents[_0x2c7922[_0x797e('0x13')]])){agents[_0x2c7922['destuniqueid']]['agentringnoanswer']=!![];agents[_0x2c7922[_0x797e('0x13')]][_0x797e('0x1a')]=utils[_0x797e('0x14')]();agents[_0x2c7922['destuniqueid']][_0x797e('0x8')]=_0x797e('0x1b');agents[_0x2c7922[_0x797e('0x13')]][_0x797e('0x1c')]=_0x797e('0x1b');agents[_0x2c7922[_0x797e('0x13')]][_0x797e('0x1d')]=_0x2c7922['ringtime']?parseInt(_0x2c7922[_0x797e('0x1e')])/0x3e8:0x0;agents[_0x2c7922[_0x797e('0x13')]][_0x797e('0x1f')]=0x0;writeDB(agents[_0x2c7922[_0x797e('0x13')]]);}}catch(_0x51b40f){utils[_0x797e('0x16')](_0x51b40f[_0x797e('0x17')]);}};exports[_0x797e('0x20')]=function(_0x341dc6){try{_[_0x797e('0x21')](agents,function(_0x529caf,_0x340ca9){if(_0x529caf[_0x797e('0x12')]==_0x341dc6[_0x797e('0x12')]){_0x529caf['agentringnoanswer']=!![];_0x529caf[_0x797e('0x1a')]=utils[_0x797e('0x14')]();_0x529caf['lastevent']=_0x797e('0x22');_0x529caf[_0x797e('0x1c')]='abandoned';_0x529caf['holdtime']=_0x341dc6[_0x797e('0x1d')];_0x529caf[_0x797e('0x1f')]=0x0;writeDB(_0x529caf);}});}catch(_0x280803){utils[_0x797e('0x16')](_0x280803[_0x797e('0x17')]);}};exports[_0x797e('0x23')]=function(_0x320888){try{if(agents[_0x320888[_0x797e('0x13')]]){agents[_0x320888[_0x797e('0x13')]][_0x797e('0x24')]=utils['now']();agents[_0x320888['destuniqueid']]['connectedlinenum']=_0x320888[_0x797e('0x7')];agents[_0x320888[_0x797e('0x13')]][_0x797e('0x25')]=_0x320888[_0x797e('0x25')];agents[_0x320888[_0x797e('0x13')]]['holdtime']=_0x320888[_0x797e('0x1e')];agents[_0x320888[_0x797e('0x13')]]['lastevent']='connect';_[_0x797e('0x21')](agents,function(_0x3f9b9e,_0x30361b){if(_0x3f9b9e['destuniqueid']!=_0x320888[_0x797e('0x13')]&&_0x3f9b9e[_0x797e('0x12')]==_0x320888[_0x797e('0x12')]){_0x3f9b9e[_0x797e('0x1f')]=0x0;_0x3f9b9e[_0x797e('0x1d')]=_0x320888[_0x797e('0x1e')];_0x3f9b9e[_0x797e('0x18')]=!![];_0x3f9b9e[_0x797e('0x1a')]=utils['now']();_0x3f9b9e[_0x797e('0x8')]=_0x797e('0x26');_0x3f9b9e[_0x797e('0x1c')]=_0x797e('0x26');_0x3f9b9e['answeredelsewheredestinationuniqueid']=_0x320888[_0x797e('0x13')];_0x3f9b9e[_0x797e('0x27')]=_0x320888[_0x797e('0x28')];writeDB(_0x3f9b9e);}});}}catch(_0x277173){utils[_0x797e('0x16')](_0x277173[_0x797e('0x17')]);}};exports[_0x797e('0xc')]=function(_0x2c8334){try{if(!_[_0x797e('0x19')](agents[_0x2c8334[_0x797e('0x13')]])){agents[_0x2c8334[_0x797e('0x13')]][_0x797e('0xc')]=!![];agents[_0x2c8334['destuniqueid']][_0x797e('0x29')]=utils[_0x797e('0x14')]();agents[_0x2c8334[_0x797e('0x13')]]['talktime']=utils[_0x797e('0x2a')](agents[_0x2c8334[_0x797e('0x13')]][_0x797e('0x29')],agents[_0x2c8334['destuniqueid']][_0x797e('0x24')]);agents[_0x2c8334[_0x797e('0x13')]][_0x797e('0x1c')]=_0x2c8334[_0x797e('0x1c')];agents[_0x2c8334[_0x797e('0x13')]][_0x797e('0x8')]=_0x797e('0x2b');writeDB(agents[_0x2c8334['destuniqueid']]);}}catch(_0x24625b){utils[_0x797e('0x16')](_0x24625b[_0x797e('0x17')]);}};exports[_0x797e('0x2c')]=function(_0x265567){try{if(!_[_0x797e('0x19')](agents[_0x265567[_0x797e('0x2d')]])){agents[_0x265567[_0x797e('0x2d')]][_0x797e('0x2e')]=!![];agents[_0x265567[_0x797e('0x2d')]]['transfertype']=_0x797e('0x2f');agents[_0x265567[_0x797e('0x2d')]][_0x797e('0x30')]=_0x265567[_0x797e('0x31')];agents[_0x265567[_0x797e('0x2d')]][_0x797e('0x32')]=agents[_0x265567[_0x797e('0x2d')]][_0x797e('0x12')];}}catch(_0x249850){utils[_0x797e('0x16')](_0x249850[_0x797e('0x17')]);}};exports[_0x797e('0x33')]=function(_0x51ccdc){try{if(_0x51ccdc[_0x797e('0x34')]==_0x51ccdc[_0x797e('0x35')]){if(!_[_0x797e('0x19')](agents[_0x51ccdc['secondtransfereruniqueid']])){agents[_0x51ccdc['secondtransfereruniqueid']]['transfer']=!![];agents[_0x51ccdc[_0x797e('0x36')]][_0x797e('0x37')]=_0x797e('0x38');agents[_0x51ccdc[_0x797e('0x36')]]['transferexten']=_0x51ccdc[_0x797e('0x39')];agents[_0x51ccdc[_0x797e('0x36')]][_0x797e('0x32')]=_0x51ccdc[_0x797e('0x34')];}if(_0x51ccdc[_0x797e('0x3a')]&&agents[_0x51ccdc[_0x797e('0x3a')]]){agents[_0x51ccdc[_0x797e('0x3a')]][_0x797e('0x3b')]=0x1;transfers[_0x51ccdc[_0x797e('0x3a')]]=_[_0x797e('0x3c')](agents[_0x51ccdc[_0x797e('0x3a')]]);transfers[_0x51ccdc[_0x797e('0x3a')]][_0x797e('0x3d')]=agents[_0x51ccdc[_0x797e('0x36')]]['calleridnum'];transfers[_0x51ccdc['transfereeuniqueid']]['calleridname']=agents[_0x51ccdc[_0x797e('0x36')]][_0x797e('0x3e')];transfers[_0x51ccdc[_0x797e('0x3a')]][_0x797e('0x3f')]=utils['now']();transfers[_0x51ccdc[_0x797e('0x3a')]]['agentconnectAt']=utils['now']();transfers[_0x51ccdc['transfereeuniqueid']][_0x797e('0x1d')]=0x0;transfers[_0x51ccdc[_0x797e('0x3a')]][_0x797e('0x3b')]=0x2;}}else if(_0x51ccdc[_0x797e('0x36')]==_0x51ccdc[_0x797e('0x40')]){if(!_['isNil'](agents[_0x51ccdc['origtransfereruniqueid']])){agents[_0x51ccdc[_0x797e('0x34')]][_0x797e('0x2e')]=!![];agents[_0x51ccdc[_0x797e('0x34')]][_0x797e('0x37')]='ATTENDED';agents[_0x51ccdc[_0x797e('0x34')]]['transferexten']=_0x51ccdc[_0x797e('0x41')];agents[_0x51ccdc[_0x797e('0x34')]][_0x797e('0x32')]=_0x51ccdc[_0x797e('0x36')];}if(_0x51ccdc[_0x797e('0x42')]&&agents[_0x51ccdc[_0x797e('0x42')]]){agents[_0x51ccdc[_0x797e('0x42')]][_0x797e('0x3b')]=0x1;transfers[_0x51ccdc[_0x797e('0x42')]]=_[_0x797e('0x3c')](agents[_0x51ccdc[_0x797e('0x42')]]);transfers[_0x51ccdc['transfertargetuniqueid']][_0x797e('0x3d')]=agents[_0x51ccdc[_0x797e('0x34')]][_0x797e('0x3d')];transfers[_0x51ccdc[_0x797e('0x42')]][_0x797e('0x3e')]=agents[_0x51ccdc[_0x797e('0x34')]][_0x797e('0x3e')];transfers[_0x51ccdc['transfertargetuniqueid']][_0x797e('0x3f')]=utils[_0x797e('0x14')]();transfers[_0x51ccdc[_0x797e('0x42')]][_0x797e('0x24')]=utils['now']();transfers[_0x51ccdc[_0x797e('0x42')]][_0x797e('0x1d')]=0x0;transfers[_0x51ccdc[_0x797e('0x42')]]['agententerreason']=0x2;}}}catch(_0x5413b8){utils[_0x797e('0x16')](_0x5413b8[_0x797e('0x17')]);}};exports[_0x797e('0x43')]=function(_0x120ae7){try{if(transfers[_0x120ae7[_0x797e('0x12')]]){transfers[_0x120ae7[_0x797e('0x12')]]['agentcomplete']=!![];transfers[_0x120ae7[_0x797e('0x12')]][_0x797e('0x29')]=utils[_0x797e('0x14')]();transfers[_0x120ae7[_0x797e('0x12')]][_0x797e('0x1f')]=utils[_0x797e('0x2a')](transfers[_0x120ae7['uniqueid']][_0x797e('0x29')],transfers[_0x120ae7[_0x797e('0x12')]]['agentconnectAt']);transfers[_0x120ae7['uniqueid']][_0x797e('0x1c')]=_0x797e('0x44');transfers[_0x120ae7[_0x797e('0x12')]][_0x797e('0x8')]=_0x797e('0x2b');writeDB(transfers[_0x120ae7[_0x797e('0x12')]],!![]);}if(agents[_0x120ae7[_0x797e('0x12')]]&&agents[_0x120ae7[_0x797e('0x12')]][_0x797e('0x24')]){agents[_0x120ae7[_0x797e('0x12')]][_0x797e('0xc')]=!![];agents[_0x120ae7[_0x797e('0x12')]][_0x797e('0x29')]=utils[_0x797e('0x14')]();agents[_0x120ae7['uniqueid']]['talktime']=utils['diffTime'](agents[_0x120ae7[_0x797e('0x12')]][_0x797e('0x29')],agents[_0x120ae7[_0x797e('0x12')]][_0x797e('0x24')]);agents[_0x120ae7['uniqueid']]['reason']=agents[_0x120ae7[_0x797e('0x12')]][_0x797e('0x2e')]?_0x797e('0x2e'):_0x797e('0x44');agents[_0x120ae7['uniqueid']][_0x797e('0x8')]=_0x797e('0x2b');writeDB(agents[_0x120ae7[_0x797e('0x12')]]);}}catch(_0x37c0a9){utils['error'](_0x37c0a9[_0x797e('0x17')]);}};
\ No newline at end of file
+var _0x3f8c=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','[%s][agents][hangup]','./utils','info','membername','interface','calleridnum','connectedlinenum','lastevent','queue','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','debug','format','[%s][agents][agentcalled]','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','isNil','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','cause','rejected','indexOf','splice','agent'];(function(_0x170add,_0x206e45){var _0x1249f1=function(_0x3dc950){while(--_0x3dc950){_0x170add['push'](_0x170add['shift']());}};_0x1249f1(++_0x206e45);}(_0x3f8c,0x104));var _0xc3f8=function(_0x372ad1,_0x404682){_0x372ad1=_0x372ad1-0x0;var _0x26982c=_0x3f8c[_0x372ad1];return _0x26982c;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xc3f8('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3a1f6a,_0x2e70c4){utils[_0xc3f8('0x1')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3a1f6a['uniqueid'],_0x3a1f6a['channel'],_0x3a1f6a['queue'],_0x3a1f6a[_0xc3f8('0x2')],_0x3a1f6a[_0xc3f8('0x3')],_0x3a1f6a[_0xc3f8('0x4')],_0x3a1f6a[_0xc3f8('0x5')],_0x3a1f6a[_0xc3f8('0x6')]));if(_0x3a1f6a[_0xc3f8('0x7')]){utils['getVoiceQueueByName'](_0x3a1f6a[_0xc3f8('0x7')])[_0xc3f8('0x8')](function(_0x15cb3b){if(_0x15cb3b){_0x3a1f6a[_0xc3f8('0x9')]=_0x15cb3b[_0xc3f8('0x9')];_0x3a1f6a[_0xc3f8('0xa')]=_0x3a1f6a[_0xc3f8('0xb')]?_0x15cb3b['acw']:![];_0x3a1f6a[_0xc3f8('0xc')]=_0x3a1f6a[_0xc3f8('0xa')]?_0x15cb3b[_0xc3f8('0xd')]:0x0;}utils[_0xc3f8('0xe')]('CreateVoiceAgentReport',_0x3a1f6a);});}else{utils[_0xc3f8('0xe')](_0xc3f8('0xf'),_0x3a1f6a);}if(_0x2e70c4){delete transfers[_0x3a1f6a[_0xc3f8('0x10')]];}else{delete agents[_0x3a1f6a[_0xc3f8('0x11')]];}}exports['agentcalled']=function(_0x84f489){try{utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x14'),_0x84f489[_0xc3f8('0x10')]),_0x84f489);agents[_0x84f489[_0xc3f8('0x11')]]=_0x84f489;agents[_0x84f489[_0xc3f8('0x11')]][_0xc3f8('0x15')]=utils[_0xc3f8('0x16')]();agents[_0x84f489[_0xc3f8('0x11')]][_0xc3f8('0x6')]=_0xc3f8('0x17');agents[_0x84f489[_0xc3f8('0x11')]]['connectedlinenum']=null;agents[_0x84f489[_0xc3f8('0x11')]]['connectedlinename']=null;utils['info'](util[_0xc3f8('0x13')](_0xc3f8('0x18'),_0x84f489[_0xc3f8('0x10')],agents[_0x84f489[_0xc3f8('0x11')]]['membername'],_0x84f489[_0xc3f8('0x11')]));}catch(_0x1db809){utils['error'](util[_0xc3f8('0x13')]('[%s][agents][agentcalled]',_0x84f489[_0xc3f8('0x10')]),_0x1db809);}};exports[_0xc3f8('0x19')]=function(_0x3b2e98){try{if(!_['isNil'](agents[_0x3b2e98['destuniqueid']])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x1a'),_0x3b2e98[_0xc3f8('0x10')]),_0x3b2e98);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x1b'),_0x3b2e98[_0xc3f8('0x10')],agents[_0x3b2e98['destuniqueid']]['membername'],_0x3b2e98['destuniqueid']));agents[_0x3b2e98[_0xc3f8('0x11')]]['agentringnoanswer']=!![];agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1c')]=utils['now']();agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x6')]=_0xc3f8('0x1d');agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1e')]=_0xc3f8('0x1d');agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1f')]=_0x3b2e98[_0xc3f8('0x20')]?parseInt(_0x3b2e98[_0xc3f8('0x20')])/0x3e8:0x0;agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x21')]=0x0;unanswered[_0xc3f8('0x22')](_0x3b2e98[_0xc3f8('0x11')]);}}catch(_0x59e4dd){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x1a'),_0x3b2e98['uniqueid']),_0x59e4dd);}};exports[_0xc3f8('0x24')]=function(_0x4d39a0){try{_[_0xc3f8('0x25')](agents,function(_0x32343e,_0x47ab53){if(_0x32343e['uniqueid']==_0x4d39a0[_0xc3f8('0x10')]&&!_[_0xc3f8('0x26')](unanswered,_0x32343e[_0xc3f8('0x11')])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x27'),_0x4d39a0[_0xc3f8('0x10')]),_0x4d39a0);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x28'),_0x4d39a0['uniqueid'],_0x32343e[_0xc3f8('0x2')],_0x32343e[_0xc3f8('0x11')]));_0x32343e[_0xc3f8('0x19')]=!![];_0x32343e[_0xc3f8('0x1c')]=utils[_0xc3f8('0x16')]();_0x32343e['lastevent']='abandoned';_0x32343e[_0xc3f8('0x1e')]=_0xc3f8('0x29');_0x32343e[_0xc3f8('0x1f')]=_0x4d39a0[_0xc3f8('0x1f')];_0x32343e[_0xc3f8('0x21')]=0x0;writeDB(_0x32343e);}});}catch(_0x4e51ac){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x27'),_0x4d39a0['uniqueid']),_0x4e51ac);}};exports[_0xc3f8('0x2a')]=function(_0x11ecc2){try{if(agents[_0x11ecc2[_0xc3f8('0x11')]]){utils['debug'](util[_0xc3f8('0x13')](_0xc3f8('0x2b'),_0x11ecc2['uniqueid']),_0x11ecc2);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x2c'),_0x11ecc2[_0xc3f8('0x10')],agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2')],_0x11ecc2['destuniqueid']));agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2d')]=utils[_0xc3f8('0x16')]();agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x5')]=_0x11ecc2['connectedlinenum'];agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2e')]=_0x11ecc2[_0xc3f8('0x2e')];agents[_0x11ecc2['destuniqueid']][_0xc3f8('0x1f')]=_0x11ecc2[_0xc3f8('0x20')];agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x6')]='connect';_[_0xc3f8('0x25')](agents,function(_0x45d416,_0x2df096){if(_0x45d416[_0xc3f8('0x11')]!=_0x11ecc2['destuniqueid']&&_0x45d416[_0xc3f8('0x10')]==_0x11ecc2['uniqueid']){_0x45d416['talktime']=0x0;_0x45d416[_0xc3f8('0x1f')]=_0x11ecc2[_0xc3f8('0x20')];_0x45d416[_0xc3f8('0x19')]=!![];_0x45d416[_0xc3f8('0x1c')]=utils['now']();_0x45d416['lastevent']=_0xc3f8('0x2f');_0x45d416[_0xc3f8('0x1e')]=_0xc3f8('0x2f');_0x45d416[_0xc3f8('0x30')]=_0x11ecc2[_0xc3f8('0x11')];_0x45d416[_0xc3f8('0x31')]=_0x11ecc2[_0xc3f8('0x2')];writeDB(_0x45d416);}});}}catch(_0x45e6ea){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x2b'),_0x11ecc2['uniqueid']),_0x45e6ea);}};exports[_0xc3f8('0xb')]=function(_0x22e9b3){try{if(!_['isNil'](agents[_0x22e9b3[_0xc3f8('0x11')]])){utils[_0xc3f8('0x12')](util['format'](_0xc3f8('0x32'),_0x22e9b3[_0xc3f8('0x10')]),_0x22e9b3);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x33'),_0x22e9b3[_0xc3f8('0x10')],agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x2')],_0x22e9b3[_0xc3f8('0x11')]));agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0xb')]=!![];agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x34')]=utils[_0xc3f8('0x16')]();agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x21')]=utils[_0xc3f8('0x35')](agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x34')],agents[_0x22e9b3['destuniqueid']]['agentconnectAt']);agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x1e')]=_0x22e9b3[_0xc3f8('0x1e')];agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x6')]=_0xc3f8('0x36');writeDB(agents[_0x22e9b3[_0xc3f8('0x11')]]);}}catch(_0xe3d5c4){utils[_0xc3f8('0x23')](util['format'](_0xc3f8('0x32'),_0x22e9b3[_0xc3f8('0x10')]),_0xe3d5c4);}};exports['blindtransfer']=function(_0x1becae){try{if(!_[_0xc3f8('0x37')](agents[_0x1becae[_0xc3f8('0x38')]])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x39'),_0x1becae[_0xc3f8('0x10')]),_0x1becae);utils['info'](util[_0xc3f8('0x13')](_0xc3f8('0x3a'),_0x1becae['uniqueid'],agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x2')],agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x10')]));agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3b')]=!![];agents[_0x1becae[_0xc3f8('0x38')]]['transfertype']=_0xc3f8('0x3c');agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3d')]=_0x1becae[_0xc3f8('0x3e')];agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3f')]=agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x10')];}}catch(_0x4fc02c){utils['error'](util[_0xc3f8('0x13')](_0xc3f8('0x39'),_0x1becae['uniqueid']),_0x4fc02c);}};exports['attendedtransfer']=function(_0x773d56){try{utils['debug'](util[_0xc3f8('0x13')](_0xc3f8('0x40'),_0x773d56[_0xc3f8('0x41')]),_0x773d56);if(_0x773d56['origtransfereruniqueid']==_0x773d56[_0xc3f8('0x42')]){if(!_['isNil'](agents[_0x773d56['secondtransfereruniqueid']])){utils[_0xc3f8('0x1')](util['format'](_0xc3f8('0x43'),_0x773d56[_0xc3f8('0x41')],agents[_0x773d56[_0xc3f8('0x44')]]['membername']));agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x3b')]=!![];agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x45')]=_0xc3f8('0x46');agents[_0x773d56['secondtransfereruniqueid']]['transferexten']=_0x773d56[_0xc3f8('0x47')];agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x3f')]=_0x773d56[_0xc3f8('0x41')];}if(_0x773d56[_0xc3f8('0x48')]&&agents[_0x773d56['transfereeuniqueid']]){agents[_0x773d56[_0xc3f8('0x48')]]['agententerreason']=0x1;transfers[_0x773d56[_0xc3f8('0x48')]]=_[_0xc3f8('0x49')](agents[_0x773d56[_0xc3f8('0x48')]]);transfers[_0x773d56[_0xc3f8('0x48')]]['calleridnum']=agents[_0x773d56[_0xc3f8('0x44')]]['calleridnum'];transfers[_0x773d56['transfereeuniqueid']]['calleridname']=agents[_0x773d56['secondtransfereruniqueid']][_0xc3f8('0x4a')];transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x15')]=utils[_0xc3f8('0x16')]();transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x2d')]=utils[_0xc3f8('0x16')]();transfers[_0x773d56[_0xc3f8('0x48')]]['holdtime']=0x0;transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x4b')]=0x2;}}else if(_0x773d56[_0xc3f8('0x44')]==_0x773d56[_0xc3f8('0x4c')]){if(!_[_0xc3f8('0x37')](agents[_0x773d56['origtransfereruniqueid']])){utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x43'),_0x773d56[_0xc3f8('0x41')],agents[_0x773d56[_0xc3f8('0x41')]]['membername']));agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x3b')]=!![];agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x45')]=_0xc3f8('0x46');agents[_0x773d56[_0xc3f8('0x41')]]['transferexten']=_0x773d56[_0xc3f8('0x4d')];agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x3f')]=_0x773d56['secondtransfereruniqueid'];}if(_0x773d56[_0xc3f8('0x4e')]&&agents[_0x773d56[_0xc3f8('0x4e')]]){agents[_0x773d56['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x773d56[_0xc3f8('0x4e')]]=_[_0xc3f8('0x49')](agents[_0x773d56['transfertargetuniqueid']]);transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4')]=agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x4')];transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4a')]=agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x4a')];transfers[_0x773d56['transfertargetuniqueid']]['agentcalledAt']=utils[_0xc3f8('0x16')]();transfers[_0x773d56['transfertargetuniqueid']]['agentconnectAt']=utils['now']();transfers[_0x773d56['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4b')]=0x2;}}}catch(_0x188d39){utils[_0xc3f8('0x23')](util['format'](_0xc3f8('0x40'),_0x773d56[_0xc3f8('0x41')]),_0x188d39);}};exports['hangup']=function(_0x3b9b47){try{utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')]('[%s][agents][hangup]',_0x3b9b47[_0xc3f8('0x10')]),_0x3b9b47);if(agents[_0x3b9b47['uniqueid']]&&agents[_0x3b9b47['uniqueid']]['reason']===_0xc3f8('0x1d')){if(_0x3b9b47[_0xc3f8('0x4f')]==='21'){agents[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')]=_0xc3f8('0x50');agents[_0x3b9b47['uniqueid']][_0xc3f8('0x6')]=_0xc3f8('0x50');}utils['info'](util[_0xc3f8('0x13')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3b9b47[_0xc3f8('0x10')],agents[_0x3b9b47[_0xc3f8('0x10')]]['membername'],agents[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')],agents[_0x3b9b47[_0xc3f8('0x10')]]['lastevent']));writeDB(agents[_0x3b9b47[_0xc3f8('0x10')]]);var _0x5de19e=unanswered[_0xc3f8('0x51')](_0x3b9b47['uniqueid']);if(_0x5de19e>-0x1){unanswered[_0xc3f8('0x52')](_0x5de19e,0x1);}}if(transfers[_0x3b9b47[_0xc3f8('0x10')]]){transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0xb')]=!![];transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')]=utils[_0xc3f8('0x16')]();transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x21')]=utils['diffTime'](transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')],transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x2d')]);transfers[_0x3b9b47[_0xc3f8('0x10')]]['reason']=_0xc3f8('0x53');transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]=_0xc3f8('0x36');utils[_0xc3f8('0x1')](util['format'](_0xc3f8('0x54'),_0x3b9b47[_0xc3f8('0x10')],transfers[_0x3b9b47[_0xc3f8('0x10')]]['membername'],transfers[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')],transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]));writeDB(transfers[_0x3b9b47[_0xc3f8('0x10')]],!![]);}if(agents[_0x3b9b47['uniqueid']]&&agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x2d')]){agents[_0x3b9b47[_0xc3f8('0x10')]]['agentcomplete']=!![];agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')]=utils['now']();agents[_0x3b9b47['uniqueid']][_0xc3f8('0x21')]=utils[_0xc3f8('0x35')](agents[_0x3b9b47['uniqueid']][_0xc3f8('0x34')],agents[_0x3b9b47[_0xc3f8('0x10')]]['agentconnectAt']);agents[_0x3b9b47[_0xc3f8('0x10')]]['reason']=agents[_0x3b9b47[_0xc3f8('0x10')]]['transfer']?_0xc3f8('0x3b'):_0xc3f8('0x53');agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]=_0xc3f8('0x36');utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x54'),_0x3b9b47[_0xc3f8('0x10')],agents[_0x3b9b47['uniqueid']]['membername'],agents[_0x3b9b47[_0xc3f8('0x10')]]['reason'],agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]));writeDB(agents[_0x3b9b47[_0xc3f8('0x10')]]);}}catch(_0xfb05eb){utils['error'](util[_0xc3f8('0x13')](_0xc3f8('0x55'),_0x3b9b47[_0xc3f8('0x10')]),_0xfb05eb);}};
\ No newline at end of file