Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / services / ami / report / voiceDialReport.js
index 6b9a841..5509b68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc61e=['seconds','complete','total','answertime','answered','holdtime','sumHoldTime','sumBillable','billableseconds','sumDuration','duration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','socket.io-emitter','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','hangup','syncHangup','prototype','isNotNull','emit','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','channels','format','YYYY-MM-DD\x20HH:mm:ss','channel','lastIndexOf','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','debug','[%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]','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent','connect','info','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','substring','[%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:','variable','value','isUndefined','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','includes','[%s][voiceDialReport][hangup]\x20event:','cause-txt','endtime','diff','starttime'];(function(_0x17b2b7,_0x3c58ab){var _0x45ed4f=function(_0x564b46){while(--_0x564b46){_0x17b2b7['push'](_0x17b2b7['shift']());}};_0x45ed4f(++_0x3c58ab);}(_0xc61e,0xe7));var _0xec61=function(_0x38389d,_0x352691){_0x38389d=_0x38389d-0x0;var _0x34f74e=_0xc61e[_0x38389d];return _0x34f74e;};'use strict';var _=require(_0xec61('0x0'));var moment=require(_0xec61('0x1'));var util=require(_0xec61('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xec61('0x3'))('ami');var ami=require(_0xec61('0x4'));config[_0xec61('0x5')]=_[_0xec61('0x6')](config[_0xec61('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xec61('0x7'))(new Redis(config[_0xec61('0x5')]));function VoiceDialReport(_0x3e5583){this['channels']=_0x3e5583[_0xec61('0x8')];this['outbound']=_0x3e5583[_0xec61('0x9')];this[_0xec61('0xa')]={};ami['on'](_0xec61('0xb'),this[_0xec61('0xc')][_0xec61('0xd')](this));ami['on'](_0xec61('0xe'),this[_0xec61('0xf')][_0xec61('0xd')](this));ami['on'](_0xec61('0x10'),this['syncVarSet']['bind'](this));ami['on'](_0xec61('0x11'),this[_0xec61('0x12')][_0xec61('0xd')](this));}VoiceDialReport[_0xec61('0x13')][_0xec61('0x14')]=function(_0x31837c){return _0x31837c!==null&&!_['isUndefined'](_0x31837c);};VoiceDialReport[_0xec61('0x13')][_0xec61('0x15')]=function(_0xb4f172,_0xee178e,_0x1fc407){io['to'](_0xb4f172)[_0xec61('0x15')](_0xee178e,_0x1fc407);};VoiceDialReport[_0xec61('0x13')][_0xec61('0xc')]=function(_0xa1dcfa){try{if(this[_0xec61('0x14')](_0xa1dcfa)){logger['debug'](_0xec61('0x16'),_0xa1dcfa[_0xec61('0x17')],util[_0xec61('0x18')](_0xa1dcfa,{'showHidden':![],'depth':null}));if(this['channels'][_0xa1dcfa[_0xec61('0x17')]]){_[_0xec61('0x19')](this[_0xec61('0x1a')][_0xa1dcfa[_0xec61('0x17')]],{'starttime':moment()[_0xec61('0x1b')](_0xec61('0x1c')),'lastevent':'called','interface':_0xa1dcfa['channel']['substring'](0x0,_0xa1dcfa[_0xec61('0x1d')]['lastIndexOf']('-')),'membername':_0xa1dcfa[_0xec61('0x1d')]['substring'](_0xa1dcfa[_0xec61('0x1d')][_0xec61('0x1e')]('/')+0x1,_0xa1dcfa['channel'][_0xec61('0x1e')]('-'))},_['omit'](_0xa1dcfa,['event',_0xec61('0x1f')]));logger['info'](_0xec61('0x20'),_0xa1dcfa['uniqueid'],this[_0xec61('0x1a')][_0xa1dcfa[_0xec61('0x17')]]['membername'],this['channels'][_0xa1dcfa[_0xec61('0x17')]][_0xec61('0x21')]);logger[_0xec61('0x22')](_0xec61('0x23'),_0xa1dcfa[_0xec61('0x17')],util[_0xec61('0x18')](this[_0xec61('0x1a')][_0xa1dcfa[_0xec61('0x17')]],{'showHidden':![],'depth':null}));this['emit'](_0xec61('0x24'),_0xec61('0x25'),this[_0xec61('0x1a')][_0xa1dcfa[_0xec61('0x17')]]);logger[_0xec61('0x22')](_0xec61('0x26'),_0xa1dcfa[_0xec61('0x17')],util[_0xec61('0x18')](this[_0xec61('0x1a')][_0xa1dcfa[_0xec61('0x17')]],{'showHidden':![],'depth':null}));ami['emit'](_0xec61('0x27'),this[_0xec61('0x1a')][_0xa1dcfa[_0xec61('0x17')]]);}}}catch(_0x2ec23f){logger[_0xec61('0x28')](_0xec61('0x29'),_0xa1dcfa[_0xec61('0x17')],util['inspect'](_0x2ec23f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xec61('0x13')]['syncDialEnd']=function(_0x369678){try{if(this[_0xec61('0x14')](_0x369678)){logger[_0xec61('0x22')]('[%s][voiceDialReport][dialend]\x20event:',_0x369678['uniqueid'],util[_0xec61('0x18')](_0x369678,{'showHidden':![],'depth':null}));if(this[_0xec61('0x1a')][_0x369678[_0xec61('0x17')]]){this[_0xec61('0x1a')][_0x369678[_0xec61('0x17')]][_0xec61('0x2a')]=_0x369678[_0xec61('0x2a')];if(_0x369678['dialstatus']===_0xec61('0x2b')){this['channels'][_0x369678[_0xec61('0x17')]][_0xec61('0x2c')]=_0x369678['connectedlinenum'];this[_0xec61('0x1a')][_0x369678[_0xec61('0x17')]]['connectedlinename']=_0x369678[_0xec61('0x2d')];this['channels'][_0x369678[_0xec61('0x17')]]['answertime']=moment()['format'](_0xec61('0x1c'));this[_0xec61('0x1a')][_0x369678['uniqueid']][_0xec61('0x2e')]=_0xec61('0x2f');logger[_0xec61('0x30')](_0xec61('0x31'),_0x369678[_0xec61('0x17')],_0x369678[_0xec61('0x1d')][_0xec61('0x32')](_0x369678[_0xec61('0x1d')][_0xec61('0x1e')]('/')+0x1,_0x369678['channel'][_0xec61('0x1e')]('-')));logger['debug'](_0xec61('0x33'),_0x369678[_0xec61('0x17')],util[_0xec61('0x18')](this['channels'][_0x369678[_0xec61('0x17')]],{'showHidden':![],'depth':null}));ami[_0xec61('0x15')](_0xec61('0x34'),this[_0xec61('0x1a')][_0x369678[_0xec61('0x17')]]);}logger[_0xec61('0x22')](_0xec61('0x35'),_0x369678[_0xec61('0x17')],util['inspect'](this[_0xec61('0x1a')][_0x369678[_0xec61('0x17')]],{'showHidden':![],'depth':null}));this['emit'](_0xec61('0x24'),_0xec61('0x25'),this['channels'][_0x369678[_0xec61('0x17')]]);}}}catch(_0x786643){logger['error'](_0xec61('0x36'),_0x369678[_0xec61('0x17')],util['inspect'](_0x786643,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xec61('0x13')][_0xec61('0x37')]=function(_0x4b8e4e){try{if(this[_0xec61('0x14')](_0x4b8e4e)){logger[_0xec61('0x22')](_0xec61('0x38'),_0x4b8e4e['uniqueid'],util[_0xec61('0x18')](_0x4b8e4e,{'showHidden':![],'depth':null}));this['addVariable'](_0x4b8e4e['uniqueid'],_['keys'](_0x4b8e4e[_0xec61('0x39')])[0x0],_0x4b8e4e[_0xec61('0x3a')]);if(this[_0xec61('0x14')](_0x4b8e4e[_0xec61('0x39')])&&this[_0xec61('0x14')](_0x4b8e4e[_0xec61('0x39')]['outboundrouteid'])){if(_[_0xec61('0x3b')](this[_0xec61('0x1a')][_0x4b8e4e[_0xec61('0x17')]])){this[_0xec61('0x1a')][_0x4b8e4e['uniqueid']]={'routeId':_0x4b8e4e['value'],'variables':this[_0xec61('0xa')][_0x4b8e4e['uniqueid']]};logger[_0xec61('0x30')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x4b8e4e[_0xec61('0x17')],_0x4b8e4e['variable'][_0xec61('0x3c')],_['keys'](_0x4b8e4e[_0xec61('0x39')])[0x0],_0x4b8e4e[_0xec61('0x3a')]);logger['debug'](_0xec61('0x3d'),_0x4b8e4e['uniqueid'],util[_0xec61('0x18')](this[_0xec61('0x1a')][_0x4b8e4e[_0xec61('0x17')]],{'showHidden':![],'depth':null}));this[_0xec61('0x15')](_0xec61('0x24'),_0xec61('0x25'),this[_0xec61('0x1a')][_0x4b8e4e[_0xec61('0x17')]]);}}}}catch(_0x28ff94){logger[_0xec61('0x28')](_0xec61('0x3e'),_0x4b8e4e[_0xec61('0x17')],util[_0xec61('0x18')](_0x28ff94,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xec61('0x13')]['addVariable']=function(_0x1a2430,_0x334f03,_0x16da1f){var _0x296d89=['rtpaudioqos','rtpaudioqosbridged',_0xec61('0x3f'),'rtpaudioqosjitterbridged',_0xec61('0x40'),_0xec61('0x41'),_0xec61('0x42'),_0xec61('0x43'),_0xec61('0x44'),_0xec61('0x45'),_0xec61('0x46'),_0xec61('0x47'),_0xec61('0x48'),_0xec61('0x49'),_0xec61('0x4a'),_0xec61('0x4b'),_0xec61('0x4c'),_0xec61('0x4d'),'memberrealtime'];if(!_['isNil'](_0x334f03)&&!_[_0xec61('0x4e')](_0x296d89,_0x334f03)){if(_[_0xec61('0x3b')](this[_0xec61('0xa')][_0x1a2430])){this[_0xec61('0xa')][_0x1a2430]={};}this[_0xec61('0xa')][_0x1a2430][_0x334f03]=_0x16da1f;}};VoiceDialReport[_0xec61('0x13')]['syncHangup']=function(_0x334965){try{if(this[_0xec61('0x14')](_0x334965)){logger[_0xec61('0x22')](_0xec61('0x4f'),_0x334965['uniqueid'],util[_0xec61('0x18')](_0x334965,{'showHidden':![],'depth':null}));if(this['channels'][_0x334965[_0xec61('0x17')]]){logger[_0xec61('0x30')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x334965['uniqueid'],_0x334965[_0xec61('0x50')]);this[_0xec61('0x1a')][_0x334965['uniqueid']][_0xec61('0x51')]=moment()[_0xec61('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x334965['uniqueid']]['duration']=moment(this[_0xec61('0x1a')][_0x334965[_0xec61('0x17')]][_0xec61('0x51')])[_0xec61('0x52')](this[_0xec61('0x1a')][_0x334965[_0xec61('0x17')]][_0xec61('0x53')],_0xec61('0x54'));this[_0xec61('0x1a')][_0x334965['uniqueid']][_0xec61('0x2e')]=_0xec61('0x55');this[_0xec61('0x9')][_0xec61('0x56')]+=0x1;if(this[_0xec61('0x1a')][_0x334965[_0xec61('0x17')]][_0xec61('0x57')]){this[_0xec61('0x9')][_0xec61('0x58')]+=0x1;this['channels'][_0x334965[_0xec61('0x17')]][_0xec61('0x59')]=moment(this[_0xec61('0x1a')][_0x334965[_0xec61('0x17')]]['answertime'])[_0xec61('0x52')](this[_0xec61('0x1a')][_0x334965['uniqueid']][_0xec61('0x53')],_0xec61('0x54'));this[_0xec61('0x1a')][_0x334965[_0xec61('0x17')]]['billableseconds']=moment(this['channels'][_0x334965[_0xec61('0x17')]][_0xec61('0x51')])[_0xec61('0x52')](this[_0xec61('0x1a')][_0x334965[_0xec61('0x17')]][_0xec61('0x57')],_0xec61('0x54'));this['outbound'][_0xec61('0x5a')]+=this[_0xec61('0x1a')][_0x334965[_0xec61('0x17')]][_0xec61('0x59')]||0x0;this[_0xec61('0x9')][_0xec61('0x5b')]+=this[_0xec61('0x1a')][_0x334965['uniqueid']][_0xec61('0x5c')];}this[_0xec61('0x9')][_0xec61('0x5d')]+=this[_0xec61('0x1a')][_0x334965[_0xec61('0x17')]][_0xec61('0x5e')];logger[_0xec61('0x22')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x334965['uniqueid'],util[_0xec61('0x18')](this[_0xec61('0x1a')][_0x334965[_0xec61('0x17')]],{'showHidden':![],'depth':null}));ami['emit'](_0xec61('0x5f'),this[_0xec61('0x1a')][_0x334965[_0xec61('0x17')]]);logger[_0xec61('0x22')](_0xec61('0x60'),_0x334965[_0xec61('0x17')],util['inspect'](this['channels'][_0x334965[_0xec61('0x17')]],{'showHidden':![],'depth':null}));ami[_0xec61('0x15')]('custom:dialend',this[_0xec61('0x1a')][_0x334965[_0xec61('0x17')]]);logger[_0xec61('0x22')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x334965[_0xec61('0x17')],util[_0xec61('0x18')](this['channels'][_0x334965[_0xec61('0x17')]],{'showHidden':![],'depth':null}));this[_0xec61('0x15')](_0xec61('0x24'),'voice_outbound:save',this[_0xec61('0x9')]);logger[_0xec61('0x30')](_0xec61('0x61'),JSON[_0xec61('0x62')](this[_0xec61('0x1a')][_0x334965[_0xec61('0x17')]]));logger['debug'](_0xec61('0x63'),_0x334965[_0xec61('0x17')],util[_0xec61('0x18')](this[_0xec61('0x1a')][_0x334965[_0xec61('0x17')]],{'showHidden':![],'depth':null}));this[_0xec61('0x15')](_0xec61('0x24'),_0xec61('0x64'),this['channels'][_0x334965['uniqueid']]);delete this[_0xec61('0x1a')][_0x334965['uniqueid']];}else if(this[_0xec61('0x1a')][_0x334965[_0xec61('0x65')]]){this[_0xec61('0x1a')][_0x334965[_0xec61('0x65')]][_0xec61('0x17')]=this['channels'][_0x334965['linkedid']][_0xec61('0x66')];}if(this[_0xec61('0xa')][_0x334965[_0xec61('0x17')]]){delete this[_0xec61('0xa')][_0x334965['uniqueid']];}}}catch(_0xa54fa3){logger[_0xec61('0x28')](_0xec61('0x67'),_0x334965[_0xec61('0x17')],util['inspect'](_0xa54fa3,{'showHidden':![],'depth':null}));}};module[_0xec61('0x68')]=VoiceDialReport;
\ No newline at end of file
+var _0x9fa8=['[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','exports','moment','../../../config/environment','../../../config/logger','../ami','redis','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','event','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','uniqueid','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','info','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%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:','voice:outbound','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberinterface','membername','memberpenalty','memberrealtime','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','starttime','seconds','complete','total','diff','billableseconds','sumHoldTime','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:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify'];(function(_0x40b587,_0x595537){var _0x2e78b3=function(_0x259a5d){while(--_0x259a5d){_0x40b587['push'](_0x40b587['shift']());}};_0x2e78b3(++_0x595537);}(_0x9fa8,0x13e));var _0x89fa=function(_0x3814ea,_0x5200d4){_0x3814ea=_0x3814ea-0x0;var _0x3f0a37=_0x9fa8[_0x3814ea];return _0x3f0a37;};'use strict';var _=require('lodash');var moment=require(_0x89fa('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x89fa('0x1'));var logger=require(_0x89fa('0x2'))('ami');var ami=require(_0x89fa('0x3'));config['redis']=_['defaults'](config[_0x89fa('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x89fa('0x5'))(new Redis(config[_0x89fa('0x4')]));function VoiceDialReport(_0x38a5e1){this[_0x89fa('0x6')]=_0x38a5e1[_0x89fa('0x7')];this[_0x89fa('0x8')]=_0x38a5e1['outbound'];this[_0x89fa('0x9')]={};ami['on'](_0x89fa('0xa'),this[_0x89fa('0xb')][_0x89fa('0xc')](this));ami['on'](_0x89fa('0xd'),this[_0x89fa('0xe')][_0x89fa('0xc')](this));ami['on'](_0x89fa('0xf'),this['syncVarSet'][_0x89fa('0xc')](this));ami['on'](_0x89fa('0x10'),this[_0x89fa('0x11')][_0x89fa('0xc')](this));}VoiceDialReport[_0x89fa('0x12')][_0x89fa('0x13')]=function(_0xd14006){return _0xd14006!==null&&!_[_0x89fa('0x14')](_0xd14006);};VoiceDialReport[_0x89fa('0x12')]['emit']=function(_0x510f90,_0xa7dc91,_0x4fb290){io['to'](_0x510f90)[_0x89fa('0x15')](_0xa7dc91,_0x4fb290);};VoiceDialReport[_0x89fa('0x12')][_0x89fa('0xb')]=function(_0x3e7c8d){try{if(this[_0x89fa('0x13')](_0x3e7c8d)){logger[_0x89fa('0x16')](_0x89fa('0x17'),_0x3e7c8d['uniqueid'],util[_0x89fa('0x18')](_0x3e7c8d,{'showHidden':![],'depth':null}));if(this[_0x89fa('0x6')][_0x3e7c8d['uniqueid']]){_['merge'](this[_0x89fa('0x6')][_0x3e7c8d['uniqueid']],{'starttime':moment()[_0x89fa('0x19')](_0x89fa('0x1a')),'lastevent':_0x89fa('0x1b'),'interface':_0x3e7c8d['channel'][_0x89fa('0x1c')](0x0,_0x3e7c8d[_0x89fa('0x1d')][_0x89fa('0x1e')]('-')),'membername':_0x3e7c8d['channel'][_0x89fa('0x1c')](_0x3e7c8d[_0x89fa('0x1d')]['lastIndexOf']('/')+0x1,_0x3e7c8d[_0x89fa('0x1d')][_0x89fa('0x1e')]('-'))},_[_0x89fa('0x1f')](_0x3e7c8d,[_0x89fa('0x20'),_0x89fa('0x21')]));logger['info'](_0x89fa('0x22'),_0x3e7c8d['uniqueid'],this[_0x89fa('0x6')][_0x3e7c8d[_0x89fa('0x23')]]['membername'],this[_0x89fa('0x6')][_0x3e7c8d[_0x89fa('0x23')]][_0x89fa('0x24')]);logger[_0x89fa('0x16')](_0x89fa('0x25'),_0x3e7c8d[_0x89fa('0x23')],util[_0x89fa('0x18')](this[_0x89fa('0x6')][_0x3e7c8d['uniqueid']],{'showHidden':![],'depth':null}));this[_0x89fa('0x15')]('voice:outbound',_0x89fa('0x26'),this[_0x89fa('0x6')][_0x3e7c8d[_0x89fa('0x23')]]);logger['debug'](_0x89fa('0x27'),_0x3e7c8d['uniqueid'],util[_0x89fa('0x18')](this[_0x89fa('0x6')][_0x3e7c8d[_0x89fa('0x23')]],{'showHidden':![],'depth':null}));ami[_0x89fa('0x15')](_0x89fa('0x28'),this[_0x89fa('0x6')][_0x3e7c8d['uniqueid']]);}}}catch(_0x960480){logger[_0x89fa('0x29')]('[%s][voiceDialReport][dialbegin]',_0x3e7c8d['uniqueid'],util[_0x89fa('0x18')](_0x960480,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x89fa('0x12')][_0x89fa('0xe')]=function(_0x4fdf58){try{if(this[_0x89fa('0x13')](_0x4fdf58)){logger[_0x89fa('0x16')]('[%s][voiceDialReport][dialend]\x20event:',_0x4fdf58[_0x89fa('0x23')],util[_0x89fa('0x18')](_0x4fdf58,{'showHidden':![],'depth':null}));if(this[_0x89fa('0x6')][_0x4fdf58[_0x89fa('0x23')]]){this[_0x89fa('0x6')][_0x4fdf58[_0x89fa('0x23')]][_0x89fa('0x2a')]=_0x4fdf58[_0x89fa('0x2a')];if(_0x4fdf58[_0x89fa('0x2a')]===_0x89fa('0x2b')){this[_0x89fa('0x6')][_0x4fdf58[_0x89fa('0x23')]][_0x89fa('0x2c')]=_0x4fdf58['connectedlinenum'];this['channels'][_0x4fdf58[_0x89fa('0x23')]][_0x89fa('0x2d')]=_0x4fdf58[_0x89fa('0x2d')];this[_0x89fa('0x6')][_0x4fdf58[_0x89fa('0x23')]][_0x89fa('0x2e')]=moment()['format'](_0x89fa('0x1a'));this[_0x89fa('0x6')][_0x4fdf58[_0x89fa('0x23')]]['lastevent']=_0x89fa('0x2f');logger[_0x89fa('0x30')](_0x89fa('0x31'),_0x4fdf58[_0x89fa('0x23')],_0x4fdf58[_0x89fa('0x1d')][_0x89fa('0x1c')](_0x4fdf58[_0x89fa('0x1d')][_0x89fa('0x1e')]('/')+0x1,_0x4fdf58[_0x89fa('0x1d')][_0x89fa('0x1e')]('-')));logger[_0x89fa('0x16')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x4fdf58['uniqueid'],util[_0x89fa('0x18')](this[_0x89fa('0x6')][_0x4fdf58[_0x89fa('0x23')]],{'showHidden':![],'depth':null}));ami[_0x89fa('0x15')]('custom:dialconnect',this['channels'][_0x4fdf58['uniqueid']]);}logger[_0x89fa('0x16')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x4fdf58[_0x89fa('0x23')],util[_0x89fa('0x18')](this[_0x89fa('0x6')][_0x4fdf58[_0x89fa('0x23')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x89fa('0x26'),this['channels'][_0x4fdf58[_0x89fa('0x23')]]);}}}catch(_0x181172){logger['error'](_0x89fa('0x32'),_0x4fdf58[_0x89fa('0x23')],util['inspect'](_0x181172,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x89fa('0x12')][_0x89fa('0x33')]=function(_0x49f82f){try{if(this[_0x89fa('0x13')](_0x49f82f)){logger[_0x89fa('0x16')](_0x89fa('0x34'),_0x49f82f['uniqueid'],util[_0x89fa('0x18')](_0x49f82f,{'showHidden':![],'depth':null}));this[_0x89fa('0x35')](_0x49f82f[_0x89fa('0x23')],_[_0x89fa('0x36')](_0x49f82f[_0x89fa('0x37')])[0x0],_0x49f82f[_0x89fa('0x38')]);if(this[_0x89fa('0x13')](_0x49f82f['variable'])&&this[_0x89fa('0x13')](_0x49f82f[_0x89fa('0x37')][_0x89fa('0x39')])){if(_['isUndefined'](this[_0x89fa('0x6')][_0x49f82f[_0x89fa('0x23')]])){this[_0x89fa('0x6')][_0x49f82f[_0x89fa('0x23')]]={'routeId':_0x49f82f[_0x89fa('0x38')],'variables':this[_0x89fa('0x9')][_0x49f82f['uniqueid']]};logger['info'](_0x89fa('0x3a'),_0x49f82f['uniqueid'],_0x49f82f[_0x89fa('0x37')][_0x89fa('0x39')],_['keys'](_0x49f82f['variable'])[0x0],_0x49f82f[_0x89fa('0x38')]);logger[_0x89fa('0x16')](_0x89fa('0x3b'),_0x49f82f['uniqueid'],util[_0x89fa('0x18')](this[_0x89fa('0x6')][_0x49f82f['uniqueid']],{'showHidden':![],'depth':null}));this[_0x89fa('0x15')](_0x89fa('0x3c'),_0x89fa('0x26'),this['channels'][_0x49f82f[_0x89fa('0x23')]]);}}}}catch(_0x31ba36){logger[_0x89fa('0x29')](_0x89fa('0x3d'),_0x49f82f[_0x89fa('0x23')],util[_0x89fa('0x18')](_0x31ba36,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x89fa('0x12')][_0x89fa('0x35')]=function(_0x105178,_0x344104,_0x545bc8){var _0x409227=[_0x89fa('0x3e'),_0x89fa('0x3f'),'rtpaudioqosjitter',_0x89fa('0x40'),_0x89fa('0x41'),_0x89fa('0x42'),'rtpaudioqosrtt',_0x89fa('0x43'),_0x89fa('0x44'),_0x89fa('0x45'),_0x89fa('0x46'),'bridgepvtcallid',_0x89fa('0x47'),'memberdynamic',_0x89fa('0x48'),'memberlastcall',_0x89fa('0x49'),_0x89fa('0x4a'),_0x89fa('0x4b')];if(!_['isNil'](_0x344104)&&!_[_0x89fa('0x4c')](_0x409227,_0x344104)){if(_[_0x89fa('0x14')](this['variables'][_0x105178])){this[_0x89fa('0x9')][_0x105178]={};}this[_0x89fa('0x9')][_0x105178][_0x344104]=_0x545bc8;}};VoiceDialReport[_0x89fa('0x12')][_0x89fa('0x11')]=function(_0x162350){try{if(this['isNotNull'](_0x162350)){logger[_0x89fa('0x16')](_0x89fa('0x4d'),_0x162350[_0x89fa('0x23')],util['inspect'](_0x162350,{'showHidden':![],'depth':null}));if(this[_0x89fa('0x6')][_0x162350[_0x89fa('0x23')]]){logger['info'](_0x89fa('0x4e'),_0x162350[_0x89fa('0x23')],_0x162350[_0x89fa('0x4f')]);this[_0x89fa('0x6')][_0x162350[_0x89fa('0x23')]][_0x89fa('0x50')]=moment()[_0x89fa('0x19')](_0x89fa('0x1a'));this[_0x89fa('0x6')][_0x162350[_0x89fa('0x23')]][_0x89fa('0x51')]=moment(this[_0x89fa('0x6')][_0x162350[_0x89fa('0x23')]][_0x89fa('0x50')])['diff'](this[_0x89fa('0x6')][_0x162350['uniqueid']][_0x89fa('0x52')],_0x89fa('0x53'));this[_0x89fa('0x6')][_0x162350[_0x89fa('0x23')]]['lastevent']=_0x89fa('0x54');this[_0x89fa('0x8')][_0x89fa('0x55')]+=0x1;if(this['channels'][_0x162350[_0x89fa('0x23')]][_0x89fa('0x2e')]){this[_0x89fa('0x8')]['answered']+=0x1;this['channels'][_0x162350['uniqueid']]['holdtime']=moment(this[_0x89fa('0x6')][_0x162350[_0x89fa('0x23')]]['answertime'])[_0x89fa('0x56')](this[_0x89fa('0x6')][_0x162350[_0x89fa('0x23')]]['starttime'],_0x89fa('0x53'));this[_0x89fa('0x6')][_0x162350['uniqueid']][_0x89fa('0x57')]=moment(this[_0x89fa('0x6')][_0x162350['uniqueid']][_0x89fa('0x50')])[_0x89fa('0x56')](this['channels'][_0x162350[_0x89fa('0x23')]][_0x89fa('0x2e')],_0x89fa('0x53'));this[_0x89fa('0x8')][_0x89fa('0x58')]+=this[_0x89fa('0x6')][_0x162350[_0x89fa('0x23')]]['holdtime']||0x0;this[_0x89fa('0x8')]['sumBillable']+=this[_0x89fa('0x6')][_0x162350[_0x89fa('0x23')]][_0x89fa('0x57')];}this[_0x89fa('0x8')][_0x89fa('0x59')]+=this['channels'][_0x162350[_0x89fa('0x23')]][_0x89fa('0x51')];logger['debug'](_0x89fa('0x5a'),_0x162350[_0x89fa('0x23')],util[_0x89fa('0x18')](this['channels'][_0x162350['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x89fa('0x15')](_0x89fa('0x5b'),this['channels'][_0x162350[_0x89fa('0x23')]]);logger[_0x89fa('0x16')](_0x89fa('0x5c'),_0x162350[_0x89fa('0x23')],util['inspect'](this['channels'][_0x162350[_0x89fa('0x23')]],{'showHidden':![],'depth':null}));ami[_0x89fa('0x15')](_0x89fa('0x5d'),this[_0x89fa('0x6')][_0x162350['uniqueid']]);logger[_0x89fa('0x16')](_0x89fa('0x5e'),_0x162350['uniqueid'],util[_0x89fa('0x18')](this[_0x89fa('0x6')][_0x162350[_0x89fa('0x23')]],{'showHidden':![],'depth':null}));this[_0x89fa('0x15')](_0x89fa('0x3c'),_0x89fa('0x5f'),this[_0x89fa('0x8')]);logger[_0x89fa('0x30')](_0x89fa('0x60'),JSON[_0x89fa('0x61')](this['channels'][_0x162350[_0x89fa('0x23')]]));logger[_0x89fa('0x16')](_0x89fa('0x62'),_0x162350[_0x89fa('0x23')],util[_0x89fa('0x18')](this[_0x89fa('0x6')][_0x162350[_0x89fa('0x23')]],{'showHidden':![],'depth':null}));this[_0x89fa('0x15')]('voice:outbound',_0x89fa('0x63'),this[_0x89fa('0x6')][_0x162350[_0x89fa('0x23')]]);delete this[_0x89fa('0x6')][_0x162350[_0x89fa('0x23')]];}else if(this[_0x89fa('0x6')][_0x162350[_0x89fa('0x64')]]){this[_0x89fa('0x6')][_0x162350['linkedid']][_0x89fa('0x23')]=this['channels'][_0x162350['linkedid']][_0x89fa('0x65')];}if(this[_0x89fa('0x9')][_0x162350[_0x89fa('0x23')]]){delete this[_0x89fa('0x9')][_0x162350[_0x89fa('0x23')]];}}}catch(_0x53a012){logger[_0x89fa('0x29')](_0x89fa('0x66'),_0x162350['uniqueid'],util[_0x89fa('0x18')](_0x53a012,{'showHidden':![],'depth':null}));}};module[_0x89fa('0x67')]=VoiceDialReport;
\ No newline at end of file