Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / services / ami / report / voiceAgentReport.js
index da8386e..5738737 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6763=['isNotNull','isUndefined','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','event','privilege','emit','custom:agentcalled','format','user:%s','membername','[syncAgentCalled][VoiceAgentReport]','inspect','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','error','[syncAgentRingNoAnswer][VoiceAgentReport]','hasOwnProperty','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','syncAgentComplete','complete','talktime','transfer','agent','acw','agentacw','acwTimeout','interface','omit','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','custom:voiceAgentReport','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','agentcompleteAt','secondtransfereruniqueid','diff','seconds','[syncBlindTransfer][VoiceAgentReport]','syncMusicOnHoldStart','channel','lastIndexOf','onhold','substring','moment','ioredis','../ami','redis','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','syncAgentConnect','bind','agentringnoanswer','syncQueueCallerAbandon','agentcomplete','varset','syncVarSet','hangup','syncHangup','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype'];(function(_0x3b3127,_0x51cdc5){var _0x19c58f=function(_0x4653f8){while(--_0x4653f8){_0x3b3127['push'](_0x3b3127['shift']());}};_0x19c58f(++_0x51cdc5);}(_0x6763,0xd6));var _0x3676=function(_0x3145af,_0x53a1d5){_0x3145af=_0x3145af-0x0;var _0x37758a=_0x6763[_0x3145af];return _0x37758a;};'use strict';var _=require('lodash');var moment=require(_0x3676('0x0'));var util=require('util');var Redis=require(_0x3676('0x1'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0x3676('0x2'));config[_0x3676('0x3')]=_['defaults'](config[_0x3676('0x3')],{'host':_0x3676('0x4'),'port':0x18eb});var io=require(_0x3676('0x5'))(new Redis(config[_0x3676('0x3')]));function VoiceAgentReport(_0x5f3441){this[_0x3676('0x6')]={};this[_0x3676('0x7')]=_0x5f3441[_0x3676('0x7')];this[_0x3676('0x8')]=_0x5f3441[_0x3676('0x8')];this[_0x3676('0x9')]={};ami['on'](_0x3676('0xa'),this[_0x3676('0xb')]['bind'](this));ami['on']('agentconnect',this[_0x3676('0xc')][_0x3676('0xd')](this));ami['on'](_0x3676('0xe'),this['syncAgentRingNoAnswer'][_0x3676('0xd')](this));ami['on']('queuecallerabandon',this[_0x3676('0xf')][_0x3676('0xd')](this));ami['on'](_0x3676('0x10'),this['syncAgentComplete'][_0x3676('0xd')](this));ami['on'](_0x3676('0x11'),this[_0x3676('0x12')][_0x3676('0xd')](this));ami['on'](_0x3676('0x13'),this[_0x3676('0x14')][_0x3676('0xd')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x3676('0xd')](this));ami['on'](_0x3676('0x15'),this[_0x3676('0x16')][_0x3676('0xd')](this));ami['on'](_0x3676('0x17'),this[_0x3676('0x18')][_0x3676('0xd')](this));ami['on'](_0x3676('0x19'),this[_0x3676('0x1a')][_0x3676('0xd')](this));}VoiceAgentReport[_0x3676('0x1b')]['emit']=function(_0x4a6cd7,_0x4cb9dd,_0x4375f5){io['to'](_0x4a6cd7)['emit'](_0x4cb9dd,_0x4375f5);};VoiceAgentReport[_0x3676('0x1b')][_0x3676('0x1c')]=function(_0x1f7cb1){return _0x1f7cb1!==null&&!_[_0x3676('0x1d')](_0x1f7cb1);};VoiceAgentReport['prototype']['syncAgentCalled']=function(_0x44bfce){try{if(this[_0x3676('0x1c')](_0x44bfce)){if(_[_0x3676('0x1d')](this[_0x3676('0x6')][_0x44bfce['uniqueid']])){this[_0x3676('0x6')][_0x44bfce[_0x3676('0x1e')]]={};}if(_[_0x3676('0x1d')](this[_0x3676('0x6')][_0x44bfce[_0x3676('0x1e')]][_0x44bfce[_0x3676('0x1f')]])){this[_0x3676('0x6')][_0x44bfce[_0x3676('0x1e')]][_0x44bfce[_0x3676('0x1f')]]={'agentcalledAt':moment()['format'](_0x3676('0x20')),'lastevent':'called','variables':this['variables'][_0x44bfce[_0x3676('0x1e')]],'type':this[_0x3676('0x7')][_0x44bfce[_0x3676('0x21')]]?this['voiceQueues'][_0x44bfce['queue']][_0x3676('0x22')]||_0x3676('0x23'):_0x3676('0x23')};}_['merge'](this[_0x3676('0x6')][_0x44bfce[_0x3676('0x1e')]][_0x44bfce[_0x3676('0x1f')]],_['omit'](_0x44bfce,[_0x3676('0x24'),_0x3676('0x25')]));ami[_0x3676('0x26')](_0x3676('0x27'),this['channels'][_0x44bfce[_0x3676('0x1e')]][_0x44bfce['destuniqueid']]);this[_0x3676('0x26')](util[_0x3676('0x28')](_0x3676('0x29'),_0x44bfce[_0x3676('0x2a')]),'user:called',this[_0x3676('0x6')][_0x44bfce[_0x3676('0x1e')]][_0x44bfce[_0x3676('0x1f')]]);}}catch(_0x52c34e){logger['error'](_0x3676('0x2b'),util[_0x3676('0x2c')](_0x52c34e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3676('0x1b')]['syncAgentConnect']=function(_0x5b2c21){try{if(this[_0x3676('0x1c')](_0x5b2c21)){if(this['channels'][_0x5b2c21['uniqueid']]){for(var _0xf0f5ab in this['channels'][_0x5b2c21[_0x3676('0x1e')]]){if(this[_0x3676('0x6')][_0x5b2c21[_0x3676('0x1e')]]['hasOwnProperty'](_0xf0f5ab)){if(_0x5b2c21[_0x3676('0x1f')]===_0xf0f5ab){this[_0x3676('0x6')][_0x5b2c21['uniqueid']][_0xf0f5ab][_0x3676('0x2d')]=moment()['format'](_0x3676('0x20'));this['channels'][_0x5b2c21[_0x3676('0x1e')]][_0xf0f5ab][_0x3676('0x2e')]=_0x3676('0x2f');this[_0x3676('0x6')][_0x5b2c21['uniqueid']][_0xf0f5ab][_0x3676('0x30')]=_0x5b2c21[_0x3676('0x30')];this[_0x3676('0x6')][_0x5b2c21[_0x3676('0x1e')]][_0xf0f5ab][_0x3676('0x31')]=_0x5b2c21[_0x3676('0x31')];this[_0x3676('0x6')][_0x5b2c21['uniqueid']][_0xf0f5ab][_0x3676('0x32')]=_0x5b2c21[_0x3676('0x32')];this[_0x3676('0x6')][_0x5b2c21['uniqueid']][_0xf0f5ab][_0x3676('0x33')]=_0x5b2c21[_0x3676('0x33')];this[_0x3676('0x6')][_0x5b2c21[_0x3676('0x1e')]][_0xf0f5ab][_0x3676('0x34')]=_0x5b2c21[_0x3676('0x34')];_[_0x3676('0x35')](this[_0x3676('0x8')][_0x5b2c21['interface']],_[_0x3676('0x36')](_0x5b2c21,[_0x3676('0x21'),_0x3676('0x37')]));this['emit'](util[_0x3676('0x28')](_0x3676('0x29'),_0x5b2c21[_0x3676('0x2a')]),_0x3676('0x38'),this[_0x3676('0x6')][_0x5b2c21[_0x3676('0x1e')]][_0x5b2c21[_0x3676('0x1f')]]);ami['emit'](_0x3676('0x39'),this[_0x3676('0x6')][_0x5b2c21[_0x3676('0x1e')]][_0xf0f5ab]);}else if(!this[_0x3676('0x6')][_0x5b2c21['uniqueid']][_0xf0f5ab][_0x3676('0xe')]&&!this[_0x3676('0x6')][_0x5b2c21[_0x3676('0x1e')]][_0xf0f5ab][_0x3676('0x10')]){this[_0x3676('0x6')][_0x5b2c21[_0x3676('0x1e')]][_0xf0f5ab]['agentringnoanswer']=!![];this['channels'][_0x5b2c21[_0x3676('0x1e')]][_0xf0f5ab][_0x3676('0x3a')]=moment()['format'](_0x3676('0x20'));this['channels'][_0x5b2c21[_0x3676('0x1e')]][_0xf0f5ab][_0x3676('0x3b')]='answered_elsewhere';this['channels'][_0x5b2c21[_0x3676('0x1e')]][_0xf0f5ab][_0x3676('0x2e')]=_0x3676('0x3c');this['channels'][_0x5b2c21[_0x3676('0x1e')]][_0xf0f5ab]['answeredelsewheredestinationuniqueid']=_0x5b2c21[_0x3676('0x1f')];this['channels'][_0x5b2c21['uniqueid']][_0xf0f5ab]['answeredelsewheremembername']=_0x5b2c21[_0x3676('0x2a')];ami[_0x3676('0x26')](_0x3676('0x3d'),this[_0x3676('0x6')][_0x5b2c21[_0x3676('0x1e')]][_0xf0f5ab]);}}}}}}catch(_0x11c283){logger['error'](_0x3676('0x3e'),util[_0x3676('0x2c')](_0x11c283,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3676('0x1b')]['syncAgentRingNoAnswer']=function(_0x23e9ec){try{if(this[_0x3676('0x1c')](_0x23e9ec)){if(this['channels'][_0x23e9ec[_0x3676('0x1e')]]&&this[_0x3676('0x6')][_0x23e9ec[_0x3676('0x1e')]][_0x23e9ec['destuniqueid']]){this['channels'][_0x23e9ec[_0x3676('0x1e')]][_0x23e9ec[_0x3676('0x1f')]][_0x3676('0xe')]=!![];this[_0x3676('0x6')][_0x23e9ec[_0x3676('0x1e')]][_0x23e9ec['destuniqueid']][_0x3676('0x3a')]=moment()[_0x3676('0x28')](_0x3676('0x20'));this[_0x3676('0x6')][_0x23e9ec['uniqueid']][_0x23e9ec[_0x3676('0x1f')]][_0x3676('0x3b')]=_0x3676('0x3f');this['channels'][_0x23e9ec[_0x3676('0x1e')]][_0x23e9ec[_0x3676('0x1f')]][_0x3676('0x2e')]='rejected';ami[_0x3676('0x26')](_0x3676('0x40'),this[_0x3676('0x6')][_0x23e9ec[_0x3676('0x1e')]][_0x23e9ec[_0x3676('0x1f')]]);}}}catch(_0x115ffb){logger[_0x3676('0x41')](_0x3676('0x42'),util[_0x3676('0x2c')](_0x115ffb,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3676('0xf')]=function(_0x22328e){try{if(this[_0x3676('0x1c')](_0x22328e)){if(this[_0x3676('0x6')][_0x22328e[_0x3676('0x1e')]]){for(var _0x39de92 in this[_0x3676('0x6')][_0x22328e['uniqueid']]){if(this['channels'][_0x22328e[_0x3676('0x1e')]][_0x3676('0x43')](_0x39de92)&&!this['channels'][_0x22328e['uniqueid']][_0x39de92][_0x3676('0xe')]&&!this[_0x3676('0x6')][_0x22328e[_0x3676('0x1e')]][_0x39de92][_0x3676('0x10')]){this[_0x3676('0x6')][_0x22328e[_0x3676('0x1e')]][_0x39de92]['agentringnoanswer']=!![];this[_0x3676('0x6')][_0x22328e[_0x3676('0x1e')]][_0x39de92][_0x3676('0x3a')]=moment()[_0x3676('0x28')](_0x3676('0x20'));this['channels'][_0x22328e['uniqueid']][_0x39de92][_0x3676('0x3b')]=_0x3676('0x44');this['channels'][_0x22328e[_0x3676('0x1e')]][_0x39de92][_0x3676('0x2e')]=_0x3676('0x44');ami[_0x3676('0x26')](_0x3676('0x45'),this[_0x3676('0x6')][_0x22328e[_0x3676('0x1e')]][_0x39de92]);}}}}}catch(_0x5dc9b0){logger[_0x3676('0x41')](_0x3676('0x46'),util['inspect'](_0x5dc9b0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3676('0x1b')][_0x3676('0x47')]=function(_0x4c676d){try{if(this[_0x3676('0x1c')](_0x4c676d)){if(this[_0x3676('0x6')][_0x4c676d['uniqueid']]){for(var _0x5438c8 in this[_0x3676('0x6')][_0x4c676d['uniqueid']]){if(this[_0x3676('0x6')][_0x4c676d[_0x3676('0x1e')]]['hasOwnProperty'](_0x5438c8)){if(this[_0x3676('0x6')][_0x4c676d[_0x3676('0x1e')]][_0x5438c8][_0x3676('0x2d')]&&!this[_0x3676('0x6')][_0x4c676d[_0x3676('0x1e')]][_0x5438c8][_0x3676('0x10')]){this['channels'][_0x4c676d[_0x3676('0x1e')]][_0x5438c8][_0x3676('0x10')]=!![];this[_0x3676('0x6')][_0x4c676d[_0x3676('0x1e')]][_0x5438c8]['agentcompleteAt']=moment()[_0x3676('0x28')](_0x3676('0x20'));this['channels'][_0x4c676d[_0x3676('0x1e')]][_0x5438c8][_0x3676('0x2e')]=_0x3676('0x48');this['channels'][_0x4c676d[_0x3676('0x1e')]][_0x5438c8][_0x3676('0x49')]=_0x4c676d['talktime'];this[_0x3676('0x6')][_0x4c676d['uniqueid']][_0x5438c8][_0x3676('0x3b')]=_0x4c676d[_0x3676('0x3b')]==_0x3676('0x4a')?_0x3676('0x4b'):_0x4c676d['reason'];if(this['voiceQueues'][_0x4c676d[_0x3676('0x21')]]&&this[_0x3676('0x7')][_0x4c676d['queue']][_0x3676('0x4c')]){this[_0x3676('0x6')][_0x4c676d['uniqueid']][_0x5438c8][_0x3676('0x4d')]=!![];this[_0x3676('0x6')][_0x4c676d['uniqueid']][_0x5438c8]['acwtime']=this[_0x3676('0x7')][_0x4c676d['queue']][_0x3676('0x4e')];}this[_0x3676('0x8')][_0x4c676d[_0x3676('0x4f')]]=_[_0x3676('0x50')](this[_0x3676('0x8')][_0x4c676d['interface']],[_0x3676('0x21'),'destconnectedlinenum']);this['emit'](util['format'](_0x3676('0x29'),_0x4c676d[_0x3676('0x2a')]),_0x3676('0x51'),this['channels'][_0x4c676d[_0x3676('0x1e')]][_0x5438c8]);ami['emit'](_0x3676('0x52'),this[_0x3676('0x6')][_0x4c676d[_0x3676('0x1e')]][_0x5438c8]);}}}}}}catch(_0x1976e7){logger[_0x3676('0x41')](_0x3676('0x53'),util['inspect'](_0x1976e7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3676('0x12')]=function(_0x1c327b){try{if(this[_0x3676('0x1c')](_0x1c327b)){this[_0x3676('0x54')](_0x1c327b['uniqueid'],_[_0x3676('0x55')](_0x1c327b[_0x3676('0x56')])[0x0],_0x1c327b[_0x3676('0x57')]);if(this[_0x3676('0x6')][_0x1c327b[_0x3676('0x1e')]]){for(var _0x113673 in this[_0x3676('0x6')][_0x1c327b['uniqueid']]){if(this[_0x3676('0x6')][_0x1c327b[_0x3676('0x1e')]][_0x3676('0x43')](_0x113673)){if(_['isUndefined'](this['channels'][_0x1c327b['uniqueid']][_0x113673][_0x3676('0x9')])){this['channels'][_0x1c327b[_0x3676('0x1e')]][_0x113673][_0x3676('0x9')]={};}this[_0x3676('0x6')][_0x1c327b['uniqueid']][_0x113673][_0x3676('0x9')]=this[_0x3676('0x9')][_0x1c327b[_0x3676('0x1e')]];}}}}}catch(_0x2cdd3b){logger[_0x3676('0x41')](_0x3676('0x58'),util[_0x3676('0x2c')](_0x2cdd3b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3676('0x1b')][_0x3676('0x54')]=function(_0x1dff9b,_0x4d434a,_0x19f95e){var _0x3eef41=[_0x3676('0x59'),_0x3676('0x5a'),_0x3676('0x5b'),_0x3676('0x5c'),_0x3676('0x5d'),'rtpaudioqoslossbridged',_0x3676('0x5e'),_0x3676('0x5f'),_0x3676('0x60'),_0x3676('0x61'),_0x3676('0x62'),_0x3676('0x63'),_0x3676('0x64'),'memberdynamic',_0x3676('0x65'),_0x3676('0x66'),_0x3676('0x2a'),_0x3676('0x67'),_0x3676('0x68')];if(!_[_0x3676('0x69')](_0x4d434a)&&!_[_0x3676('0x6a')](_0x3eef41,_0x4d434a)){if(_[_0x3676('0x1d')](this[_0x3676('0x9')][_0x1dff9b])){this[_0x3676('0x9')][_0x1dff9b]={};}this['variables'][_0x1dff9b][_0x4d434a]=_0x19f95e;}};VoiceAgentReport[_0x3676('0x1b')][_0x3676('0x14')]=function(_0x56bfd8){try{if(this[_0x3676('0x1c')](_0x56bfd8)){if(this[_0x3676('0x6')][_0x56bfd8[_0x3676('0x1e')]]){for(var _0x2530be in this[_0x3676('0x6')][_0x56bfd8[_0x3676('0x1e')]]){if(this['channels'][_0x56bfd8[_0x3676('0x1e')]][_0x3676('0x43')](_0x2530be)){if(this['channels'][_0x56bfd8[_0x3676('0x1e')]][_0x2530be][_0x3676('0x3b')]==_0x3676('0x4a')&&this['channels'][_0x56bfd8[_0x3676('0x1e')]][_0x2530be][_0x3676('0x10')]){this['channels'][_0x56bfd8[_0x3676('0x1e')]][_0x2530be]['agentcompleteAt']=moment()[_0x3676('0x28')](_0x3676('0x20'));}}}ami[_0x3676('0x26')](_0x3676('0x6b'),_['values'](this[_0x3676('0x6')][_0x56bfd8['uniqueid']]));delete this[_0x3676('0x6')][_0x56bfd8[_0x3676('0x1e')]];}if(this[_0x3676('0x9')][_0x56bfd8['uniqueid']]){delete this[_0x3676('0x9')][_0x56bfd8['uniqueid']];}}}catch(_0x5e3243){logger['error'](_0x3676('0x6c'),util[_0x3676('0x2c')](_0x5e3243,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3676('0x1b')][_0x3676('0x18')]=function(_0x2d6a1c){try{if(this['isNotNull'](_0x2d6a1c)){if(this[_0x3676('0x6')][_0x2d6a1c[_0x3676('0x6d')]]){for(var _0x4e5ffd in this[_0x3676('0x6')][_0x2d6a1c[_0x3676('0x6d')]]){if(this[_0x3676('0x6')][_0x2d6a1c[_0x3676('0x6d')]][_0x3676('0x43')](_0x4e5ffd)){if(_0x2d6a1c[_0x3676('0x6e')]===_0x4e5ffd){var _0x5c1e64=moment();this[_0x3676('0x6')][_0x2d6a1c[_0x3676('0x6d')]][_0x4e5ffd][_0x3676('0x10')]=!![];this['channels'][_0x2d6a1c[_0x3676('0x6d')]][_0x4e5ffd][_0x3676('0x6f')]=moment()[_0x3676('0x28')](_0x3676('0x20'));this['channels'][_0x2d6a1c[_0x3676('0x6d')]][_0x4e5ffd][_0x3676('0x3b')]=_0x3676('0x4a');this[_0x3676('0x6')][_0x2d6a1c[_0x3676('0x6d')]][_0x4e5ffd][_0x3676('0x2e')]='complete';this[_0x3676('0x6')][_0x2d6a1c[_0x3676('0x6d')]][_0x4e5ffd][_0x3676('0x49')]=_0x5c1e64['diff'](this[_0x3676('0x6')][_0x2d6a1c[_0x3676('0x6d')]][_0x4e5ffd][_0x3676('0x2d')],'seconds');}}}}if(this[_0x3676('0x6')][_0x2d6a1c[_0x3676('0x70')]]){var _0x56397a=this[_0x3676('0x6')][_0x2d6a1c[_0x3676('0x70')]];this[_0x3676('0x6')][_0x2d6a1c[_0x3676('0x70')]]=this[_0x3676('0x6')][_0x2d6a1c[_0x3676('0x6d')]];this['channels'][_0x2d6a1c['transfereeuniqueid']]=_0x56397a;}}}catch(_0x731730){logger['error']('[syncAttendedTransfer][VoiceAgentReport]',util[_0x3676('0x2c')](_0x731730,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3676('0x1b')][_0x3676('0x1a')]=function(_0x179385){try{if(this['isNotNull'](_0x179385)){if(this['channels'][_0x179385[_0x3676('0x6d')]]){for(var _0x213e99 in this['channels'][_0x179385['transfereeuniqueid']]){if(this[_0x3676('0x6')][_0x179385[_0x3676('0x6d')]][_0x3676('0x43')](_0x213e99)){if(_0x179385['transfereruniqueid']===_0x213e99){var _0x4588d0=moment();this[_0x3676('0x6')][_0x179385[_0x3676('0x6d')]][_0x213e99]['agentcomplete']=!![];this[_0x3676('0x6')][_0x179385[_0x3676('0x6d')]][_0x213e99][_0x3676('0x6f')]=_0x4588d0;this[_0x3676('0x6')][_0x179385[_0x3676('0x6d')]][_0x213e99][_0x3676('0x3b')]=_0x3676('0x4a');this[_0x3676('0x6')][_0x179385[_0x3676('0x6d')]][_0x213e99][_0x3676('0x2e')]='complete';this[_0x3676('0x6')][_0x179385[_0x3676('0x6d')]][_0x213e99]['talktime']=_0x4588d0[_0x3676('0x71')](this[_0x3676('0x6')][_0x179385[_0x3676('0x6d')]][_0x213e99][_0x3676('0x2d')],_0x3676('0x72'));}}}}}}catch(_0x1b23ed){logger[_0x3676('0x41')](_0x3676('0x73'),util['inspect'](_0x1b23ed,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3676('0x1b')][_0x3676('0x74')]=function(_0x2b9b2b){var _0x2e9253='';try{if(this['isNotNull'](_0x2b9b2b)){if(_0x2b9b2b[_0x3676('0x75')]){_0x2e9253=_0x2b9b2b['channel']['substring'](0x0,_0x2b9b2b[_0x3676('0x75')][_0x3676('0x76')]('-'));if(this[_0x3676('0x8')][_0x2e9253]){this[_0x3676('0x8')][_0x2e9253][_0x3676('0x77')]=!![];}}}}catch(_0x4189fc){logger[_0x3676('0x41')]('[syncMusicOnHoldStart][VoiceAgentReport]',util['inspect'](_0x4189fc,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x3049ce){var _0x223893='';try{if(this[_0x3676('0x1c')](_0x3049ce)){if(_0x3049ce[_0x3676('0x75')]){_0x223893=_0x3049ce[_0x3676('0x75')][_0x3676('0x78')](0x0,_0x3049ce[_0x3676('0x75')][_0x3676('0x76')]('-'));if(this['agents'][_0x223893]){this[_0x3676('0x8')][_0x223893][_0x3676('0x77')]=![];}}}}catch(_0x5e8887){logger[_0x3676('0x41')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0x3676('0x2c')](_0x5e8887,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
+var _0xa9f1=['values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','talktime','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','onhold','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','channels','voiceChannels','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','queue','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','assign','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','user:called','error','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','pick','destconnectedlinenum','accountcode','exten','custom:agentconnect','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','interface','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','name','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','transfer','agent','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variable','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','membercalls','memberlastcall','memberpenalty','memberrealtime','includes','agentcompleteAt'];(function(_0x79dc51,_0x2ada04){var _0x108bc9=function(_0x17f11a){while(--_0x17f11a){_0x79dc51['push'](_0x79dc51['shift']());}};_0x108bc9(++_0x2ada04);}(_0xa9f1,0xb4));var _0x1a9f=function(_0x64ea63,_0x4c32d3){_0x64ea63=_0x64ea63-0x0;var _0x45d9a1=_0xa9f1[_0x64ea63];return _0x45d9a1;};'use strict';var _=require('lodash');var moment=require(_0x1a9f('0x0'));var util=require(_0x1a9f('0x1'));var Redis=require(_0x1a9f('0x2'));var config=require(_0x1a9f('0x3'));var logger=require(_0x1a9f('0x4'))(_0x1a9f('0x5'));var ami=require(_0x1a9f('0x6'));config['redis']=_[_0x1a9f('0x7')](config[_0x1a9f('0x8')],{'host':_0x1a9f('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1a9f('0x8')]));function VoiceAgentReport(_0x220a51){this[_0x1a9f('0xa')]={};this[_0x1a9f('0xb')]=_0x220a51[_0x1a9f('0xa')];this[_0x1a9f('0xc')]=_0x220a51[_0x1a9f('0xc')];this[_0x1a9f('0xd')]=_0x220a51[_0x1a9f('0xd')];this[_0x1a9f('0xe')]={};ami['on']('agentcalled',this[_0x1a9f('0xf')][_0x1a9f('0x10')](this));ami['on'](_0x1a9f('0x11'),this[_0x1a9f('0x12')][_0x1a9f('0x10')](this));ami['on'](_0x1a9f('0x13'),this[_0x1a9f('0x14')][_0x1a9f('0x10')](this));ami['on'](_0x1a9f('0x15'),this[_0x1a9f('0x16')][_0x1a9f('0x10')](this));ami['on'](_0x1a9f('0x17'),this[_0x1a9f('0x18')][_0x1a9f('0x10')](this));ami['on'](_0x1a9f('0x19'),this[_0x1a9f('0x1a')][_0x1a9f('0x10')](this));ami['on'](_0x1a9f('0x1b'),this[_0x1a9f('0x1c')]['bind'](this));ami['on'](_0x1a9f('0x1d'),this[_0x1a9f('0x1e')][_0x1a9f('0x10')](this));ami['on'](_0x1a9f('0x1f'),this[_0x1a9f('0x20')][_0x1a9f('0x10')](this));ami['on'](_0x1a9f('0x21'),this[_0x1a9f('0x22')][_0x1a9f('0x10')](this));ami['on']('blindtransfer',this[_0x1a9f('0x23')][_0x1a9f('0x10')](this));}VoiceAgentReport[_0x1a9f('0x24')][_0x1a9f('0x25')]=function(_0x573d2d,_0x580a1e,_0x241629){io['to'](_0x573d2d)[_0x1a9f('0x25')](_0x580a1e,_0x241629);};VoiceAgentReport[_0x1a9f('0x24')][_0x1a9f('0x26')]=function(_0x1a8789){return _0x1a8789!==null&&!_[_0x1a9f('0x27')](_0x1a8789);};VoiceAgentReport[_0x1a9f('0x24')]['syncAgentCalled']=function(_0x1a9b48){try{if(this[_0x1a9f('0x26')](_0x1a9b48)){logger['info'](_0x1a9f('0x28'),_0x1a9b48[_0x1a9f('0x29')],_0x1a9b48[_0x1a9f('0x2a')],_0x1a9b48[_0x1a9f('0x2b')]);logger[_0x1a9f('0x2c')](_0x1a9f('0x2d'),_0x1a9b48[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x1a9b48,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x1a9f('0xa')][_0x1a9b48[_0x1a9f('0x29')]])){this[_0x1a9f('0xa')][_0x1a9b48['uniqueid']]={};}var _0x58873b=this[_0x1a9f('0xd')][_0x1a9b48['interface']];var _0x1c5151=this[_0x1a9f('0xa')][_0x1a9b48[_0x1a9f('0x29')]][_0x1a9b48[_0x1a9f('0x2b')]];var _0x4751ff=this[_0x1a9f('0xc')][_0x1a9b48[_0x1a9f('0x2f')]];var _0x97a123=this[_0x1a9f('0xe')][_0x1a9b48['uniqueid']];if(_['isUndefined'](_0x1c5151)){_0x1c5151={'agentcalledAt':moment()['format'](_0x1a9f('0x30')),'lastevent':_0x1a9f('0x31'),'mandatoryDisposition':_0x4751ff&&_0x4751ff[_0x1a9f('0x32')]?_0x4751ff[_0x1a9f('0x32')]:![],'type':_0x4751ff&&_0x4751ff[_0x1a9f('0x33')]?_0x4751ff['type']:_0x1a9f('0x34'),'variables':_0x97a123,'motionChannel':'voice'};}Object[_0x1a9f('0x35')](_0x1c5151,_['omit'](_0x1a9b48,['event','privilege']));this[_0x1a9f('0xa')][_0x1a9b48['uniqueid']][_0x1a9b48[_0x1a9f('0x2b')]]=_0x1c5151;logger['debug'](_0x1a9f('0x36'),_0x1a9b48['uniqueid'],util['inspect'](_0x1c5151,{'showHidden':![],'depth':null}));ami[_0x1a9f('0x25')]('custom:agentcalled',_0x1c5151);var _0x311c5a={'id':_0x58873b['id'],'calleridnum':_0x1c5151[_0x1a9f('0x37')],'queue':_0x1c5151[_0x1a9f('0x2f')],'variables':_0x1c5151[_0x1a9f('0xe')],'uniqueid':_0x1a9b48[_0x1a9f('0x29')]};logger[_0x1a9f('0x2c')](_0x1a9f('0x38'),_0x1a9b48[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x311c5a,{'showHidden':![],'depth':null}));this[_0x1a9f('0x25')](util[_0x1a9f('0x39')](_0x1a9f('0x3a'),_0x1a9b48[_0x1a9f('0x2a')]),_0x1a9f('0x3b'),_0x311c5a);}}catch(_0x105678){logger[_0x1a9f('0x3c')]('[%s][voiceAgentReport][agentcalled]',_0x1a9b48[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x105678,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x1a9f('0x12')]=function(_0x4a0bd5){try{if(this[_0x1a9f('0x26')](_0x4a0bd5)){if(this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]]){for(var _0x2fd629 in this[_0x1a9f('0xa')][_0x4a0bd5['uniqueid']]){if(this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]]['hasOwnProperty'](_0x2fd629)){if(_0x4a0bd5[_0x1a9f('0x2b')]===_0x2fd629){logger[_0x1a9f('0x3d')](_0x1a9f('0x3e'),_0x4a0bd5['uniqueid'],_0x4a0bd5[_0x1a9f('0x2a')],_0x4a0bd5[_0x1a9f('0x2b')]);this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629][_0x1a9f('0x3f')]=moment()[_0x1a9f('0x39')](_0x1a9f('0x30'));this[_0x1a9f('0xa')][_0x4a0bd5['uniqueid']][_0x2fd629][_0x1a9f('0x40')]=_0x4a0bd5[_0x1a9f('0x40')];this[_0x1a9f('0xa')][_0x4a0bd5['uniqueid']][_0x2fd629][_0x1a9f('0x41')]=_0x4a0bd5[_0x1a9f('0x41')];this[_0x1a9f('0xa')][_0x4a0bd5['uniqueid']][_0x2fd629]['destchannelstate']=_0x4a0bd5[_0x1a9f('0x42')];this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629][_0x1a9f('0x43')]=_0x4a0bd5[_0x1a9f('0x43')];this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629][_0x1a9f('0x44')]=_0x4a0bd5[_0x1a9f('0x44')];this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629][_0x1a9f('0x45')]=_0x1a9f('0x46');if(this[_0x1a9f('0xb')][this[_0x1a9f('0xa')][_0x4a0bd5['uniqueid']][_0x2fd629][_0x1a9f('0x29')]]){var _0x1a5605=this[_0x1a9f('0xb')][this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629][_0x1a9f('0x29')]][_0x1a9f('0x47')];this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629][_0x1a9f('0x47')]=_0x1a5605;_0x4a0bd5[_0x1a9f('0x47')]=_0x1a5605;}_[_0x1a9f('0x48')](this[_0x1a9f('0xd')][_0x4a0bd5['interface']],_[_0x1a9f('0x49')](_0x4a0bd5,['queue',_0x1a9f('0x4a'),_0x1a9f('0x47')]));var _0x3aa27c=this[_0x1a9f('0xd')][_0x4a0bd5['interface']];var _0x4f6852={'id':_0x3aa27c['id'],'name':_0x3aa27c['name'],'agentconnected':!![],'destaccountcode':_0x3aa27c[_0x1a9f('0x4b')],'destconnectedlinenum':this['channels'][_0x4a0bd5[_0x1a9f('0x29')]][_0x4a0bd5[_0x1a9f('0x2b')]][_0x1a9f('0x4c')],'queue':this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x4a0bd5[_0x1a9f('0x2b')]][_0x1a9f('0x2f')],'routealias':this[_0x1a9f('0xa')][_0x4a0bd5['uniqueid']][_0x4a0bd5[_0x1a9f('0x2b')]][_0x1a9f('0x47')],'uniqueid':this[_0x1a9f('0xa')][_0x4a0bd5['uniqueid']][_0x4a0bd5[_0x1a9f('0x2b')]][_0x1a9f('0x29')]};ami[_0x1a9f('0x25')](_0x1a9f('0x4d'),this[_0x1a9f('0xa')][_0x4a0bd5['uniqueid']][_0x4a0bd5['destuniqueid']]);this[_0x1a9f('0x25')](util[_0x1a9f('0x39')](_0x1a9f('0x3a'),_0x4a0bd5['membername']),_0x1a9f('0x4e'),_0x4f6852);}else if(!this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629][_0x1a9f('0x13')]&&!this[_0x1a9f('0xa')][_0x4a0bd5['uniqueid']][_0x2fd629][_0x1a9f('0x17')]){logger[_0x1a9f('0x3d')](_0x1a9f('0x4f'),_0x4a0bd5['uniqueid'],this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629]['membername'],_0x2fd629);this['channels'][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629][_0x1a9f('0x13')]=!![];this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629][_0x1a9f('0x50')]=moment()[_0x1a9f('0x39')](_0x1a9f('0x30'));this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629][_0x1a9f('0x51')]=_0x4a0bd5['destuniqueid'];this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629][_0x1a9f('0x52')]=_0x4a0bd5[_0x1a9f('0x2a')];this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629][_0x1a9f('0x45')]=_0x1a9f('0x53');this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629][_0x1a9f('0x54')]=_0x1a9f('0x53');logger['debug'](_0x1a9f('0x55'),_0x4a0bd5[_0x1a9f('0x29')],util['inspect'](this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629],{'showHidden':![],'depth':null}));ami[_0x1a9f('0x25')]('custom:agentansweredelsewhere',this[_0x1a9f('0xa')][_0x4a0bd5[_0x1a9f('0x29')]][_0x2fd629]);}else{logger[_0x1a9f('0x2c')]('[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken',_0x4a0bd5['uniqueid']);}}}}}}catch(_0x58c2a4){logger['error']('[%s][voiceAgentReport][agentconnect]',_0x4a0bd5[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x58c2a4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1a9f('0x24')][_0x1a9f('0x14')]=function(_0x288937){try{if(this[_0x1a9f('0x26')](_0x288937)){logger['debug'](_0x1a9f('0x56'),_0x288937[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x288937,{'showHidden':![],'depth':null}));if(this[_0x1a9f('0xa')][_0x288937['uniqueid']]&&this[_0x1a9f('0xa')][_0x288937[_0x1a9f('0x29')]][_0x288937[_0x1a9f('0x2b')]]){logger[_0x1a9f('0x3d')](_0x1a9f('0x57'),_0x288937[_0x1a9f('0x29')],_0x288937[_0x1a9f('0x2a')],_0x288937[_0x1a9f('0x2b')]);var _0x4f49f6=this[_0x1a9f('0xd')][_0x288937[_0x1a9f('0x58')]];var _0x11f1b6=this[_0x1a9f('0xa')][_0x288937['uniqueid']][_0x288937[_0x1a9f('0x2b')]];_0x11f1b6[_0x1a9f('0x13')]=!![];_0x11f1b6[_0x1a9f('0x50')]=moment()[_0x1a9f('0x39')]('YYYY-MM-DD\x20HH:mm:ss');_0x11f1b6[_0x1a9f('0x45')]=_0x1a9f('0x59');_0x11f1b6['reason']='rejected';var _0x4d912f={'id':_0x4f49f6['id'],'name':_0x4f49f6['name'],'queue':_0x11f1b6['queue'],'uniqueid':_0x11f1b6['uniqueid']};logger[_0x1a9f('0x2c')](_0x1a9f('0x5a'),_0x288937[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x4d912f,{'showHidden':![],'depth':null}));this[_0x1a9f('0x25')](util[_0x1a9f('0x39')](_0x1a9f('0x3a'),_0x4f49f6[_0x1a9f('0x5b')]),_0x1a9f('0x5c'),_0x4d912f);ami['emit'](_0x1a9f('0x5d'),_0x11f1b6);this[_0x1a9f('0xa')][_0x288937[_0x1a9f('0x29')]][_0x288937[_0x1a9f('0x2b')]]=Object[_0x1a9f('0x35')]({},_0x11f1b6);}}}catch(_0x4fe0a0){logger[_0x1a9f('0x3c')]('[%s][voiceAgentReport][agentringnoanswer]',_0x288937[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x4fe0a0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1a9f('0x24')][_0x1a9f('0x16')]=function(_0x494502){try{if(this[_0x1a9f('0x26')](_0x494502)){logger['debug'](_0x1a9f('0x5e'),_0x494502['uniqueid'],util['inspect'](_0x494502,{'showHidden':![],'depth':null}));if(this['channels'][_0x494502[_0x1a9f('0x29')]]){for(var _0x233aee in this[_0x1a9f('0xa')][_0x494502[_0x1a9f('0x29')]]){if(this[_0x1a9f('0xa')][_0x494502[_0x1a9f('0x29')]]['hasOwnProperty'](_0x233aee)&&!this[_0x1a9f('0xa')][_0x494502[_0x1a9f('0x29')]][_0x233aee]['agentringnoanswer']&&!this['channels'][_0x494502[_0x1a9f('0x29')]][_0x233aee]['agentcomplete']){logger[_0x1a9f('0x3d')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x494502['uniqueid'],this[_0x1a9f('0xa')][_0x494502[_0x1a9f('0x29')]][_0x233aee]['membername'],_0x233aee);this[_0x1a9f('0xa')][_0x494502['uniqueid']][_0x233aee][_0x1a9f('0x13')]=!![];this[_0x1a9f('0xa')][_0x494502[_0x1a9f('0x29')]][_0x233aee][_0x1a9f('0x50')]=moment()[_0x1a9f('0x39')](_0x1a9f('0x30'));this[_0x1a9f('0xa')][_0x494502['uniqueid']][_0x233aee][_0x1a9f('0x45')]=_0x1a9f('0x5f');this[_0x1a9f('0xa')][_0x494502['uniqueid']][_0x233aee][_0x1a9f('0x54')]=_0x1a9f('0x5f');logger['debug'](_0x1a9f('0x60'),_0x494502[_0x1a9f('0x29')],util['inspect'](this[_0x1a9f('0xa')][_0x494502['uniqueid']][_0x233aee],{'showHidden':![],'depth':null}));ami[_0x1a9f('0x25')](_0x1a9f('0x61'),this['channels'][_0x494502['uniqueid']][_0x233aee]);}}}}}catch(_0x144dcc){logger[_0x1a9f('0x3c')](_0x1a9f('0x62'),_0x494502[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x144dcc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1a9f('0x24')]['syncAgentComplete']=function(_0x17e697){try{if(this[_0x1a9f('0x26')](_0x17e697)){logger[_0x1a9f('0x2c')](_0x1a9f('0x63'),_0x17e697[_0x1a9f('0x29')],util['inspect'](_0x17e697,{'showHidden':![],'depth':null}));if(this[_0x1a9f('0xa')][_0x17e697[_0x1a9f('0x29')]]){for(var _0x3af8c3 in this[_0x1a9f('0xa')][_0x17e697[_0x1a9f('0x29')]]){if(this['channels'][_0x17e697[_0x1a9f('0x29')]][_0x1a9f('0x64')](_0x3af8c3)){if(this[_0x1a9f('0xa')][_0x17e697['uniqueid']][_0x3af8c3][_0x1a9f('0x3f')]&&!this[_0x1a9f('0xa')][_0x17e697[_0x1a9f('0x29')]][_0x3af8c3][_0x1a9f('0x17')]){logger[_0x1a9f('0x3d')](_0x1a9f('0x65'),_0x17e697[_0x1a9f('0x29')],this[_0x1a9f('0xa')][_0x17e697[_0x1a9f('0x29')]][_0x3af8c3][_0x1a9f('0x2a')],_0x3af8c3);this[_0x1a9f('0xa')][_0x17e697[_0x1a9f('0x29')]][_0x3af8c3]['agentcomplete']=!![];this[_0x1a9f('0xa')][_0x17e697[_0x1a9f('0x29')]][_0x3af8c3]['agentcompleteAt']=moment()[_0x1a9f('0x39')](_0x1a9f('0x30'));this['channels'][_0x17e697[_0x1a9f('0x29')]][_0x3af8c3][_0x1a9f('0x45')]=_0x1a9f('0x66');this['channels'][_0x17e697[_0x1a9f('0x29')]][_0x3af8c3][_0x1a9f('0x54')]=_0x17e697[_0x1a9f('0x54')]==_0x1a9f('0x67')?_0x1a9f('0x68'):_0x17e697['reason'];this['channels'][_0x17e697[_0x1a9f('0x29')]][_0x3af8c3]['talktime']=_0x17e697['talktime'];if(this[_0x1a9f('0xc')][_0x17e697[_0x1a9f('0x2f')]]&&this['voiceQueues'][_0x17e697['queue']]['acw']){this[_0x1a9f('0xa')][_0x17e697['uniqueid']][_0x3af8c3][_0x1a9f('0x69')]=this['voiceQueues'][_0x17e697['queue']][_0x1a9f('0x6a')];this[_0x1a9f('0xa')][_0x17e697[_0x1a9f('0x29')]][_0x3af8c3][_0x1a9f('0x6b')]=!![];}this[_0x1a9f('0xd')][_0x17e697[_0x1a9f('0x58')]]=_['omit'](this['agents'][_0x17e697[_0x1a9f('0x58')]],[_0x1a9f('0x2f'),_0x1a9f('0x4a')]);logger[_0x1a9f('0x2c')](_0x1a9f('0x6c'),_0x17e697[_0x1a9f('0x29')],util['inspect'](this[_0x1a9f('0xa')][_0x17e697[_0x1a9f('0x29')]][_0x3af8c3],{'showHidden':![],'depth':null}));ami[_0x1a9f('0x25')](_0x1a9f('0x6d'),this[_0x1a9f('0xa')][_0x17e697[_0x1a9f('0x29')]][_0x3af8c3]);logger[_0x1a9f('0x2c')](_0x1a9f('0x6e'),_0x17e697[_0x1a9f('0x29')],util[_0x1a9f('0x2e')]({'id':this[_0x1a9f('0xd')][_0x17e697[_0x1a9f('0x58')]]['id'],'destaccountcode':_0x17e697[_0x1a9f('0x6f')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x1a9f('0x3a'),_0x17e697[_0x1a9f('0x2a')]),_0x1a9f('0x70'),{'id':this['agents'][_0x17e697[_0x1a9f('0x58')]]['id'],'destaccountcode':Number(_0x17e697[_0x1a9f('0x6f')])});}}}}}}catch(_0x26acbf){logger[_0x1a9f('0x3c')](_0x1a9f('0x71'),_0x17e697[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x26acbf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1a9f('0x24')]['syncVarSet']=function(_0x1a3654){try{if(this[_0x1a9f('0x26')](_0x1a3654)){logger[_0x1a9f('0x2c')](_0x1a9f('0x72'),_0x1a3654[_0x1a9f('0x29')],util['inspect'](_0x1a3654,{'showHidden':![],'depth':null}));this[_0x1a9f('0x73')](_0x1a3654[_0x1a9f('0x29')],_[_0x1a9f('0x74')](_0x1a3654['variable'])[0x0],_0x1a3654[_0x1a9f('0x75')]);if(this[_0x1a9f('0xa')][_0x1a3654['uniqueid']]){for(var _0x458d32 in this[_0x1a9f('0xa')][_0x1a3654[_0x1a9f('0x29')]]){if(this[_0x1a9f('0xa')][_0x1a3654['uniqueid']][_0x1a9f('0x64')](_0x458d32)){logger[_0x1a9f('0x3d')](_0x1a9f('0x76'),_0x1a3654['uniqueid'],_0x458d32,_[_0x1a9f('0x74')](_0x1a3654[_0x1a9f('0x77')])[0x0],_0x1a3654[_0x1a9f('0x75')]);if(_[_0x1a9f('0x27')](this[_0x1a9f('0xa')][_0x1a3654[_0x1a9f('0x29')]][_0x458d32][_0x1a9f('0xe')])){this[_0x1a9f('0xa')][_0x1a3654[_0x1a9f('0x29')]][_0x458d32][_0x1a9f('0xe')]={};}this[_0x1a9f('0xa')][_0x1a3654[_0x1a9f('0x29')]][_0x458d32][_0x1a9f('0xe')]=this['variables'][_0x1a3654[_0x1a9f('0x29')]];}}}}}catch(_0x2e5312){logger[_0x1a9f('0x3c')](_0x1a9f('0x78'),_0x1a3654[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x2e5312,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x3ba7b2,_0x35a38a,_0x2c2712){var _0x559a66=['rtpaudioqos',_0x1a9f('0x79'),_0x1a9f('0x7a'),_0x1a9f('0x7b'),_0x1a9f('0x7c'),_0x1a9f('0x7d'),_0x1a9f('0x7e'),_0x1a9f('0x7f'),'sipcallid','sipuri','bridgepeer','bridgepvtcallid',_0x1a9f('0x80'),'memberdynamic','memberinterface',_0x1a9f('0x81'),_0x1a9f('0x2a'),_0x1a9f('0x82'),_0x1a9f('0x83')];if(!_['isNil'](_0x35a38a)&&!_[_0x1a9f('0x84')](_0x559a66,_0x35a38a)){if(_[_0x1a9f('0x27')](this[_0x1a9f('0xe')][_0x3ba7b2])){this['variables'][_0x3ba7b2]={};}this['variables'][_0x3ba7b2][_0x35a38a]=_0x2c2712;}};VoiceAgentReport[_0x1a9f('0x24')][_0x1a9f('0x1c')]=function(_0x38523a){try{if(this['isNotNull'](_0x38523a)){logger[_0x1a9f('0x2c')]('[%s][voiceAgentReport][hangup]\x20event:',_0x38523a[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x38523a,{'showHidden':![],'depth':null}));if(this['channels'][_0x38523a['uniqueid']]){for(var _0x318c97 in this[_0x1a9f('0xa')][_0x38523a[_0x1a9f('0x29')]]){if(this[_0x1a9f('0xa')][_0x38523a[_0x1a9f('0x29')]]['hasOwnProperty'](_0x318c97)){if(this[_0x1a9f('0xa')][_0x38523a['uniqueid']][_0x318c97]['reason']==_0x1a9f('0x67')&&this[_0x1a9f('0xa')][_0x38523a['uniqueid']][_0x318c97][_0x1a9f('0x17')]){logger[_0x1a9f('0x3d')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x38523a[_0x1a9f('0x29')],_0x318c97);this[_0x1a9f('0xa')][_0x38523a[_0x1a9f('0x29')]][_0x318c97][_0x1a9f('0x85')]=moment()[_0x1a9f('0x39')](_0x1a9f('0x30'));}}}logger[_0x1a9f('0x2c')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x38523a[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_[_0x1a9f('0x86')](this[_0x1a9f('0xa')][_0x38523a[_0x1a9f('0x29')]]),{'showHidden':![],'depth':null}));ami[_0x1a9f('0x25')](_0x1a9f('0x87'),_[_0x1a9f('0x86')](this[_0x1a9f('0xa')][_0x38523a[_0x1a9f('0x29')]]));delete this[_0x1a9f('0xa')][_0x38523a['uniqueid']];}if(this[_0x1a9f('0xe')][_0x38523a[_0x1a9f('0x29')]]){delete this[_0x1a9f('0xe')][_0x38523a[_0x1a9f('0x29')]];}}}catch(_0x9683b2){logger['error'](_0x1a9f('0x88'),_0x38523a['uniqueid'],util['inspect'](_0x9683b2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1a9f('0x24')][_0x1a9f('0x22')]=function(_0x172f1d){try{if(this['isNotNull'](_0x172f1d)){logger[_0x1a9f('0x2c')](_0x1a9f('0x89'),_0x172f1d[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x172f1d,{'showHidden':![],'depth':null}));if(this[_0x1a9f('0xa')][_0x172f1d[_0x1a9f('0x8a')]]){for(var _0x4e7d29 in this[_0x1a9f('0xa')][_0x172f1d[_0x1a9f('0x8a')]]){if(this[_0x1a9f('0xa')][_0x172f1d[_0x1a9f('0x8a')]][_0x1a9f('0x64')](_0x4e7d29)){if(_0x172f1d[_0x1a9f('0x8b')]===_0x4e7d29){logger[_0x1a9f('0x3d')](_0x1a9f('0x8c'),_0x172f1d[_0x1a9f('0x29')],this['channels'][_0x172f1d['transfereeuniqueid']][_0x4e7d29][_0x1a9f('0x2a')],_0x4e7d29);var _0x3ffcdd=moment();this[_0x1a9f('0xa')][_0x172f1d[_0x1a9f('0x8a')]][_0x4e7d29]['agentcomplete']=!![];this[_0x1a9f('0xa')][_0x172f1d['transfereeuniqueid']][_0x4e7d29][_0x1a9f('0x85')]=moment()[_0x1a9f('0x39')](_0x1a9f('0x30'));this['channels'][_0x172f1d['transfereeuniqueid']][_0x4e7d29]['lastevent']=_0x1a9f('0x66');this['channels'][_0x172f1d[_0x1a9f('0x8a')]][_0x4e7d29][_0x1a9f('0x54')]=_0x1a9f('0x67');this[_0x1a9f('0xa')][_0x172f1d['transfereeuniqueid']][_0x4e7d29][_0x1a9f('0x8d')]=_0x3ffcdd[_0x1a9f('0x8e')](this['channels'][_0x172f1d[_0x1a9f('0x8a')]][_0x4e7d29][_0x1a9f('0x3f')],_0x1a9f('0x8f'));}}}}if(this[_0x1a9f('0xa')][_0x172f1d[_0x1a9f('0x90')]]){var _0x265c15=this[_0x1a9f('0xa')][_0x172f1d[_0x1a9f('0x90')]];this[_0x1a9f('0xa')][_0x172f1d[_0x1a9f('0x90')]]=this[_0x1a9f('0xa')][_0x172f1d[_0x1a9f('0x8a')]];this['channels'][_0x172f1d[_0x1a9f('0x8a')]]=_0x265c15;}}}catch(_0x488117){logger[_0x1a9f('0x3c')](_0x1a9f('0x91'),_0x172f1d[_0x1a9f('0x29')],util['inspect'](_0x488117,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1a9f('0x24')][_0x1a9f('0x23')]=function(_0x55c25d){try{if(this[_0x1a9f('0x26')](_0x55c25d)){logger['debug'](_0x1a9f('0x92'),_0x55c25d['uniqueid'],util[_0x1a9f('0x2e')](_0x55c25d,{'showHidden':![],'depth':null}));if(this[_0x1a9f('0xa')][_0x55c25d[_0x1a9f('0x8a')]]){for(var _0xee7619 in this[_0x1a9f('0xa')][_0x55c25d['transfereeuniqueid']]){if(this['channels'][_0x55c25d['transfereeuniqueid']]['hasOwnProperty'](_0xee7619)){if(_0x55c25d[_0x1a9f('0x93')]===_0xee7619){logger[_0x1a9f('0x3d')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x55c25d[_0x1a9f('0x29')],this[_0x1a9f('0xa')][_0x55c25d['transfereeuniqueid']][_0xee7619][_0x1a9f('0x2a')],_0xee7619);var _0x4f92b5=moment();this['channels'][_0x55c25d[_0x1a9f('0x8a')]][_0xee7619][_0x1a9f('0x17')]=!![];this[_0x1a9f('0xa')][_0x55c25d['transfereeuniqueid']][_0xee7619][_0x1a9f('0x85')]=_0x4f92b5;this['channels'][_0x55c25d[_0x1a9f('0x8a')]][_0xee7619]['lastevent']=_0x1a9f('0x66');this[_0x1a9f('0xa')][_0x55c25d[_0x1a9f('0x8a')]][_0xee7619][_0x1a9f('0x54')]=_0x1a9f('0x67');this[_0x1a9f('0xa')][_0x55c25d[_0x1a9f('0x8a')]][_0xee7619]['talktime']=_0x4f92b5[_0x1a9f('0x8e')](this['channels'][_0x55c25d['transfereeuniqueid']][_0xee7619]['agentconnectAt'],_0x1a9f('0x8f'));}}}}}}catch(_0x45e06e){logger['error']('[%s][voiceAgentReport][blindtransfer]',_0x55c25d[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x45e06e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1a9f('0x24')][_0x1a9f('0x1e')]=function(_0xcf7ce7){var _0x1e6c48='';try{if(this['isNotNull'](_0xcf7ce7)){logger[_0x1a9f('0x2c')](_0x1a9f('0x94'),_0xcf7ce7[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0xcf7ce7,{'showHidden':![],'depth':null}));if(_0xcf7ce7[_0x1a9f('0x95')]){_0x1e6c48=_0xcf7ce7[_0x1a9f('0x95')][_0x1a9f('0x96')](0x0,_0xcf7ce7[_0x1a9f('0x95')][_0x1a9f('0x97')]('-'));if(this['agents'][_0x1e6c48]){logger[_0x1a9f('0x3d')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0xcf7ce7[_0x1a9f('0x29')],_0x1e6c48);this['agents'][_0x1e6c48]['onhold']=!![];}}}}catch(_0x56624b){logger[_0x1a9f('0x3c')](_0x1a9f('0x98'),_0xcf7ce7[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x56624b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1a9f('0x24')][_0x1a9f('0x20')]=function(_0x4429e9){var _0x472307='';try{if(this[_0x1a9f('0x26')](_0x4429e9)){logger[_0x1a9f('0x2c')](_0x1a9f('0x99'),_0x4429e9[_0x1a9f('0x29')],util[_0x1a9f('0x2e')](_0x4429e9,{'showHidden':![],'depth':null}));if(_0x4429e9[_0x1a9f('0x95')]){_0x472307=_0x4429e9[_0x1a9f('0x95')][_0x1a9f('0x96')](0x0,_0x4429e9['channel'][_0x1a9f('0x97')]('-'));if(this['agents'][_0x472307]){logger[_0x1a9f('0x3d')](_0x1a9f('0x9a'),_0x4429e9[_0x1a9f('0x29')],_0x472307);this[_0x1a9f('0xd')][_0x472307][_0x1a9f('0x9b')]=![];}}}}catch(_0x357f36){logger[_0x1a9f('0x3c')]('[%s][voiceAgentReport][musiconholdstop]',_0x4429e9['uniqueid'],util[_0x1a9f('0x2e')](_0x357f36,{'showHidden':![],'depth':null}));}};module[_0x1a9f('0x9c')]=VoiceAgentReport;
\ No newline at end of file