Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / services / ami / report / voiceDialReport.js
index 35c0a35..1546649 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ec4=['memberlastcall','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','seconds','lastevent','complete','answered','holdtime','sumHoldTime','sumBillable','billableseconds','sumDuration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','stringify','voice_outbound_channel:remove','linkedid','destuniqueid','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','syncDialBegin','bind','dialend','varset','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','info','[%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','addVariable','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface'];(function(_0x30f558,_0x16548e){var _0x5750b1=function(_0x3fe029){while(--_0x3fe029){_0x30f558['push'](_0x30f558['shift']());}};_0x5750b1(++_0x16548e);}(_0x4ec4,0x159));var _0x44ec=function(_0x174f7e,_0x501f15){_0x174f7e=_0x174f7e-0x0;var _0x3a09fa=_0x4ec4[_0x174f7e];return _0x3a09fa;};'use strict';var _=require(_0x44ec('0x0'));var moment=require(_0x44ec('0x1'));var util=require(_0x44ec('0x2'));var Redis=require('ioredis');var config=require(_0x44ec('0x3'));var logger=require(_0x44ec('0x4'))(_0x44ec('0x5'));var ami=require(_0x44ec('0x6'));config[_0x44ec('0x7')]=_[_0x44ec('0x8')](config[_0x44ec('0x7')],{'host':_0x44ec('0x9'),'port':0x18eb});var io=require(_0x44ec('0xa'))(new Redis(config['redis']));function VoiceDialReport(_0x72491e){this[_0x44ec('0xb')]=_0x72491e[_0x44ec('0xc')];this['outbound']=_0x72491e[_0x44ec('0xd')];this[_0x44ec('0xe')]={};ami['on']('dialbegin',this[_0x44ec('0xf')][_0x44ec('0x10')](this));ami['on'](_0x44ec('0x11'),this['syncDialEnd']['bind'](this));ami['on'](_0x44ec('0x12'),this['syncVarSet'][_0x44ec('0x10')](this));ami['on'](_0x44ec('0x13'),this[_0x44ec('0x14')][_0x44ec('0x10')](this));}VoiceDialReport[_0x44ec('0x15')][_0x44ec('0x16')]=function(_0x36aca9){return _0x36aca9!==null&&!_[_0x44ec('0x17')](_0x36aca9);};VoiceDialReport['prototype'][_0x44ec('0x18')]=function(_0x3bfcde,_0x25545c,_0xbda3b1){io['to'](_0x3bfcde)[_0x44ec('0x18')](_0x25545c,_0xbda3b1);};VoiceDialReport[_0x44ec('0x15')][_0x44ec('0xf')]=function(_0x445a0e){try{if(this[_0x44ec('0x16')](_0x445a0e)){logger[_0x44ec('0x19')](_0x44ec('0x1a'),_0x445a0e[_0x44ec('0x1b')],util['inspect'](_0x445a0e,{'showHidden':![],'depth':null}));if(this[_0x44ec('0xb')][_0x445a0e['uniqueid']]){_['merge'](this['channels'][_0x445a0e['uniqueid']],{'starttime':moment()[_0x44ec('0x1c')](_0x44ec('0x1d')),'lastevent':_0x44ec('0x1e'),'interface':_0x445a0e[_0x44ec('0x1f')][_0x44ec('0x20')](0x0,_0x445a0e[_0x44ec('0x1f')][_0x44ec('0x21')]('-')),'membername':_0x445a0e[_0x44ec('0x1f')]['substring'](_0x445a0e[_0x44ec('0x1f')][_0x44ec('0x21')]('/')+0x1,_0x445a0e[_0x44ec('0x1f')][_0x44ec('0x21')]('-'))},_[_0x44ec('0x22')](_0x445a0e,['event','privilege']));logger['info']('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x445a0e[_0x44ec('0x1b')],this[_0x44ec('0xb')][_0x445a0e['uniqueid']][_0x44ec('0x23')],this['channels'][_0x445a0e['uniqueid']][_0x44ec('0x24')]);logger[_0x44ec('0x19')](_0x44ec('0x25'),_0x445a0e[_0x44ec('0x1b')],util[_0x44ec('0x26')](this['channels'][_0x445a0e[_0x44ec('0x1b')]],{'showHidden':![],'depth':null}));this['emit'](_0x44ec('0x27'),_0x44ec('0x28'),this[_0x44ec('0xb')][_0x445a0e[_0x44ec('0x1b')]]);logger[_0x44ec('0x19')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x445a0e[_0x44ec('0x1b')],util['inspect'](this[_0x44ec('0xb')][_0x445a0e[_0x44ec('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x44ec('0x18')](_0x44ec('0x29'),this['channels'][_0x445a0e['uniqueid']]);}}}catch(_0xdecc4a){logger[_0x44ec('0x2a')](_0x44ec('0x2b'),_0x445a0e[_0x44ec('0x1b')],util['inspect'](_0xdecc4a,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x44ec('0x15')][_0x44ec('0x2c')]=function(_0x2731d0){try{if(this[_0x44ec('0x16')](_0x2731d0)){logger[_0x44ec('0x19')](_0x44ec('0x2d'),_0x2731d0['uniqueid'],util[_0x44ec('0x26')](_0x2731d0,{'showHidden':![],'depth':null}));if(this[_0x44ec('0xb')][_0x2731d0[_0x44ec('0x1b')]]){this[_0x44ec('0xb')][_0x2731d0['uniqueid']][_0x44ec('0x2e')]=_0x2731d0[_0x44ec('0x2e')];if(_0x2731d0[_0x44ec('0x2e')]===_0x44ec('0x2f')){this[_0x44ec('0xb')][_0x2731d0[_0x44ec('0x1b')]][_0x44ec('0x30')]=_0x2731d0[_0x44ec('0x30')];this[_0x44ec('0xb')][_0x2731d0[_0x44ec('0x1b')]][_0x44ec('0x31')]=_0x2731d0[_0x44ec('0x31')];this[_0x44ec('0xb')][_0x2731d0['uniqueid']][_0x44ec('0x32')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x44ec('0xb')][_0x2731d0['uniqueid']]['lastevent']=_0x44ec('0x33');logger[_0x44ec('0x34')](_0x44ec('0x35'),_0x2731d0[_0x44ec('0x1b')],_0x2731d0[_0x44ec('0x1f')][_0x44ec('0x20')](_0x2731d0[_0x44ec('0x1f')][_0x44ec('0x21')]('/')+0x1,_0x2731d0[_0x44ec('0x1f')][_0x44ec('0x21')]('-')));logger['debug'](_0x44ec('0x36'),_0x2731d0['uniqueid'],util['inspect'](this[_0x44ec('0xb')][_0x2731d0['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x44ec('0x18')](_0x44ec('0x37'),this[_0x44ec('0xb')][_0x2731d0[_0x44ec('0x1b')]]);}logger[_0x44ec('0x19')](_0x44ec('0x38'),_0x2731d0['uniqueid'],util[_0x44ec('0x26')](this['channels'][_0x2731d0[_0x44ec('0x1b')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x44ec('0x28'),this[_0x44ec('0xb')][_0x2731d0[_0x44ec('0x1b')]]);}}}catch(_0x1d4d73){logger[_0x44ec('0x2a')](_0x44ec('0x39'),_0x2731d0['uniqueid'],util[_0x44ec('0x26')](_0x1d4d73,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x44ec('0x3a')]=function(_0x5548e6){try{if(this['isNotNull'](_0x5548e6)){logger[_0x44ec('0x19')]('[%s][voiceDialReport][varset]\x20event:',_0x5548e6[_0x44ec('0x1b')],util['inspect'](_0x5548e6,{'showHidden':![],'depth':null}));this[_0x44ec('0x3b')](_0x5548e6[_0x44ec('0x1b')],_[_0x44ec('0x3c')](_0x5548e6[_0x44ec('0x3d')])[0x0],_0x5548e6[_0x44ec('0x3e')]);if(this[_0x44ec('0x16')](_0x5548e6['variable'])&&this[_0x44ec('0x16')](_0x5548e6['variable'][_0x44ec('0x3f')])){if(_[_0x44ec('0x17')](this[_0x44ec('0xb')][_0x5548e6[_0x44ec('0x1b')]])){this[_0x44ec('0xb')][_0x5548e6['uniqueid']]={'routeId':_0x5548e6[_0x44ec('0x3e')],'variables':this[_0x44ec('0xe')][_0x5548e6[_0x44ec('0x1b')]]};logger['info'](_0x44ec('0x40'),_0x5548e6[_0x44ec('0x1b')],_0x5548e6[_0x44ec('0x3d')][_0x44ec('0x3f')],_['keys'](_0x5548e6[_0x44ec('0x3d')])[0x0],_0x5548e6[_0x44ec('0x3e')]);logger['debug']('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x5548e6[_0x44ec('0x1b')],util['inspect'](this[_0x44ec('0xb')][_0x5548e6['uniqueid']],{'showHidden':![],'depth':null}));this[_0x44ec('0x18')]('voice:outbound','voice_outbound_channel:save',this[_0x44ec('0xb')][_0x5548e6['uniqueid']]);}}}}catch(_0x8d3436){logger['error'](_0x44ec('0x41'),_0x5548e6[_0x44ec('0x1b')],util['inspect'](_0x8d3436,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x44ec('0x15')]['addVariable']=function(_0x1a11fa,_0x503e96,_0xa77ceb){var _0x10001f=[_0x44ec('0x42'),_0x44ec('0x43'),_0x44ec('0x44'),_0x44ec('0x45'),_0x44ec('0x46'),_0x44ec('0x47'),_0x44ec('0x48'),_0x44ec('0x49'),'sipcallid',_0x44ec('0x4a'),_0x44ec('0x4b'),_0x44ec('0x4c'),'membercalls',_0x44ec('0x4d'),_0x44ec('0x4e'),_0x44ec('0x4f'),_0x44ec('0x23'),'memberpenalty','memberrealtime'];if(!_['isNil'](_0x503e96)&&!_[_0x44ec('0x50')](_0x10001f,_0x503e96)){if(_[_0x44ec('0x17')](this[_0x44ec('0xe')][_0x1a11fa])){this[_0x44ec('0xe')][_0x1a11fa]={};}this[_0x44ec('0xe')][_0x1a11fa][_0x503e96]=_0xa77ceb;}};VoiceDialReport['prototype'][_0x44ec('0x14')]=function(_0x4fe254){try{if(this[_0x44ec('0x16')](_0x4fe254)){logger[_0x44ec('0x19')](_0x44ec('0x51'),_0x4fe254[_0x44ec('0x1b')],util[_0x44ec('0x26')](_0x4fe254,{'showHidden':![],'depth':null}));if(this['channels'][_0x4fe254['uniqueid']]){logger[_0x44ec('0x34')](_0x44ec('0x52'),_0x4fe254[_0x44ec('0x1b')],_0x4fe254[_0x44ec('0x53')]);this['channels'][_0x4fe254[_0x44ec('0x1b')]][_0x44ec('0x54')]=moment()['format'](_0x44ec('0x1d'));this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]][_0x44ec('0x55')]=moment(this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]][_0x44ec('0x54')])[_0x44ec('0x56')](this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]]['starttime'],_0x44ec('0x57'));this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]][_0x44ec('0x58')]=_0x44ec('0x59');this['outbound']['total']+=0x1;if(this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]][_0x44ec('0x32')]){this[_0x44ec('0xd')][_0x44ec('0x5a')]+=0x1;this['channels'][_0x4fe254[_0x44ec('0x1b')]][_0x44ec('0x5b')]=moment(this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]][_0x44ec('0x32')])[_0x44ec('0x56')](this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]]['starttime'],_0x44ec('0x57'));this['channels'][_0x4fe254[_0x44ec('0x1b')]]['billableseconds']=moment(this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]][_0x44ec('0x54')])[_0x44ec('0x56')](this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]][_0x44ec('0x32')],'seconds');this[_0x44ec('0xd')][_0x44ec('0x5c')]+=this['channels'][_0x4fe254[_0x44ec('0x1b')]]['holdtime']||0x0;this[_0x44ec('0xd')][_0x44ec('0x5d')]+=this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]][_0x44ec('0x5e')];}this['outbound'][_0x44ec('0x5f')]+=this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]]['duration'];logger[_0x44ec('0x19')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x4fe254[_0x44ec('0x1b')],util[_0x44ec('0x26')](this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x44ec('0x60'),this[_0x44ec('0xb')][_0x4fe254['uniqueid']]);logger[_0x44ec('0x19')](_0x44ec('0x61'),_0x4fe254[_0x44ec('0x1b')],util[_0x44ec('0x26')](this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x44ec('0x18')](_0x44ec('0x62'),this[_0x44ec('0xb')][_0x4fe254['uniqueid']]);logger['debug'](_0x44ec('0x63'),_0x4fe254['uniqueid'],util[_0x44ec('0x26')](this['channels'][_0x4fe254[_0x44ec('0x1b')]],{'showHidden':![],'depth':null}));this[_0x44ec('0x18')](_0x44ec('0x27'),_0x44ec('0x64'),this[_0x44ec('0xd')]);logger[_0x44ec('0x34')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x44ec('0x65')](this['channels'][_0x4fe254[_0x44ec('0x1b')]]));logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x4fe254['uniqueid'],util[_0x44ec('0x26')](this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]],{'showHidden':![],'depth':null}));this[_0x44ec('0x18')]('voice:outbound',_0x44ec('0x66'),this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x1b')]]);delete this[_0x44ec('0xb')][_0x4fe254['uniqueid']];}else if(this[_0x44ec('0xb')][_0x4fe254[_0x44ec('0x67')]]){this['channels'][_0x4fe254[_0x44ec('0x67')]]['uniqueid']=this[_0x44ec('0xb')][_0x4fe254['linkedid']][_0x44ec('0x68')];}if(this[_0x44ec('0xe')][_0x4fe254[_0x44ec('0x1b')]]){delete this[_0x44ec('0xe')][_0x4fe254[_0x44ec('0x1b')]];}}}catch(_0x27e62d){logger[_0x44ec('0x2a')]('[%s][voiceDialReport][hangup]',_0x4fe254[_0x44ec('0x1b')],util[_0x44ec('0x26')](_0x27e62d,{'showHidden':![],'depth':null}));}};module[_0x44ec('0x69')]=VoiceDialReport;
\ No newline at end of file
+var _0x20b6=['YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','keys','variable','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','value','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','isUndefined','[%s][voiceDialReport][hangup]\x20event:','cause-txt','endtime','duration','complete','total','answertime','holdtime','diff','starttime','seconds','sumHoldTime','sumBillable','billableseconds','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','stringify','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','lodash','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','syncDialBegin','bind','syncDialEnd','syncVarSet','hangup','syncHangup','prototype','emit','isNotNull','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','called','channel','substring','lastIndexOf','omit','event','privilege','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','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename'];(function(_0x503232,_0x287e7f){var _0x189faf=function(_0x193512){while(--_0x193512){_0x503232['push'](_0x503232['shift']());}};_0x189faf(++_0x287e7f);}(_0x20b6,0x1cd));var _0x620b=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x20b6[_0x4fc80b];return _0x119dba;};'use strict';var _=require(_0x620b('0x0'));var moment=require(_0x620b('0x1'));var util=require('util');var Redis=require(_0x620b('0x2'));var config=require(_0x620b('0x3'));var logger=require(_0x620b('0x4'))('ami');var ami=require(_0x620b('0x5'));config[_0x620b('0x6')]=_['defaults'](config[_0x620b('0x6')],{'host':_0x620b('0x7'),'port':0x18eb});var io=require(_0x620b('0x8'))(new Redis(config[_0x620b('0x6')]));function VoiceDialReport(_0x343321){this[_0x620b('0x9')]=_0x343321[_0x620b('0xa')];this[_0x620b('0xb')]=_0x343321['outbound'];this[_0x620b('0xc')]={};ami['on']('dialbegin',this[_0x620b('0xd')][_0x620b('0xe')](this));ami['on']('dialend',this[_0x620b('0xf')][_0x620b('0xe')](this));ami['on']('varset',this[_0x620b('0x10')]['bind'](this));ami['on'](_0x620b('0x11'),this[_0x620b('0x12')]['bind'](this));}VoiceDialReport[_0x620b('0x13')]['isNotNull']=function(_0x527082){return _0x527082!==null&&!_['isUndefined'](_0x527082);};VoiceDialReport['prototype'][_0x620b('0x14')]=function(_0x160517,_0x253091,_0x44002e){io['to'](_0x160517)['emit'](_0x253091,_0x44002e);};VoiceDialReport[_0x620b('0x13')][_0x620b('0xd')]=function(_0x123e02){try{if(this[_0x620b('0x15')](_0x123e02)){logger['debug'](_0x620b('0x16'),_0x123e02[_0x620b('0x17')],util[_0x620b('0x18')](_0x123e02,{'showHidden':![],'depth':null}));if(this[_0x620b('0x9')][_0x123e02[_0x620b('0x17')]]){_[_0x620b('0x19')](this[_0x620b('0x9')][_0x123e02[_0x620b('0x17')]],{'starttime':moment()[_0x620b('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x620b('0x1b'),'interface':_0x123e02[_0x620b('0x1c')][_0x620b('0x1d')](0x0,_0x123e02[_0x620b('0x1c')][_0x620b('0x1e')]('-')),'membername':_0x123e02[_0x620b('0x1c')]['substring'](_0x123e02[_0x620b('0x1c')][_0x620b('0x1e')]('/')+0x1,_0x123e02[_0x620b('0x1c')]['lastIndexOf']('-'))},_[_0x620b('0x1f')](_0x123e02,[_0x620b('0x20'),_0x620b('0x21')]));logger[_0x620b('0x22')](_0x620b('0x23'),_0x123e02['uniqueid'],this[_0x620b('0x9')][_0x123e02['uniqueid']][_0x620b('0x24')],this[_0x620b('0x9')][_0x123e02[_0x620b('0x17')]]['interface']);logger['debug'](_0x620b('0x25'),_0x123e02[_0x620b('0x17')],util[_0x620b('0x18')](this[_0x620b('0x9')][_0x123e02[_0x620b('0x17')]],{'showHidden':![],'depth':null}));this[_0x620b('0x14')](_0x620b('0x26'),_0x620b('0x27'),this['channels'][_0x123e02['uniqueid']]);logger[_0x620b('0x28')](_0x620b('0x29'),_0x123e02[_0x620b('0x17')],util['inspect'](this['channels'][_0x123e02[_0x620b('0x17')]],{'showHidden':![],'depth':null}));ami[_0x620b('0x14')]('custom:dialbegin',this['channels'][_0x123e02[_0x620b('0x17')]]);}}}catch(_0x5224bd){logger[_0x620b('0x2a')](_0x620b('0x2b'),_0x123e02[_0x620b('0x17')],util[_0x620b('0x18')](_0x5224bd,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x620b('0x13')]['syncDialEnd']=function(_0x2452eb){try{if(this[_0x620b('0x15')](_0x2452eb)){logger[_0x620b('0x28')](_0x620b('0x2c'),_0x2452eb[_0x620b('0x17')],util[_0x620b('0x18')](_0x2452eb,{'showHidden':![],'depth':null}));if(this[_0x620b('0x9')][_0x2452eb[_0x620b('0x17')]]){this['channels'][_0x2452eb[_0x620b('0x17')]]['dialstatus']=_0x2452eb[_0x620b('0x2d')];if(_0x2452eb[_0x620b('0x2d')]===_0x620b('0x2e')){this[_0x620b('0x9')][_0x2452eb[_0x620b('0x17')]][_0x620b('0x2f')]=_0x2452eb[_0x620b('0x2f')];this['channels'][_0x2452eb[_0x620b('0x17')]][_0x620b('0x30')]=_0x2452eb[_0x620b('0x30')];this[_0x620b('0x9')][_0x2452eb[_0x620b('0x17')]]['answertime']=moment()[_0x620b('0x1a')](_0x620b('0x31'));this['channels'][_0x2452eb[_0x620b('0x17')]][_0x620b('0x32')]=_0x620b('0x33');logger[_0x620b('0x22')](_0x620b('0x34'),_0x2452eb['uniqueid'],_0x2452eb['channel'][_0x620b('0x1d')](_0x2452eb[_0x620b('0x1c')][_0x620b('0x1e')]('/')+0x1,_0x2452eb['channel'][_0x620b('0x1e')]('-')));logger[_0x620b('0x28')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x2452eb[_0x620b('0x17')],util[_0x620b('0x18')](this[_0x620b('0x9')][_0x2452eb[_0x620b('0x17')]],{'showHidden':![],'depth':null}));ami['emit'](_0x620b('0x35'),this[_0x620b('0x9')][_0x2452eb[_0x620b('0x17')]]);}logger['debug'](_0x620b('0x36'),_0x2452eb[_0x620b('0x17')],util[_0x620b('0x18')](this['channels'][_0x2452eb[_0x620b('0x17')]],{'showHidden':![],'depth':null}));this['emit'](_0x620b('0x26'),_0x620b('0x27'),this['channels'][_0x2452eb[_0x620b('0x17')]]);}}}catch(_0x2a4a84){logger['error'](_0x620b('0x37'),_0x2452eb[_0x620b('0x17')],util['inspect'](_0x2a4a84,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x3fb4db){try{if(this[_0x620b('0x15')](_0x3fb4db)){logger[_0x620b('0x28')](_0x620b('0x38'),_0x3fb4db[_0x620b('0x17')],util[_0x620b('0x18')](_0x3fb4db,{'showHidden':![],'depth':null}));this['addVariable'](_0x3fb4db[_0x620b('0x17')],_[_0x620b('0x39')](_0x3fb4db[_0x620b('0x3a')])[0x0],_0x3fb4db['value']);if(this[_0x620b('0x15')](_0x3fb4db[_0x620b('0x3a')])&&this[_0x620b('0x15')](_0x3fb4db[_0x620b('0x3a')][_0x620b('0x3b')])){if(_['isUndefined'](this[_0x620b('0x9')][_0x3fb4db[_0x620b('0x17')]])){this['channels'][_0x3fb4db[_0x620b('0x17')]]={'routeId':_0x3fb4db['value'],'variables':this[_0x620b('0xc')][_0x3fb4db[_0x620b('0x17')]]};logger[_0x620b('0x22')](_0x620b('0x3c'),_0x3fb4db[_0x620b('0x17')],_0x3fb4db['variable'][_0x620b('0x3b')],_[_0x620b('0x39')](_0x3fb4db[_0x620b('0x3a')])[0x0],_0x3fb4db[_0x620b('0x3d')]);logger[_0x620b('0x28')](_0x620b('0x3e'),_0x3fb4db[_0x620b('0x17')],util['inspect'](this[_0x620b('0x9')][_0x3fb4db['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound','voice_outbound_channel:save',this[_0x620b('0x9')][_0x3fb4db['uniqueid']]);}}}}catch(_0x18c761){logger['error'](_0x620b('0x3f'),_0x3fb4db[_0x620b('0x17')],util[_0x620b('0x18')](_0x18c761,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x620b('0x13')][_0x620b('0x40')]=function(_0x590837,_0x563c5d,_0x3852fc){var _0x54524e=[_0x620b('0x41'),'rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x620b('0x42'),_0x620b('0x43'),_0x620b('0x44'),_0x620b('0x45'),_0x620b('0x46'),_0x620b('0x47'),'bridgepeer','bridgepvtcallid','membercalls',_0x620b('0x48'),_0x620b('0x49'),_0x620b('0x4a'),_0x620b('0x24'),'memberpenalty',_0x620b('0x4b')];if(!_[_0x620b('0x4c')](_0x563c5d)&&!_[_0x620b('0x4d')](_0x54524e,_0x563c5d)){if(_[_0x620b('0x4e')](this['variables'][_0x590837])){this['variables'][_0x590837]={};}this[_0x620b('0xc')][_0x590837][_0x563c5d]=_0x3852fc;}};VoiceDialReport[_0x620b('0x13')][_0x620b('0x12')]=function(_0xb75061){try{if(this[_0x620b('0x15')](_0xb75061)){logger[_0x620b('0x28')](_0x620b('0x4f'),_0xb75061['uniqueid'],util[_0x620b('0x18')](_0xb75061,{'showHidden':![],'depth':null}));if(this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]]){logger[_0x620b('0x22')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0xb75061[_0x620b('0x17')],_0xb75061[_0x620b('0x50')]);this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]][_0x620b('0x51')]=moment()[_0x620b('0x1a')](_0x620b('0x31'));this[_0x620b('0x9')][_0xb75061['uniqueid']][_0x620b('0x52')]=moment(this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]][_0x620b('0x51')])['diff'](this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]]['starttime'],'seconds');this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]][_0x620b('0x32')]=_0x620b('0x53');this[_0x620b('0xb')][_0x620b('0x54')]+=0x1;if(this[_0x620b('0x9')][_0xb75061['uniqueid']][_0x620b('0x55')]){this['outbound']['answered']+=0x1;this['channels'][_0xb75061['uniqueid']][_0x620b('0x56')]=moment(this[_0x620b('0x9')][_0xb75061['uniqueid']][_0x620b('0x55')])[_0x620b('0x57')](this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]][_0x620b('0x58')],_0x620b('0x59'));this['channels'][_0xb75061[_0x620b('0x17')]]['billableseconds']=moment(this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]][_0x620b('0x51')])[_0x620b('0x57')](this['channels'][_0xb75061['uniqueid']][_0x620b('0x55')],_0x620b('0x59'));this[_0x620b('0xb')][_0x620b('0x5a')]+=this[_0x620b('0x9')][_0xb75061['uniqueid']][_0x620b('0x56')]||0x0;this[_0x620b('0xb')][_0x620b('0x5b')]+=this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]][_0x620b('0x5c')];}this[_0x620b('0xb')]['sumDuration']+=this[_0x620b('0x9')][_0xb75061['uniqueid']][_0x620b('0x52')];logger[_0x620b('0x28')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0xb75061[_0x620b('0x17')],util[_0x620b('0x18')](this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]],{'showHidden':![],'depth':null}));ami[_0x620b('0x14')](_0x620b('0x5d'),this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]]);logger[_0x620b('0x28')](_0x620b('0x5e'),_0xb75061['uniqueid'],util[_0x620b('0x18')](this[_0x620b('0x9')][_0xb75061['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x620b('0x14')]('custom:dialend',this[_0x620b('0x9')][_0xb75061['uniqueid']]);logger[_0x620b('0x28')](_0x620b('0x5f'),_0xb75061['uniqueid'],util['inspect'](this['channels'][_0xb75061['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0x620b('0x26'),_0x620b('0x60'),this[_0x620b('0xb')]);logger[_0x620b('0x22')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x620b('0x61')](this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]]));logger[_0x620b('0x28')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0xb75061[_0x620b('0x17')],util['inspect'](this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]],{'showHidden':![],'depth':null}));this[_0x620b('0x14')](_0x620b('0x26'),_0x620b('0x62'),this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]]);delete this[_0x620b('0x9')][_0xb75061[_0x620b('0x17')]];}else if(this[_0x620b('0x9')][_0xb75061['linkedid']]){this[_0x620b('0x9')][_0xb75061[_0x620b('0x63')]][_0x620b('0x17')]=this[_0x620b('0x9')][_0xb75061[_0x620b('0x63')]][_0x620b('0x64')];}if(this[_0x620b('0xc')][_0xb75061[_0x620b('0x17')]]){delete this[_0x620b('0xc')][_0xb75061[_0x620b('0x17')]];}}}catch(_0x44cc07){logger[_0x620b('0x2a')](_0x620b('0x65'),_0xb75061[_0x620b('0x17')],util[_0x620b('0x18')](_0x44cc07,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file