Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / services / ami / report / voiceDialReport.js
index 0b1c1d7..dac0ce4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1dca=['channel','substring','lastIndexOf','omit','event','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%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','ANSWER','connectedlinenum','connectedlinename','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]','addVariable','variable','value','outboundrouteid','info','keys','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','memberdynamic','memberinterface','memberrealtime','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','complete','total','answered','answertime','sumHoldTime','holdtime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','syncDialEnd','varset','syncVarSet','hangup','syncHangup','isNotNull','isUndefined','prototype','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called'];(function(_0xda6d80,_0x29d67f){var _0x24e778=function(_0x1d5d5e){while(--_0x1d5d5e){_0xda6d80['push'](_0xda6d80['shift']());}};_0x24e778(++_0x29d67f);}(_0x1dca,0x17a));var _0xa1dc=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0x1dca[_0x3aaf0a];return _0x33e6bc;};'use strict';var _=require(_0xa1dc('0x0'));var moment=require(_0xa1dc('0x1'));var util=require('util');var Redis=require(_0xa1dc('0x2'));var config=require(_0xa1dc('0x3'));var logger=require(_0xa1dc('0x4'))(_0xa1dc('0x5'));var ami=require(_0xa1dc('0x6'));config[_0xa1dc('0x7')]=_[_0xa1dc('0x8')](config[_0xa1dc('0x7')],{'host':_0xa1dc('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x6eda90){this[_0xa1dc('0xa')]=_0x6eda90[_0xa1dc('0xb')];this[_0xa1dc('0xc')]=_0x6eda90['outbound'];this[_0xa1dc('0xd')]={};ami['on'](_0xa1dc('0xe'),this[_0xa1dc('0xf')][_0xa1dc('0x10')](this));ami['on']('dialend',this[_0xa1dc('0x11')][_0xa1dc('0x10')](this));ami['on'](_0xa1dc('0x12'),this[_0xa1dc('0x13')][_0xa1dc('0x10')](this));ami['on'](_0xa1dc('0x14'),this[_0xa1dc('0x15')][_0xa1dc('0x10')](this));}VoiceDialReport['prototype'][_0xa1dc('0x16')]=function(_0x29f99c){return _0x29f99c!==null&&!_[_0xa1dc('0x17')](_0x29f99c);};VoiceDialReport[_0xa1dc('0x18')][_0xa1dc('0x19')]=function(_0x452b92,_0x458087,_0x1b7312){io['to'](_0x452b92)[_0xa1dc('0x19')](_0x458087,_0x1b7312);};VoiceDialReport[_0xa1dc('0x18')][_0xa1dc('0xf')]=function(_0x49bd91){try{if(this['isNotNull'](_0x49bd91)){logger[_0xa1dc('0x1a')](_0xa1dc('0x1b'),_0x49bd91[_0xa1dc('0x1c')],util[_0xa1dc('0x1d')](_0x49bd91,{'showHidden':![],'depth':null}));if(this['channels'][_0x49bd91[_0xa1dc('0x1c')]]){_[_0xa1dc('0x1e')](this[_0xa1dc('0xa')][_0x49bd91[_0xa1dc('0x1c')]],{'starttime':moment()[_0xa1dc('0x1f')](_0xa1dc('0x20')),'lastevent':_0xa1dc('0x21'),'interface':_0x49bd91[_0xa1dc('0x22')]['substring'](0x0,_0x49bd91[_0xa1dc('0x22')]['lastIndexOf']('-')),'membername':_0x49bd91['channel'][_0xa1dc('0x23')](_0x49bd91['channel']['lastIndexOf']('/')+0x1,_0x49bd91['channel'][_0xa1dc('0x24')]('-'))},_[_0xa1dc('0x25')](_0x49bd91,[_0xa1dc('0x26'),_0xa1dc('0x27')]));logger['info'](_0xa1dc('0x28'),_0x49bd91[_0xa1dc('0x1c')],this[_0xa1dc('0xa')][_0x49bd91['uniqueid']][_0xa1dc('0x29')],this[_0xa1dc('0xa')][_0x49bd91[_0xa1dc('0x1c')]][_0xa1dc('0x2a')]);logger[_0xa1dc('0x1a')](_0xa1dc('0x2b'),_0x49bd91[_0xa1dc('0x1c')],util['inspect'](this['channels'][_0x49bd91[_0xa1dc('0x1c')]],{'showHidden':![],'depth':null}));this[_0xa1dc('0x19')](_0xa1dc('0x2c'),_0xa1dc('0x2d'),this[_0xa1dc('0xa')][_0x49bd91[_0xa1dc('0x1c')]]);logger[_0xa1dc('0x1a')](_0xa1dc('0x2e'),_0x49bd91[_0xa1dc('0x1c')],util[_0xa1dc('0x1d')](this[_0xa1dc('0xa')][_0x49bd91[_0xa1dc('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xa1dc('0x19')](_0xa1dc('0x2f'),this[_0xa1dc('0xa')][_0x49bd91[_0xa1dc('0x1c')]]);}}}catch(_0x146b93){logger[_0xa1dc('0x30')](_0xa1dc('0x31'),_0x49bd91[_0xa1dc('0x1c')],util[_0xa1dc('0x1d')](_0x146b93,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa1dc('0x18')][_0xa1dc('0x11')]=function(_0x450953){try{if(this[_0xa1dc('0x16')](_0x450953)){logger['debug'](_0xa1dc('0x32'),_0x450953['uniqueid'],util[_0xa1dc('0x1d')](_0x450953,{'showHidden':![],'depth':null}));if(this['channels'][_0x450953[_0xa1dc('0x1c')]]){this[_0xa1dc('0xa')][_0x450953[_0xa1dc('0x1c')]]['dialstatus']=_0x450953[_0xa1dc('0x33')];if(_0x450953['dialstatus']===_0xa1dc('0x34')){this[_0xa1dc('0xa')][_0x450953[_0xa1dc('0x1c')]][_0xa1dc('0x35')]=_0x450953[_0xa1dc('0x35')];this[_0xa1dc('0xa')][_0x450953[_0xa1dc('0x1c')]][_0xa1dc('0x36')]=_0x450953[_0xa1dc('0x36')];this['channels'][_0x450953[_0xa1dc('0x1c')]]['answertime']=moment()[_0xa1dc('0x1f')](_0xa1dc('0x20'));this[_0xa1dc('0xa')][_0x450953[_0xa1dc('0x1c')]][_0xa1dc('0x37')]=_0xa1dc('0x38');logger['info'](_0xa1dc('0x39'),_0x450953[_0xa1dc('0x1c')],_0x450953[_0xa1dc('0x22')][_0xa1dc('0x23')](_0x450953[_0xa1dc('0x22')]['lastIndexOf']('/')+0x1,_0x450953[_0xa1dc('0x22')][_0xa1dc('0x24')]('-')));logger[_0xa1dc('0x1a')](_0xa1dc('0x3a'),_0x450953['uniqueid'],util[_0xa1dc('0x1d')](this[_0xa1dc('0xa')][_0x450953[_0xa1dc('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xa1dc('0x19')](_0xa1dc('0x3b'),this[_0xa1dc('0xa')][_0x450953[_0xa1dc('0x1c')]]);}logger[_0xa1dc('0x1a')](_0xa1dc('0x3c'),_0x450953[_0xa1dc('0x1c')],util['inspect'](this[_0xa1dc('0xa')][_0x450953['uniqueid']],{'showHidden':![],'depth':null}));this[_0xa1dc('0x19')](_0xa1dc('0x2c'),_0xa1dc('0x2d'),this[_0xa1dc('0xa')][_0x450953[_0xa1dc('0x1c')]]);}}}catch(_0x35c7a7){logger[_0xa1dc('0x30')](_0xa1dc('0x3d'),_0x450953[_0xa1dc('0x1c')],util[_0xa1dc('0x1d')](_0x35c7a7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa1dc('0x18')][_0xa1dc('0x13')]=function(_0x512131){try{if(this[_0xa1dc('0x16')](_0x512131)){logger[_0xa1dc('0x1a')]('[%s][voiceDialReport][varset]\x20event:',_0x512131[_0xa1dc('0x1c')],util[_0xa1dc('0x1d')](_0x512131,{'showHidden':![],'depth':null}));this[_0xa1dc('0x3e')](_0x512131[_0xa1dc('0x1c')],_['keys'](_0x512131[_0xa1dc('0x3f')])[0x0],_0x512131[_0xa1dc('0x40')]);if(this[_0xa1dc('0x16')](_0x512131[_0xa1dc('0x3f')])&&this[_0xa1dc('0x16')](_0x512131['variable'][_0xa1dc('0x41')])){if(_[_0xa1dc('0x17')](this[_0xa1dc('0xa')][_0x512131[_0xa1dc('0x1c')]])){this[_0xa1dc('0xa')][_0x512131[_0xa1dc('0x1c')]]={'routeId':_0x512131[_0xa1dc('0x40')],'variables':this[_0xa1dc('0xd')][_0x512131[_0xa1dc('0x1c')]]};logger[_0xa1dc('0x42')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x512131[_0xa1dc('0x1c')],_0x512131['variable']['outboundrouteid'],_[_0xa1dc('0x43')](_0x512131[_0xa1dc('0x3f')])[0x0],_0x512131['value']);logger[_0xa1dc('0x1a')](_0xa1dc('0x44'),_0x512131[_0xa1dc('0x1c')],util['inspect'](this[_0xa1dc('0xa')][_0x512131['uniqueid']],{'showHidden':![],'depth':null}));this[_0xa1dc('0x19')]('voice:outbound','voice_outbound_channel:save',this['channels'][_0x512131[_0xa1dc('0x1c')]]);}}}}catch(_0x562994){logger[_0xa1dc('0x30')](_0xa1dc('0x45'),_0x512131[_0xa1dc('0x1c')],util[_0xa1dc('0x1d')](_0x562994,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa1dc('0x18')]['addVariable']=function(_0x3c1729,_0x256414,_0x59d7bd){var _0x360ea5=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged',_0xa1dc('0x46'),'rtpaudioqoslossbridged',_0xa1dc('0x47'),_0xa1dc('0x48'),_0xa1dc('0x49'),_0xa1dc('0x4a'),'bridgepeer','bridgepvtcallid','membercalls',_0xa1dc('0x4b'),_0xa1dc('0x4c'),'memberlastcall',_0xa1dc('0x29'),'memberpenalty',_0xa1dc('0x4d')];if(!_['isNil'](_0x256414)&&!_[_0xa1dc('0x4e')](_0x360ea5,_0x256414)){if(_[_0xa1dc('0x17')](this[_0xa1dc('0xd')][_0x3c1729])){this[_0xa1dc('0xd')][_0x3c1729]={};}this[_0xa1dc('0xd')][_0x3c1729][_0x256414]=_0x59d7bd;}};VoiceDialReport[_0xa1dc('0x18')][_0xa1dc('0x15')]=function(_0x56ca63){try{if(this[_0xa1dc('0x16')](_0x56ca63)){logger[_0xa1dc('0x1a')](_0xa1dc('0x4f'),_0x56ca63['uniqueid'],util[_0xa1dc('0x1d')](_0x56ca63,{'showHidden':![],'depth':null}));if(this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]]){logger[_0xa1dc('0x42')](_0xa1dc('0x50'),_0x56ca63[_0xa1dc('0x1c')],_0x56ca63[_0xa1dc('0x51')]);this['channels'][_0x56ca63[_0xa1dc('0x1c')]][_0xa1dc('0x52')]=moment()['format'](_0xa1dc('0x20'));this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]][_0xa1dc('0x53')]=moment(this['channels'][_0x56ca63['uniqueid']]['endtime'])[_0xa1dc('0x54')](this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]][_0xa1dc('0x55')],_0xa1dc('0x56'));this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]][_0xa1dc('0x37')]=_0xa1dc('0x57');this[_0xa1dc('0xc')][_0xa1dc('0x58')]+=0x1;if(this[_0xa1dc('0xa')][_0x56ca63['uniqueid']]['answertime']){this[_0xa1dc('0xc')][_0xa1dc('0x59')]+=0x1;this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]]['holdtime']=moment(this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]][_0xa1dc('0x5a')])[_0xa1dc('0x54')](this['channels'][_0x56ca63[_0xa1dc('0x1c')]][_0xa1dc('0x55')],_0xa1dc('0x56'));this['channels'][_0x56ca63[_0xa1dc('0x1c')]]['billableseconds']=moment(this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]]['endtime'])['diff'](this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]][_0xa1dc('0x5a')],'seconds');this[_0xa1dc('0xc')][_0xa1dc('0x5b')]+=this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]][_0xa1dc('0x5c')]||0x0;this[_0xa1dc('0xc')][_0xa1dc('0x5d')]+=this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]]['billableseconds'];}this[_0xa1dc('0xc')][_0xa1dc('0x5e')]+=this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]]['duration'];logger[_0xa1dc('0x1a')](_0xa1dc('0x5f'),_0x56ca63[_0xa1dc('0x1c')],util[_0xa1dc('0x1d')](this['channels'][_0x56ca63[_0xa1dc('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xa1dc('0x19')](_0xa1dc('0x60'),this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]]);logger['debug'](_0xa1dc('0x61'),_0x56ca63[_0xa1dc('0x1c')],util[_0xa1dc('0x1d')](this[_0xa1dc('0xa')][_0x56ca63['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xa1dc('0x19')](_0xa1dc('0x62'),this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]]);logger[_0xa1dc('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x56ca63['uniqueid'],util[_0xa1dc('0x1d')](this['channels'][_0x56ca63['uniqueid']],{'showHidden':![],'depth':null}));this[_0xa1dc('0x19')](_0xa1dc('0x2c'),'voice_outbound:save',this[_0xa1dc('0xc')]);logger[_0xa1dc('0x42')](_0xa1dc('0x63'),JSON['stringify'](this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]]));logger[_0xa1dc('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x56ca63[_0xa1dc('0x1c')],util[_0xa1dc('0x1d')](this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x1c')]],{'showHidden':![],'depth':null}));this[_0xa1dc('0x19')](_0xa1dc('0x2c'),'voice_outbound_channel:remove',this[_0xa1dc('0xa')][_0x56ca63['uniqueid']]);delete this['channels'][_0x56ca63[_0xa1dc('0x1c')]];}else if(this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x64')]]){this['channels'][_0x56ca63[_0xa1dc('0x64')]][_0xa1dc('0x1c')]=this[_0xa1dc('0xa')][_0x56ca63[_0xa1dc('0x64')]][_0xa1dc('0x65')];}if(this[_0xa1dc('0xd')][_0x56ca63[_0xa1dc('0x1c')]]){delete this[_0xa1dc('0xd')][_0x56ca63[_0xa1dc('0x1c')]];}}}catch(_0xcc5126){logger[_0xa1dc('0x30')](_0xa1dc('0x66'),_0x56ca63[_0xa1dc('0x1c')],util['inspect'](_0xcc5126,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
+var _0x07e7=['variable','value','outboundrouteid','variables','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberrealtime','isNil','includes','isUndefined','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','complete','total','outbound','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','exports','lodash','moment','util','ioredis','ami','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','dialbegin','syncDialBegin','bind','dialend','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','emit','debug','uniqueid','merge','format','channel','substring','lastIndexOf','omit','event','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','voice:outbound','[%s][voiceDialReport][varset]\x20event:','addVariable','keys'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x07e7,0x1e2));var _0x707e=function(_0x2b1a2b,_0x31cdda){_0x2b1a2b=_0x2b1a2b-0x0;var _0x31422a=_0x07e7[_0x2b1a2b];return _0x31422a;};'use strict';var _=require(_0x707e('0x0'));var moment=require(_0x707e('0x1'));var util=require(_0x707e('0x2'));var Redis=require(_0x707e('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x707e('0x4'));var ami=require(_0x707e('0x5'));config['redis']=_['defaults'](config[_0x707e('0x6')],{'host':_0x707e('0x7'),'port':0x18eb});var io=require(_0x707e('0x8'))(new Redis(config[_0x707e('0x6')]));function VoiceDialReport(_0x1ef2da){this[_0x707e('0x9')]=_0x1ef2da[_0x707e('0xa')];this['outbound']=_0x1ef2da['outbound'];this['variables']={};ami['on'](_0x707e('0xb'),this[_0x707e('0xc')][_0x707e('0xd')](this));ami['on'](_0x707e('0xe'),this['syncDialEnd']['bind'](this));ami['on'](_0x707e('0xf'),this[_0x707e('0x10')][_0x707e('0xd')](this));ami['on'](_0x707e('0x11'),this[_0x707e('0x12')][_0x707e('0xd')](this));}VoiceDialReport[_0x707e('0x13')][_0x707e('0x14')]=function(_0x33688c){return _0x33688c!==null&&!_['isUndefined'](_0x33688c);};VoiceDialReport[_0x707e('0x13')][_0x707e('0x15')]=function(_0xa15bc4,_0xd86f74,_0x4f09b5){io['to'](_0xa15bc4)[_0x707e('0x15')](_0xd86f74,_0x4f09b5);};VoiceDialReport[_0x707e('0x13')][_0x707e('0xc')]=function(_0x15cc02){try{if(this[_0x707e('0x14')](_0x15cc02)){logger[_0x707e('0x16')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x15cc02[_0x707e('0x17')],util['inspect'](_0x15cc02,{'showHidden':![],'depth':null}));if(this[_0x707e('0x9')][_0x15cc02[_0x707e('0x17')]]){_[_0x707e('0x18')](this[_0x707e('0x9')][_0x15cc02[_0x707e('0x17')]],{'starttime':moment()[_0x707e('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','interface':_0x15cc02[_0x707e('0x1a')][_0x707e('0x1b')](0x0,_0x15cc02[_0x707e('0x1a')][_0x707e('0x1c')]('-')),'membername':_0x15cc02[_0x707e('0x1a')]['substring'](_0x15cc02[_0x707e('0x1a')]['lastIndexOf']('/')+0x1,_0x15cc02[_0x707e('0x1a')][_0x707e('0x1c')]('-'))},_[_0x707e('0x1d')](_0x15cc02,[_0x707e('0x1e'),'privilege']));logger[_0x707e('0x1f')](_0x707e('0x20'),_0x15cc02['uniqueid'],this[_0x707e('0x9')][_0x15cc02[_0x707e('0x17')]][_0x707e('0x21')],this[_0x707e('0x9')][_0x15cc02['uniqueid']][_0x707e('0x22')]);logger[_0x707e('0x16')](_0x707e('0x23'),_0x15cc02[_0x707e('0x17')],util[_0x707e('0x24')](this[_0x707e('0x9')][_0x15cc02['uniqueid']],{'showHidden':![],'depth':null}));this[_0x707e('0x15')]('voice:outbound','voice_outbound_channel:save',this[_0x707e('0x9')][_0x15cc02[_0x707e('0x17')]]);logger[_0x707e('0x16')](_0x707e('0x25'),_0x15cc02[_0x707e('0x17')],util[_0x707e('0x24')](this[_0x707e('0x9')][_0x15cc02[_0x707e('0x17')]],{'showHidden':![],'depth':null}));ami['emit'](_0x707e('0x26'),this[_0x707e('0x9')][_0x15cc02[_0x707e('0x17')]]);}}}catch(_0x3282bf){logger[_0x707e('0x27')](_0x707e('0x28'),_0x15cc02[_0x707e('0x17')],util[_0x707e('0x24')](_0x3282bf,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x707e('0x13')][_0x707e('0x29')]=function(_0x391eb6){try{if(this[_0x707e('0x14')](_0x391eb6)){logger[_0x707e('0x16')](_0x707e('0x2a'),_0x391eb6[_0x707e('0x17')],util[_0x707e('0x24')](_0x391eb6,{'showHidden':![],'depth':null}));if(this[_0x707e('0x9')][_0x391eb6[_0x707e('0x17')]]){this[_0x707e('0x9')][_0x391eb6[_0x707e('0x17')]][_0x707e('0x2b')]=_0x391eb6[_0x707e('0x2b')];if(_0x391eb6[_0x707e('0x2b')]===_0x707e('0x2c')){this['channels'][_0x391eb6[_0x707e('0x17')]][_0x707e('0x2d')]=_0x391eb6[_0x707e('0x2d')];this[_0x707e('0x9')][_0x391eb6['uniqueid']][_0x707e('0x2e')]=_0x391eb6[_0x707e('0x2e')];this[_0x707e('0x9')][_0x391eb6[_0x707e('0x17')]][_0x707e('0x2f')]=moment()['format'](_0x707e('0x30'));this['channels'][_0x391eb6['uniqueid']][_0x707e('0x31')]=_0x707e('0x32');logger['info'](_0x707e('0x33'),_0x391eb6[_0x707e('0x17')],_0x391eb6[_0x707e('0x1a')]['substring'](_0x391eb6[_0x707e('0x1a')][_0x707e('0x1c')]('/')+0x1,_0x391eb6['channel'][_0x707e('0x1c')]('-')));logger[_0x707e('0x16')](_0x707e('0x34'),_0x391eb6[_0x707e('0x17')],util[_0x707e('0x24')](this[_0x707e('0x9')][_0x391eb6['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x707e('0x15')](_0x707e('0x35'),this[_0x707e('0x9')][_0x391eb6[_0x707e('0x17')]]);}logger[_0x707e('0x16')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x391eb6[_0x707e('0x17')],util[_0x707e('0x24')](this[_0x707e('0x9')][_0x391eb6[_0x707e('0x17')]],{'showHidden':![],'depth':null}));this[_0x707e('0x15')](_0x707e('0x36'),'voice_outbound_channel:save',this[_0x707e('0x9')][_0x391eb6[_0x707e('0x17')]]);}}}catch(_0x142566){logger[_0x707e('0x27')]('[%s][voiceDialReport][dialend]',_0x391eb6['uniqueid'],util[_0x707e('0x24')](_0x142566,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x4d397d){try{if(this[_0x707e('0x14')](_0x4d397d)){logger[_0x707e('0x16')](_0x707e('0x37'),_0x4d397d[_0x707e('0x17')],util[_0x707e('0x24')](_0x4d397d,{'showHidden':![],'depth':null}));this[_0x707e('0x38')](_0x4d397d[_0x707e('0x17')],_[_0x707e('0x39')](_0x4d397d[_0x707e('0x3a')])[0x0],_0x4d397d[_0x707e('0x3b')]);if(this[_0x707e('0x14')](_0x4d397d[_0x707e('0x3a')])&&this[_0x707e('0x14')](_0x4d397d[_0x707e('0x3a')][_0x707e('0x3c')])){if(_['isUndefined'](this[_0x707e('0x9')][_0x4d397d[_0x707e('0x17')]])){this['channels'][_0x4d397d[_0x707e('0x17')]]={'routeId':_0x4d397d[_0x707e('0x3b')],'variables':this[_0x707e('0x3d')][_0x4d397d[_0x707e('0x17')]]};logger[_0x707e('0x1f')](_0x707e('0x3e'),_0x4d397d['uniqueid'],_0x4d397d[_0x707e('0x3a')][_0x707e('0x3c')],_['keys'](_0x4d397d[_0x707e('0x3a')])[0x0],_0x4d397d[_0x707e('0x3b')]);logger['debug'](_0x707e('0x3f'),_0x4d397d[_0x707e('0x17')],util[_0x707e('0x24')](this[_0x707e('0x9')][_0x4d397d[_0x707e('0x17')]],{'showHidden':![],'depth':null}));this['emit'](_0x707e('0x36'),'voice_outbound_channel:save',this[_0x707e('0x9')][_0x4d397d[_0x707e('0x17')]]);}}}}catch(_0x52841f){logger['error'](_0x707e('0x40'),_0x4d397d[_0x707e('0x17')],util[_0x707e('0x24')](_0x52841f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x707e('0x13')][_0x707e('0x38')]=function(_0x5af60e,_0x324dfe,_0xa2792b){var _0x2f6e39=[_0x707e('0x41'),'rtpaudioqosbridged',_0x707e('0x42'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x707e('0x43'),_0x707e('0x44'),_0x707e('0x45'),_0x707e('0x46'),_0x707e('0x47'),'bridgepeer',_0x707e('0x48'),_0x707e('0x49'),_0x707e('0x4a'),_0x707e('0x4b'),'memberlastcall',_0x707e('0x21'),'memberpenalty',_0x707e('0x4c')];if(!_[_0x707e('0x4d')](_0x324dfe)&&!_[_0x707e('0x4e')](_0x2f6e39,_0x324dfe)){if(_[_0x707e('0x4f')](this['variables'][_0x5af60e])){this[_0x707e('0x3d')][_0x5af60e]={};}this[_0x707e('0x3d')][_0x5af60e][_0x324dfe]=_0xa2792b;}};VoiceDialReport['prototype'][_0x707e('0x12')]=function(_0x56a971){try{if(this[_0x707e('0x14')](_0x56a971)){logger[_0x707e('0x16')](_0x707e('0x50'),_0x56a971[_0x707e('0x17')],util[_0x707e('0x24')](_0x56a971,{'showHidden':![],'depth':null}));if(this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]]){logger['info'](_0x707e('0x51'),_0x56a971['uniqueid'],_0x56a971[_0x707e('0x52')]);this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]][_0x707e('0x53')]=moment()[_0x707e('0x19')](_0x707e('0x30'));this[_0x707e('0x9')][_0x56a971['uniqueid']][_0x707e('0x54')]=moment(this[_0x707e('0x9')][_0x56a971['uniqueid']][_0x707e('0x53')])[_0x707e('0x55')](this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]][_0x707e('0x56')],_0x707e('0x57'));this[_0x707e('0x9')][_0x56a971['uniqueid']]['lastevent']=_0x707e('0x58');this['outbound'][_0x707e('0x59')]+=0x1;if(this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]][_0x707e('0x2f')]){this[_0x707e('0x5a')]['answered']+=0x1;this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]][_0x707e('0x5b')]=moment(this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]][_0x707e('0x2f')])[_0x707e('0x55')](this['channels'][_0x56a971[_0x707e('0x17')]][_0x707e('0x56')],_0x707e('0x57'));this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]][_0x707e('0x5c')]=moment(this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]]['endtime'])[_0x707e('0x55')](this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]][_0x707e('0x2f')],_0x707e('0x57'));this[_0x707e('0x5a')][_0x707e('0x5d')]+=this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]]['holdtime']||0x0;this['outbound'][_0x707e('0x5e')]+=this[_0x707e('0x9')][_0x56a971['uniqueid']]['billableseconds'];}this[_0x707e('0x5a')][_0x707e('0x5f')]+=this[_0x707e('0x9')][_0x56a971['uniqueid']]['duration'];logger[_0x707e('0x16')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x56a971['uniqueid'],util[_0x707e('0x24')](this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]],{'showHidden':![],'depth':null}));ami[_0x707e('0x15')](_0x707e('0x60'),this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]]);logger['debug'](_0x707e('0x61'),_0x56a971[_0x707e('0x17')],util[_0x707e('0x24')](this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]],{'showHidden':![],'depth':null}));ami[_0x707e('0x15')](_0x707e('0x62'),this['channels'][_0x56a971[_0x707e('0x17')]]);logger[_0x707e('0x16')](_0x707e('0x63'),_0x56a971['uniqueid'],util[_0x707e('0x24')](this['channels'][_0x56a971[_0x707e('0x17')]],{'showHidden':![],'depth':null}));this[_0x707e('0x15')](_0x707e('0x36'),_0x707e('0x64'),this[_0x707e('0x5a')]);logger['info'](_0x707e('0x65'),JSON[_0x707e('0x66')](this[_0x707e('0x9')][_0x56a971['uniqueid']]));logger[_0x707e('0x16')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x56a971[_0x707e('0x17')],util[_0x707e('0x24')](this[_0x707e('0x9')][_0x56a971['uniqueid']],{'showHidden':![],'depth':null}));this[_0x707e('0x15')](_0x707e('0x36'),_0x707e('0x67'),this[_0x707e('0x9')][_0x56a971[_0x707e('0x17')]]);delete this[_0x707e('0x9')][_0x56a971['uniqueid']];}else if(this['channels'][_0x56a971['linkedid']]){this[_0x707e('0x9')][_0x56a971[_0x707e('0x68')]][_0x707e('0x17')]=this[_0x707e('0x9')][_0x56a971['linkedid']][_0x707e('0x69')];}if(this[_0x707e('0x3d')][_0x56a971[_0x707e('0x17')]]){delete this[_0x707e('0x3d')][_0x56a971['uniqueid']];}}}catch(_0x31169a){logger['error'](_0x707e('0x6a'),_0x56a971[_0x707e('0x17')],util[_0x707e('0x24')](_0x31169a,{'showHidden':![],'depth':null}));}};module[_0x707e('0x6b')]=VoiceDialReport;
\ No newline at end of file