Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / services / ami / report / voiceDialReport.js
index 91f3305..a7ffa2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf44f=['total','answered','holdtime','billableseconds','sumBillable','sumDuration','duration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','exports','moment','util','ioredis','../../../config/logger','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','called','channel','lastIndexOf','substring','omit','event','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','answertime','format','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','syncVarSet','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','diff','starttime','seconds','complete'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xf44f,0x7f));var _0xff44=function(_0x235b06,_0x3ddca2){_0x235b06=_0x235b06-0x0;var _0xcd3900=_0xf44f[_0x235b06];return _0xcd3900;};'use strict';var _=require('lodash');var moment=require(_0xff44('0x0'));var util=require(_0xff44('0x1'));var Redis=require(_0xff44('0x2'));var config=require('../../../config/environment');var logger=require(_0xff44('0x3'))('ami');var ami=require(_0xff44('0x4'));config[_0xff44('0x5')]=_[_0xff44('0x6')](config['redis'],{'host':_0xff44('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xff44('0x5')]));function VoiceDialReport(_0x405325){this[_0xff44('0x8')]=_0x405325[_0xff44('0x9')];this[_0xff44('0xa')]=_0x405325[_0xff44('0xa')];this[_0xff44('0xb')]={};ami['on'](_0xff44('0xc'),this[_0xff44('0xd')][_0xff44('0xe')](this));ami['on'](_0xff44('0xf'),this[_0xff44('0x10')]['bind'](this));ami['on'](_0xff44('0x11'),this['syncVarSet']['bind'](this));ami['on'](_0xff44('0x12'),this[_0xff44('0x13')][_0xff44('0xe')](this));}VoiceDialReport[_0xff44('0x14')][_0xff44('0x15')]=function(_0x5e6d87){return _0x5e6d87!==null&&!_[_0xff44('0x16')](_0x5e6d87);};VoiceDialReport['prototype'][_0xff44('0x17')]=function(_0x2ef40f,_0x29f17,_0x102a6b){io['to'](_0x2ef40f)[_0xff44('0x17')](_0x29f17,_0x102a6b);};VoiceDialReport[_0xff44('0x14')][_0xff44('0xd')]=function(_0x5425bf){try{if(this[_0xff44('0x15')](_0x5425bf)){logger[_0xff44('0x18')](_0xff44('0x19'),_0x5425bf[_0xff44('0x1a')],util[_0xff44('0x1b')](_0x5425bf,{'showHidden':![],'depth':null}));if(this[_0xff44('0x8')][_0x5425bf[_0xff44('0x1a')]]){_[_0xff44('0x1c')](this['channels'][_0x5425bf['uniqueid']],{'starttime':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xff44('0x1d'),'interface':_0x5425bf['channel']['substring'](0x0,_0x5425bf[_0xff44('0x1e')][_0xff44('0x1f')]('-')),'membername':_0x5425bf['channel'][_0xff44('0x20')](_0x5425bf['channel'][_0xff44('0x1f')]('/')+0x1,_0x5425bf[_0xff44('0x1e')][_0xff44('0x1f')]('-'))},_[_0xff44('0x21')](_0x5425bf,[_0xff44('0x22'),'privilege']));logger[_0xff44('0x23')](_0xff44('0x24'),_0x5425bf[_0xff44('0x1a')],this[_0xff44('0x8')][_0x5425bf[_0xff44('0x1a')]][_0xff44('0x25')],this[_0xff44('0x8')][_0x5425bf['uniqueid']]['interface']);logger[_0xff44('0x18')](_0xff44('0x26'),_0x5425bf[_0xff44('0x1a')],util[_0xff44('0x1b')](this[_0xff44('0x8')][_0x5425bf['uniqueid']],{'showHidden':![],'depth':null}));this[_0xff44('0x17')](_0xff44('0x27'),_0xff44('0x28'),this[_0xff44('0x8')][_0x5425bf[_0xff44('0x1a')]]);logger[_0xff44('0x18')](_0xff44('0x29'),_0x5425bf[_0xff44('0x1a')],util[_0xff44('0x1b')](this[_0xff44('0x8')][_0x5425bf['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xff44('0x17')](_0xff44('0x2a'),this['channels'][_0x5425bf[_0xff44('0x1a')]]);}}}catch(_0x468e27){logger[_0xff44('0x2b')](_0xff44('0x2c'),_0x5425bf[_0xff44('0x1a')],util[_0xff44('0x1b')](_0x468e27,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xff44('0x14')][_0xff44('0x10')]=function(_0x59a1bf){try{if(this[_0xff44('0x15')](_0x59a1bf)){logger[_0xff44('0x18')](_0xff44('0x2d'),_0x59a1bf['uniqueid'],util[_0xff44('0x1b')](_0x59a1bf,{'showHidden':![],'depth':null}));if(this[_0xff44('0x8')][_0x59a1bf[_0xff44('0x1a')]]){this[_0xff44('0x8')][_0x59a1bf[_0xff44('0x1a')]][_0xff44('0x2e')]=_0x59a1bf[_0xff44('0x2e')];if(_0x59a1bf[_0xff44('0x2e')]==='ANSWER'){this[_0xff44('0x8')][_0x59a1bf[_0xff44('0x1a')]]['connectedlinenum']=_0x59a1bf[_0xff44('0x2f')];this['channels'][_0x59a1bf[_0xff44('0x1a')]]['connectedlinename']=_0x59a1bf[_0xff44('0x30')];this[_0xff44('0x8')][_0x59a1bf[_0xff44('0x1a')]][_0xff44('0x31')]=moment()[_0xff44('0x32')](_0xff44('0x33'));this[_0xff44('0x8')][_0x59a1bf['uniqueid']][_0xff44('0x34')]=_0xff44('0x35');logger[_0xff44('0x23')](_0xff44('0x36'),_0x59a1bf['uniqueid'],_0x59a1bf[_0xff44('0x1e')][_0xff44('0x20')](_0x59a1bf[_0xff44('0x1e')][_0xff44('0x1f')]('/')+0x1,_0x59a1bf[_0xff44('0x1e')][_0xff44('0x1f')]('-')));logger[_0xff44('0x18')](_0xff44('0x37'),_0x59a1bf[_0xff44('0x1a')],util[_0xff44('0x1b')](this['channels'][_0x59a1bf['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xff44('0x17')](_0xff44('0x38'),this[_0xff44('0x8')][_0x59a1bf[_0xff44('0x1a')]]);}logger[_0xff44('0x18')](_0xff44('0x39'),_0x59a1bf[_0xff44('0x1a')],util[_0xff44('0x1b')](this['channels'][_0x59a1bf[_0xff44('0x1a')]],{'showHidden':![],'depth':null}));this[_0xff44('0x17')]('voice:outbound',_0xff44('0x28'),this['channels'][_0x59a1bf[_0xff44('0x1a')]]);}}}catch(_0x297db2){logger['error'](_0xff44('0x3a'),_0x59a1bf[_0xff44('0x1a')],util[_0xff44('0x1b')](_0x297db2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xff44('0x14')][_0xff44('0x3b')]=function(_0x1429ee){try{if(this[_0xff44('0x15')](_0x1429ee)){logger[_0xff44('0x18')](_0xff44('0x3c'),_0x1429ee[_0xff44('0x1a')],util[_0xff44('0x1b')](_0x1429ee,{'showHidden':![],'depth':null}));this[_0xff44('0x3d')](_0x1429ee['uniqueid'],_[_0xff44('0x3e')](_0x1429ee[_0xff44('0x3f')])[0x0],_0x1429ee[_0xff44('0x40')]);if(this[_0xff44('0x15')](_0x1429ee['variable'])&&this['isNotNull'](_0x1429ee[_0xff44('0x3f')][_0xff44('0x41')])){if(_['isUndefined'](this['channels'][_0x1429ee[_0xff44('0x1a')]])){this[_0xff44('0x8')][_0x1429ee['uniqueid']]={'routeId':_0x1429ee[_0xff44('0x40')],'variables':this[_0xff44('0xb')][_0x1429ee[_0xff44('0x1a')]]};logger['info'](_0xff44('0x42'),_0x1429ee[_0xff44('0x1a')],_0x1429ee[_0xff44('0x3f')][_0xff44('0x41')],_['keys'](_0x1429ee[_0xff44('0x3f')])[0x0],_0x1429ee[_0xff44('0x40')]);logger[_0xff44('0x18')](_0xff44('0x43'),_0x1429ee[_0xff44('0x1a')],util[_0xff44('0x1b')](this[_0xff44('0x8')][_0x1429ee[_0xff44('0x1a')]],{'showHidden':![],'depth':null}));this[_0xff44('0x17')](_0xff44('0x27'),_0xff44('0x28'),this[_0xff44('0x8')][_0x1429ee[_0xff44('0x1a')]]);}}}}catch(_0x2615f4){logger[_0xff44('0x2b')](_0xff44('0x44'),_0x1429ee[_0xff44('0x1a')],util[_0xff44('0x1b')](_0x2615f4,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xff44('0x14')][_0xff44('0x3d')]=function(_0x18c8ff,_0x266ef8,_0x10c9bd){var _0x1303f4=[_0xff44('0x45'),_0xff44('0x46'),_0xff44('0x47'),_0xff44('0x48'),_0xff44('0x49'),_0xff44('0x4a'),_0xff44('0x4b'),_0xff44('0x4c'),'sipcallid',_0xff44('0x4d'),_0xff44('0x4e'),'bridgepvtcallid',_0xff44('0x4f'),_0xff44('0x50'),'memberinterface',_0xff44('0x51'),_0xff44('0x25'),_0xff44('0x52'),_0xff44('0x53')];if(!_[_0xff44('0x54')](_0x266ef8)&&!_['includes'](_0x1303f4,_0x266ef8)){if(_['isUndefined'](this[_0xff44('0xb')][_0x18c8ff])){this[_0xff44('0xb')][_0x18c8ff]={};}this[_0xff44('0xb')][_0x18c8ff][_0x266ef8]=_0x10c9bd;}};VoiceDialReport[_0xff44('0x14')]['syncHangup']=function(_0x4f1465){try{if(this[_0xff44('0x15')](_0x4f1465)){logger['debug']('[%s][voiceDialReport][hangup]\x20event:',_0x4f1465['uniqueid'],util[_0xff44('0x1b')](_0x4f1465,{'showHidden':![],'depth':null}));if(this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]]){logger[_0xff44('0x23')](_0xff44('0x55'),_0x4f1465[_0xff44('0x1a')],_0x4f1465['cause-txt']);this[_0xff44('0x8')][_0x4f1465['uniqueid']][_0xff44('0x56')]=moment()[_0xff44('0x32')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]]['duration']=moment(this['channels'][_0x4f1465[_0xff44('0x1a')]][_0xff44('0x56')])[_0xff44('0x57')](this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]][_0xff44('0x58')],_0xff44('0x59'));this[_0xff44('0x8')][_0x4f1465['uniqueid']]['lastevent']=_0xff44('0x5a');this[_0xff44('0xa')][_0xff44('0x5b')]+=0x1;if(this[_0xff44('0x8')][_0x4f1465['uniqueid']][_0xff44('0x31')]){this['outbound'][_0xff44('0x5c')]+=0x1;this[_0xff44('0x8')][_0x4f1465['uniqueid']][_0xff44('0x5d')]=moment(this[_0xff44('0x8')][_0x4f1465['uniqueid']][_0xff44('0x31')])['diff'](this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]][_0xff44('0x58')],_0xff44('0x59'));this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]][_0xff44('0x5e')]=moment(this[_0xff44('0x8')][_0x4f1465['uniqueid']][_0xff44('0x56')])[_0xff44('0x57')](this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]][_0xff44('0x31')],'seconds');this[_0xff44('0xa')]['sumHoldTime']+=this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]][_0xff44('0x5d')]||0x0;this[_0xff44('0xa')][_0xff44('0x5f')]+=this['channels'][_0x4f1465[_0xff44('0x1a')]]['billableseconds'];}this[_0xff44('0xa')][_0xff44('0x60')]+=this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]][_0xff44('0x61')];logger[_0xff44('0x18')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x4f1465[_0xff44('0x1a')],util[_0xff44('0x1b')](this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xff44('0x17')](_0xff44('0x62'),this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]]);logger[_0xff44('0x18')](_0xff44('0x63'),_0x4f1465['uniqueid'],util[_0xff44('0x1b')](this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xff44('0x17')]('custom:dialend',this[_0xff44('0x8')][_0x4f1465['uniqueid']]);logger[_0xff44('0x18')](_0xff44('0x64'),_0x4f1465[_0xff44('0x1a')],util['inspect'](this['channels'][_0x4f1465['uniqueid']],{'showHidden':![],'depth':null}));this[_0xff44('0x17')]('voice:outbound',_0xff44('0x65'),this['outbound']);logger[_0xff44('0x23')](_0xff44('0x66'),JSON[_0xff44('0x67')](this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]]));logger[_0xff44('0x18')](_0xff44('0x68'),_0x4f1465[_0xff44('0x1a')],util[_0xff44('0x1b')](this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]],{'showHidden':![],'depth':null}));this[_0xff44('0x17')]('voice:outbound','voice_outbound_channel:remove',this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]]);delete this[_0xff44('0x8')][_0x4f1465[_0xff44('0x1a')]];}else if(this[_0xff44('0x8')][_0x4f1465[_0xff44('0x69')]]){this[_0xff44('0x8')][_0x4f1465[_0xff44('0x69')]][_0xff44('0x1a')]=this[_0xff44('0x8')][_0x4f1465[_0xff44('0x69')]][_0xff44('0x6a')];}if(this[_0xff44('0xb')][_0x4f1465[_0xff44('0x1a')]]){delete this[_0xff44('0xb')][_0x4f1465[_0xff44('0x1a')]];}}}catch(_0x259330){logger[_0xff44('0x2b')](_0xff44('0x6b'),_0x4f1465['uniqueid'],util[_0xff44('0x1b')](_0x259330,{'showHidden':![],'depth':null}));}};module[_0xff44('0x6c')]=VoiceDialReport;
\ No newline at end of file
+var _0x4b33=['value','outboundrouteid','isUndefined','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','seconds','diff','starttime','billableseconds','sumHoldTime','holdtime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','outbound','variables','dialbegin','syncDialBegin','bind','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','emit','isNotNull','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','merge','channels','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','omit','privilege','info','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinename','answertime','lastevent','connect','substring','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','error','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable'];(function(_0x568cfe,_0x39022c){var _0x598d17=function(_0x225ff7){while(--_0x225ff7){_0x568cfe['push'](_0x568cfe['shift']());}};_0x598d17(++_0x39022c);}(_0x4b33,0x1c6));var _0x34b3=function(_0x259a49,_0x192f2a){_0x259a49=_0x259a49-0x0;var _0x4e7cf9=_0x4b33[_0x259a49];return _0x4e7cf9;};'use strict';var _=require('lodash');var moment=require(_0x34b3('0x0'));var util=require(_0x34b3('0x1'));var Redis=require(_0x34b3('0x2'));var config=require(_0x34b3('0x3'));var logger=require(_0x34b3('0x4'))('ami');var ami=require(_0x34b3('0x5'));config[_0x34b3('0x6')]=_[_0x34b3('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x34b3('0x6')]));function VoiceDialReport(_0x460661){this['channels']=_0x460661['outboundChannels'];this[_0x34b3('0x8')]=_0x460661[_0x34b3('0x8')];this[_0x34b3('0x9')]={};ami['on'](_0x34b3('0xa'),this[_0x34b3('0xb')][_0x34b3('0xc')](this));ami['on']('dialend',this[_0x34b3('0xd')][_0x34b3('0xc')](this));ami['on'](_0x34b3('0xe'),this[_0x34b3('0xf')][_0x34b3('0xc')](this));ami['on'](_0x34b3('0x10'),this[_0x34b3('0x11')][_0x34b3('0xc')](this));}VoiceDialReport[_0x34b3('0x12')]['isNotNull']=function(_0x2dede8){return _0x2dede8!==null&&!_['isUndefined'](_0x2dede8);};VoiceDialReport[_0x34b3('0x12')][_0x34b3('0x13')]=function(_0x2a549e,_0x353d39,_0x4f6c29){io['to'](_0x2a549e)[_0x34b3('0x13')](_0x353d39,_0x4f6c29);};VoiceDialReport[_0x34b3('0x12')][_0x34b3('0xb')]=function(_0x4dd01c){try{if(this[_0x34b3('0x14')](_0x4dd01c)){logger['debug'](_0x34b3('0x15'),_0x4dd01c[_0x34b3('0x16')],util['inspect'](_0x4dd01c,{'showHidden':![],'depth':null}));if(this['channels'][_0x4dd01c['uniqueid']]){_[_0x34b3('0x17')](this[_0x34b3('0x18')][_0x4dd01c[_0x34b3('0x16')]],{'starttime':moment()[_0x34b3('0x19')](_0x34b3('0x1a')),'lastevent':_0x34b3('0x1b'),'interface':_0x4dd01c[_0x34b3('0x1c')]['substring'](0x0,_0x4dd01c[_0x34b3('0x1c')][_0x34b3('0x1d')]('-')),'membername':_0x4dd01c[_0x34b3('0x1c')]['substring'](_0x4dd01c['channel'][_0x34b3('0x1d')]('/')+0x1,_0x4dd01c[_0x34b3('0x1c')]['lastIndexOf']('-'))},_[_0x34b3('0x1e')](_0x4dd01c,['event',_0x34b3('0x1f')]));logger[_0x34b3('0x20')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x4dd01c[_0x34b3('0x16')],this[_0x34b3('0x18')][_0x4dd01c[_0x34b3('0x16')]]['membername'],this[_0x34b3('0x18')][_0x4dd01c[_0x34b3('0x16')]]['interface']);logger[_0x34b3('0x21')](_0x34b3('0x22'),_0x4dd01c[_0x34b3('0x16')],util[_0x34b3('0x23')](this[_0x34b3('0x18')][_0x4dd01c['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0x34b3('0x24'),_0x34b3('0x25'),this[_0x34b3('0x18')][_0x4dd01c[_0x34b3('0x16')]]);logger['debug'](_0x34b3('0x26'),_0x4dd01c[_0x34b3('0x16')],util['inspect'](this['channels'][_0x4dd01c[_0x34b3('0x16')]],{'showHidden':![],'depth':null}));ami[_0x34b3('0x13')]('custom:dialbegin',this[_0x34b3('0x18')][_0x4dd01c[_0x34b3('0x16')]]);}}}catch(_0x2ee736){logger['error'](_0x34b3('0x27'),_0x4dd01c[_0x34b3('0x16')],util[_0x34b3('0x23')](_0x2ee736,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x34b3('0x12')][_0x34b3('0xd')]=function(_0x20ea7f){try{if(this[_0x34b3('0x14')](_0x20ea7f)){logger['debug'](_0x34b3('0x28'),_0x20ea7f['uniqueid'],util[_0x34b3('0x23')](_0x20ea7f,{'showHidden':![],'depth':null}));if(this[_0x34b3('0x18')][_0x20ea7f[_0x34b3('0x16')]]){this['channels'][_0x20ea7f['uniqueid']][_0x34b3('0x29')]=_0x20ea7f[_0x34b3('0x29')];if(_0x20ea7f[_0x34b3('0x29')]===_0x34b3('0x2a')){this['channels'][_0x20ea7f[_0x34b3('0x16')]]['connectedlinenum']=_0x20ea7f['connectedlinenum'];this[_0x34b3('0x18')][_0x20ea7f[_0x34b3('0x16')]][_0x34b3('0x2b')]=_0x20ea7f[_0x34b3('0x2b')];this[_0x34b3('0x18')][_0x20ea7f['uniqueid']][_0x34b3('0x2c')]=moment()[_0x34b3('0x19')](_0x34b3('0x1a'));this[_0x34b3('0x18')][_0x20ea7f[_0x34b3('0x16')]][_0x34b3('0x2d')]=_0x34b3('0x2e');logger[_0x34b3('0x20')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x20ea7f[_0x34b3('0x16')],_0x20ea7f[_0x34b3('0x1c')][_0x34b3('0x2f')](_0x20ea7f[_0x34b3('0x1c')]['lastIndexOf']('/')+0x1,_0x20ea7f[_0x34b3('0x1c')]['lastIndexOf']('-')));logger[_0x34b3('0x21')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x20ea7f[_0x34b3('0x16')],util['inspect'](this['channels'][_0x20ea7f[_0x34b3('0x16')]],{'showHidden':![],'depth':null}));ami[_0x34b3('0x13')](_0x34b3('0x30'),this['channels'][_0x20ea7f[_0x34b3('0x16')]]);}logger[_0x34b3('0x21')](_0x34b3('0x31'),_0x20ea7f[_0x34b3('0x16')],util[_0x34b3('0x23')](this[_0x34b3('0x18')][_0x20ea7f[_0x34b3('0x16')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound','voice_outbound_channel:save',this[_0x34b3('0x18')][_0x20ea7f[_0x34b3('0x16')]]);}}}catch(_0x4d2367){logger[_0x34b3('0x32')](_0x34b3('0x33'),_0x20ea7f['uniqueid'],util[_0x34b3('0x23')](_0x4d2367,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x34b3('0x12')][_0x34b3('0xf')]=function(_0x10ee1c){try{if(this[_0x34b3('0x14')](_0x10ee1c)){logger['debug'](_0x34b3('0x34'),_0x10ee1c['uniqueid'],util[_0x34b3('0x23')](_0x10ee1c,{'showHidden':![],'depth':null}));this[_0x34b3('0x35')](_0x10ee1c[_0x34b3('0x16')],_[_0x34b3('0x36')](_0x10ee1c[_0x34b3('0x37')])[0x0],_0x10ee1c[_0x34b3('0x38')]);if(this[_0x34b3('0x14')](_0x10ee1c[_0x34b3('0x37')])&&this[_0x34b3('0x14')](_0x10ee1c[_0x34b3('0x37')][_0x34b3('0x39')])){if(_[_0x34b3('0x3a')](this['channels'][_0x10ee1c['uniqueid']])){this[_0x34b3('0x18')][_0x10ee1c[_0x34b3('0x16')]]={'routeId':_0x10ee1c['value'],'variables':this[_0x34b3('0x9')][_0x10ee1c['uniqueid']]};logger[_0x34b3('0x20')](_0x34b3('0x3b'),_0x10ee1c[_0x34b3('0x16')],_0x10ee1c[_0x34b3('0x37')][_0x34b3('0x39')],_['keys'](_0x10ee1c[_0x34b3('0x37')])[0x0],_0x10ee1c[_0x34b3('0x38')]);logger[_0x34b3('0x21')](_0x34b3('0x3c'),_0x10ee1c['uniqueid'],util['inspect'](this[_0x34b3('0x18')][_0x10ee1c['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x34b3('0x25'),this['channels'][_0x10ee1c[_0x34b3('0x16')]]);}}}}catch(_0x1be419){logger[_0x34b3('0x32')](_0x34b3('0x3d'),_0x10ee1c[_0x34b3('0x16')],util[_0x34b3('0x23')](_0x1be419,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x34b3('0x12')]['addVariable']=function(_0x475bf4,_0x3c6b77,_0x335e40){var _0x1158e4=[_0x34b3('0x3e'),'rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x34b3('0x3f'),_0x34b3('0x40'),_0x34b3('0x41'),_0x34b3('0x42'),_0x34b3('0x43'),_0x34b3('0x44'),_0x34b3('0x45'),_0x34b3('0x46'),_0x34b3('0x47'),_0x34b3('0x48'),_0x34b3('0x49'),_0x34b3('0x4a'),_0x34b3('0x4b'),_0x34b3('0x4c'),_0x34b3('0x4d')];if(!_['isNil'](_0x3c6b77)&&!_['includes'](_0x1158e4,_0x3c6b77)){if(_[_0x34b3('0x3a')](this[_0x34b3('0x9')][_0x475bf4])){this[_0x34b3('0x9')][_0x475bf4]={};}this[_0x34b3('0x9')][_0x475bf4][_0x3c6b77]=_0x335e40;}};VoiceDialReport[_0x34b3('0x12')]['syncHangup']=function(_0x304d3c){try{if(this[_0x34b3('0x14')](_0x304d3c)){logger[_0x34b3('0x21')](_0x34b3('0x4e'),_0x304d3c[_0x34b3('0x16')],util[_0x34b3('0x23')](_0x304d3c,{'showHidden':![],'depth':null}));if(this[_0x34b3('0x18')][_0x304d3c[_0x34b3('0x16')]]){logger['info'](_0x34b3('0x4f'),_0x304d3c['uniqueid'],_0x304d3c[_0x34b3('0x50')]);this[_0x34b3('0x18')][_0x304d3c[_0x34b3('0x16')]][_0x34b3('0x51')]=moment()[_0x34b3('0x19')](_0x34b3('0x1a'));this['channels'][_0x304d3c['uniqueid']][_0x34b3('0x52')]=moment(this['channels'][_0x304d3c['uniqueid']]['endtime'])['diff'](this[_0x34b3('0x18')][_0x304d3c['uniqueid']]['starttime'],_0x34b3('0x53'));this[_0x34b3('0x18')][_0x304d3c['uniqueid']][_0x34b3('0x2d')]='complete';this[_0x34b3('0x8')]['total']+=0x1;if(this['channels'][_0x304d3c[_0x34b3('0x16')]][_0x34b3('0x2c')]){this[_0x34b3('0x8')]['answered']+=0x1;this[_0x34b3('0x18')][_0x304d3c[_0x34b3('0x16')]]['holdtime']=moment(this[_0x34b3('0x18')][_0x304d3c[_0x34b3('0x16')]][_0x34b3('0x2c')])[_0x34b3('0x54')](this[_0x34b3('0x18')][_0x304d3c[_0x34b3('0x16')]][_0x34b3('0x55')],_0x34b3('0x53'));this['channels'][_0x304d3c[_0x34b3('0x16')]][_0x34b3('0x56')]=moment(this['channels'][_0x304d3c[_0x34b3('0x16')]][_0x34b3('0x51')])[_0x34b3('0x54')](this[_0x34b3('0x18')][_0x304d3c['uniqueid']]['answertime'],'seconds');this['outbound'][_0x34b3('0x57')]+=this[_0x34b3('0x18')][_0x304d3c[_0x34b3('0x16')]][_0x34b3('0x58')]||0x0;this[_0x34b3('0x8')][_0x34b3('0x59')]+=this[_0x34b3('0x18')][_0x304d3c[_0x34b3('0x16')]][_0x34b3('0x56')];}this[_0x34b3('0x8')][_0x34b3('0x5a')]+=this[_0x34b3('0x18')][_0x304d3c[_0x34b3('0x16')]]['duration'];logger[_0x34b3('0x21')](_0x34b3('0x5b'),_0x304d3c['uniqueid'],util[_0x34b3('0x23')](this[_0x34b3('0x18')][_0x304d3c['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x34b3('0x13')](_0x34b3('0x5c'),this['channels'][_0x304d3c[_0x34b3('0x16')]]);logger[_0x34b3('0x21')](_0x34b3('0x5d'),_0x304d3c[_0x34b3('0x16')],util[_0x34b3('0x23')](this['channels'][_0x304d3c[_0x34b3('0x16')]],{'showHidden':![],'depth':null}));ami[_0x34b3('0x13')](_0x34b3('0x5e'),this[_0x34b3('0x18')][_0x304d3c[_0x34b3('0x16')]]);logger[_0x34b3('0x21')](_0x34b3('0x5f'),_0x304d3c['uniqueid'],util[_0x34b3('0x23')](this[_0x34b3('0x18')][_0x304d3c[_0x34b3('0x16')]],{'showHidden':![],'depth':null}));this[_0x34b3('0x13')](_0x34b3('0x24'),'voice_outbound:save',this[_0x34b3('0x8')]);logger[_0x34b3('0x20')](_0x34b3('0x60'),JSON[_0x34b3('0x61')](this[_0x34b3('0x18')][_0x304d3c[_0x34b3('0x16')]]));logger[_0x34b3('0x21')](_0x34b3('0x62'),_0x304d3c[_0x34b3('0x16')],util[_0x34b3('0x23')](this['channels'][_0x304d3c[_0x34b3('0x16')]],{'showHidden':![],'depth':null}));this['emit'](_0x34b3('0x24'),_0x34b3('0x63'),this['channels'][_0x304d3c[_0x34b3('0x16')]]);delete this['channels'][_0x304d3c['uniqueid']];}else if(this[_0x34b3('0x18')][_0x304d3c[_0x34b3('0x64')]]){this[_0x34b3('0x18')][_0x304d3c['linkedid']][_0x34b3('0x16')]=this[_0x34b3('0x18')][_0x304d3c[_0x34b3('0x64')]][_0x34b3('0x65')];}if(this[_0x34b3('0x9')][_0x304d3c[_0x34b3('0x16')]]){delete this[_0x34b3('0x9')][_0x304d3c[_0x34b3('0x16')]];}}}catch(_0x5ab16d){logger['error']('[%s][voiceDialReport][hangup]',_0x304d3c['uniqueid'],util[_0x34b3('0x23')](_0x5ab16d,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file