18 var _0x85fb=['toLowerCase','set','startsWith','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][dialbegin]','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','debug','[%s][dials][dialend]','dialstatus','ANSWER','assign','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','complete','diffTime','billableseconds','endtime','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','request','CreateVoiceDialReport','uniqueid','newexten','[%s][dials][newexten]','appdata'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x85fb,0x7f));var _0xb85f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x85fb[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb85f('0x0'));var util=require('util');var utils=require(_0xb85f('0x1'));var dials={};function writeDB(_0x2a342f){utils[_0xb85f('0x2')](util[_0xb85f('0x3')](_0xb85f('0x4'),_0x2a342f['uniqueid'],_0x2a342f[_0xb85f('0x5')],_0x2a342f[_0xb85f('0x6')],_0x2a342f[_0xb85f('0x7')],_0x2a342f['connectedlinenum'],_0x2a342f['dialstatus']));utils[_0xb85f('0x8')](_0xb85f('0x9'),_0x2a342f);delete dials[_0x2a342f[_0xb85f('0xa')]];}exports[_0xb85f('0xb')]=function(_0x240574){try{utils['debug'](util[_0xb85f('0x3')](_0xb85f('0xc'),_0x240574['uniqueid']),_0x240574);utils[_0xb85f('0x2')](util[_0xb85f('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x240574['uniqueid'],_0x240574['application'],_0x240574[_0xb85f('0xd')]));if(_0x240574['application'][_0xb85f('0xe')]()==_0xb85f('0xf')&&_[_0xb85f('0x10')](_0x240574[_0xb85f('0xd')][_0xb85f('0xe')](),_0xb85f('0x11'))){var _0x17a842=_0x240574[_0xb85f('0xd')][_0xb85f('0x12')]('=');dials[_0x240574[_0xb85f('0xa')]]={'routeId':_0x17a842[0x1]};}}catch(_0x27eda8){utils['error'](util[_0xb85f('0x3')](_0xb85f('0xc'),_0x240574[_0xb85f('0xa')]),_0x27eda8);}};exports[_0xb85f('0x13')]=function(_0x1de5fb){try{utils['debug'](util[_0xb85f('0x3')](_0xb85f('0x14'),_0x1de5fb['uniqueid']),_0x1de5fb);if(!_[_0xb85f('0x15')](_0x1de5fb['variable'][_0xb85f('0x16')])){utils['info'](util[_0xb85f('0x3')](_0xb85f('0x17'),_0x1de5fb[_0xb85f('0xa')],_0x1de5fb[_0xb85f('0x18')]));dials[_0x1de5fb[_0xb85f('0xa')]]={'routeId':_0x1de5fb[_0xb85f('0x18')]};}}catch(_0x247698){utils[_0xb85f('0x19')](util[_0xb85f('0x3')]('[%s][dials][varset]',_0x1de5fb[_0xb85f('0xa')]),_0x247698);}};exports['dialbegin']=function(_0x741e4d){try{if(!_[_0xb85f('0x15')](dials[_0x741e4d[_0xb85f('0xa')]])){utils['debug'](util['format'](_0xb85f('0x1a'),_0x741e4d[_0xb85f('0xa')]),_0x741e4d);dials[_0x741e4d['uniqueid']]=_['assign'](dials[_0x741e4d['uniqueid']],_0x741e4d);dials[_0x741e4d[_0xb85f('0xa')]][_0xb85f('0x1b')]=utils[_0xb85f('0x1c')]();dials[_0x741e4d[_0xb85f('0xa')]][_0xb85f('0x1d')]=_0xb85f('0x1e');utils[_0xb85f('0x2')](util[_0xb85f('0x3')](_0xb85f('0x1f'),_0x741e4d[_0xb85f('0xa')],dials[_0x741e4d[_0xb85f('0xa')]][_0xb85f('0x1b')]));}}catch(_0x25a9ed){utils['error'](util[_0xb85f('0x3')](_0xb85f('0x1a'),_0x741e4d[_0xb85f('0xa')]),_0x25a9ed);}};exports['dialend']=function(_0x4dea48){try{if(!_['isNil'](dials[_0x4dea48[_0xb85f('0xa')]])){utils[_0xb85f('0x20')](util['format'](_0xb85f('0x21'),_0x4dea48[_0xb85f('0xa')]),_0x4dea48);dials[_0x4dea48['uniqueid']]['dialstatus']=_0x4dea48[_0xb85f('0x22')];if(_0x4dea48['dialstatus']==_0xb85f('0x23')){dials[_0x4dea48['uniqueid']]=_[_0xb85f('0x24')](dials[_0x4dea48['uniqueid']],_0x4dea48);dials[_0x4dea48['uniqueid']][_0xb85f('0x25')]=utils['now']();dials[_0x4dea48[_0xb85f('0xa')]][_0xb85f('0x1d')]='connect';utils[_0xb85f('0x2')](util['format'](_0xb85f('0x26'),_0x4dea48[_0xb85f('0xa')],_0x4dea48[_0xb85f('0x22')],dials[_0x4dea48['uniqueid']][_0xb85f('0x25')]));}else{utils[_0xb85f('0x2')](util[_0xb85f('0x3')](_0xb85f('0x27'),_0x4dea48[_0xb85f('0xa')],_0x4dea48[_0xb85f('0x22')]));}}}catch(_0x3a21a5){utils[_0xb85f('0x19')](util[_0xb85f('0x3')](_0xb85f('0x21'),_0x4dea48[_0xb85f('0xa')]),_0x3a21a5);}};exports[_0xb85f('0x28')]=function(_0x4ee33a){try{if(!_[_0xb85f('0x15')](dials[_0x4ee33a[_0xb85f('0xa')]])){utils['debug'](util[_0xb85f('0x3')](_0xb85f('0x29'),_0x4ee33a[_0xb85f('0xa')]),_0x4ee33a);utils[_0xb85f('0x2')](util[_0xb85f('0x3')](_0xb85f('0x2a'),_0x4ee33a[_0xb85f('0xa')],_0x4ee33a['calleridnum'],_0x4ee33a['calleridname'],_0x4ee33a['cause-txt']));dials[_0x4ee33a['uniqueid']]=_[_0xb85f('0x24')](dials[_0x4ee33a['uniqueid']],{'endtime':utils[_0xb85f('0x1c')](),'lastevent':_0xb85f('0x2b')});dials[_0x4ee33a[_0xb85f('0xa')]]['duration']=utils[_0xb85f('0x2c')](dials[_0x4ee33a[_0xb85f('0xa')]]['endtime'],dials[_0x4ee33a['uniqueid']][_0xb85f('0x1b')]);dials[_0x4ee33a[_0xb85f('0xa')]]['holdtime']=utils['diffTime'](dials[_0x4ee33a[_0xb85f('0xa')]]['answertime']||dials[_0x4ee33a[_0xb85f('0xa')]]['endtime'],dials[_0x4ee33a[_0xb85f('0xa')]]['starttime']);dials[_0x4ee33a[_0xb85f('0xa')]][_0xb85f('0x2d')]=dials[_0x4ee33a['uniqueid']][_0xb85f('0x25')]?utils[_0xb85f('0x2c')](dials[_0x4ee33a[_0xb85f('0xa')]][_0xb85f('0x2e')],dials[_0x4ee33a[_0xb85f('0xa')]]['answertime']):0x0;writeDB(dials[_0x4ee33a[_0xb85f('0xa')]]);}}catch(_0x131ba5){utils['error'](util[_0xb85f('0x3')](_0xb85f('0x29'),_0x4ee33a[_0xb85f('0xa')]),_0x131ba5);}};