// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x64c7=['[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','called','starttime','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','now','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','calleridname','cause-txt','duration','diffTime','endtime','holdtime','billableseconds','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','calleridnum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr(routeid)','split','error','[%s][dials][varset]','isNil','variable','outboundrouteid'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0x64c7,0x103));var _0x764c=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0x64c7[_0x2132a3];return _0x21890c;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x14a025){utils[_0x764c('0x0')](util[_0x764c('0x1')](_0x764c('0x2'),_0x14a025['uniqueid'],_0x14a025['channel'],_0x14a025['dialstring'],_0x14a025[_0x764c('0x3')],_0x14a025['connectedlinenum'],_0x14a025[_0x764c('0x4')]));utils[_0x764c('0x5')](_0x764c('0x6'),_0x14a025);delete dials[_0x14a025[_0x764c('0x7')]];}exports[_0x764c('0x8')]=function(_0x465b95){try{utils[_0x764c('0x9')](util[_0x764c('0x1')](_0x764c('0xa'),_0x465b95[_0x764c('0x7')]),_0x465b95);utils['info'](util[_0x764c('0x1')](_0x764c('0xb'),_0x465b95[_0x764c('0x7')],_0x465b95[_0x764c('0xc')],_0x465b95[_0x764c('0xd')]));if(_0x465b95[_0x764c('0xc')][_0x764c('0xe')]()=='set'&&_[_0x764c('0xf')](_0x465b95[_0x764c('0xd')][_0x764c('0xe')](),_0x764c('0x10'))){var _0x5e2323=_0x465b95['appdata'][_0x764c('0x11')]('=');dials[_0x465b95['uniqueid']]={'routeId':_0x5e2323[0x1]};}}catch(_0x20e589){utils[_0x764c('0x12')](util[_0x764c('0x1')](_0x764c('0xa'),_0x465b95[_0x764c('0x7')]),_0x20e589);}};exports['varset']=function(_0x5ca181){try{utils[_0x764c('0x9')](util['format'](_0x764c('0x13'),_0x5ca181[_0x764c('0x7')]),_0x5ca181);if(!_[_0x764c('0x14')](_0x5ca181[_0x764c('0x15')][_0x764c('0x16')])){utils[_0x764c('0x0')](util[_0x764c('0x1')](_0x764c('0x17'),_0x5ca181[_0x764c('0x7')],_0x5ca181[_0x764c('0x18')]));dials[_0x5ca181[_0x764c('0x7')]]={'routeId':_0x5ca181[_0x764c('0x18')]};}}catch(_0x16809f){utils[_0x764c('0x12')](util[_0x764c('0x1')](_0x764c('0x13'),_0x5ca181[_0x764c('0x7')]),_0x16809f);}};exports[_0x764c('0x19')]=function(_0x331f09){try{if(!_[_0x764c('0x14')](dials[_0x331f09[_0x764c('0x7')]])){utils[_0x764c('0x9')](util[_0x764c('0x1')]('[%s][dials][dialbegin]',_0x331f09[_0x764c('0x7')]),_0x331f09);dials[_0x331f09[_0x764c('0x7')]]=_[_0x764c('0x1a')](dials[_0x331f09['uniqueid']],_0x331f09);dials[_0x331f09[_0x764c('0x7')]]['starttime']=utils['now']();dials[_0x331f09[_0x764c('0x7')]]['lastevent']=_0x764c('0x1b');utils[_0x764c('0x0')](util[_0x764c('0x1')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x331f09['uniqueid'],dials[_0x331f09[_0x764c('0x7')]][_0x764c('0x1c')]));}}catch(_0x19f9c4){utils['error'](util['format'](_0x764c('0x1d'),_0x331f09[_0x764c('0x7')]),_0x19f9c4);}};exports[_0x764c('0x1e')]=function(_0x252b7b){try{if(!_[_0x764c('0x14')](dials[_0x252b7b['uniqueid']])){utils[_0x764c('0x9')](util['format'](_0x764c('0x1f'),_0x252b7b[_0x764c('0x7')]),_0x252b7b);dials[_0x252b7b[_0x764c('0x7')]][_0x764c('0x4')]=_0x252b7b['dialstatus'];if(_0x252b7b[_0x764c('0x4')]==_0x764c('0x20')){dials[_0x252b7b['uniqueid']]=_[_0x764c('0x1a')](dials[_0x252b7b[_0x764c('0x7')]],_0x252b7b);dials[_0x252b7b[_0x764c('0x7')]][_0x764c('0x21')]=utils[_0x764c('0x22')]();dials[_0x252b7b[_0x764c('0x7')]][_0x764c('0x23')]=_0x764c('0x24');utils[_0x764c('0x0')](util[_0x764c('0x1')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x252b7b['uniqueid'],_0x252b7b[_0x764c('0x4')],dials[_0x252b7b[_0x764c('0x7')]][_0x764c('0x21')]));}else{utils[_0x764c('0x0')](util[_0x764c('0x1')](_0x764c('0x25'),_0x252b7b['uniqueid'],_0x252b7b[_0x764c('0x4')]));}}}catch(_0x3e127a){utils[_0x764c('0x12')](util['format'](_0x764c('0x1f'),_0x252b7b[_0x764c('0x7')]),_0x3e127a);}};exports[_0x764c('0x26')]=function(_0x4e5db1){try{if(!_[_0x764c('0x14')](dials[_0x4e5db1['uniqueid']])){utils[_0x764c('0x9')](util['format'](_0x764c('0x27'),_0x4e5db1[_0x764c('0x7')]),_0x4e5db1);utils[_0x764c('0x0')](util[_0x764c('0x1')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x4e5db1[_0x764c('0x7')],_0x4e5db1[_0x764c('0x3')],_0x4e5db1[_0x764c('0x28')],_0x4e5db1[_0x764c('0x29')]));dials[_0x4e5db1[_0x764c('0x7')]]=_[_0x764c('0x1a')](dials[_0x4e5db1['uniqueid']],{'endtime':utils[_0x764c('0x22')](),'lastevent':'complete'});dials[_0x4e5db1[_0x764c('0x7')]][_0x764c('0x2a')]=utils[_0x764c('0x2b')](dials[_0x4e5db1[_0x764c('0x7')]][_0x764c('0x2c')],dials[_0x4e5db1[_0x764c('0x7')]][_0x764c('0x1c')]);dials[_0x4e5db1[_0x764c('0x7')]][_0x764c('0x2d')]=utils['diffTime'](dials[_0x4e5db1[_0x764c('0x7')]][_0x764c('0x21')]||dials[_0x4e5db1['uniqueid']][_0x764c('0x2c')],dials[_0x4e5db1['uniqueid']][_0x764c('0x1c')]);dials[_0x4e5db1[_0x764c('0x7')]][_0x764c('0x2e')]=dials[_0x4e5db1['uniqueid']][_0x764c('0x21')]?utils[_0x764c('0x2b')](dials[_0x4e5db1['uniqueid']][_0x764c('0x2c')],dials[_0x4e5db1[_0x764c('0x7')]][_0x764c('0x21')]):0x0;writeDB(dials[_0x4e5db1[_0x764c('0x7')]]);}}catch(_0x1824c2){utils[_0x764c('0x12')](util['format']('[%s][dials][hangup]',_0x4e5db1[_0x764c('0x7')]),_0x1824c2);}};
\ No newline at end of file
+var _0x3f2f=['application','toLowerCase','startsWith','cdr(routeid)','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','holdtime','diffTime','billableseconds','endtime','lodash','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','debug','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata'];(function(_0x41eab9,_0x99ea7a){var _0x2437b=function(_0x1369d4){while(--_0x1369d4){_0x41eab9['push'](_0x41eab9['shift']());}};_0x2437b(++_0x99ea7a);}(_0x3f2f,0xc6));var _0xf3f2=function(_0x2ac992,_0x37c877){_0x2ac992=_0x2ac992-0x0;var _0x223c9d=_0x3f2f[_0x2ac992];return _0x223c9d;};'use strict';var _=require(_0xf3f2('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x3584ec){utils[_0xf3f2('0x1')](util['format'](_0xf3f2('0x2'),_0x3584ec['uniqueid'],_0x3584ec[_0xf3f2('0x3')],_0x3584ec['dialstring'],_0x3584ec[_0xf3f2('0x4')],_0x3584ec[_0xf3f2('0x5')],_0x3584ec[_0xf3f2('0x6')]));utils[_0xf3f2('0x7')](_0xf3f2('0x8'),_0x3584ec);delete dials[_0x3584ec[_0xf3f2('0x9')]];}exports['newexten']=function(_0x4856e2){try{utils[_0xf3f2('0xa')](util[_0xf3f2('0xb')]('[%s][dials][newexten]',_0x4856e2[_0xf3f2('0x9')]),_0x4856e2);utils[_0xf3f2('0x1')](util[_0xf3f2('0xb')](_0xf3f2('0xc'),_0x4856e2['uniqueid'],_0x4856e2['application'],_0x4856e2[_0xf3f2('0xd')]));if(_0x4856e2[_0xf3f2('0xe')][_0xf3f2('0xf')]()=='set'&&_[_0xf3f2('0x10')](_0x4856e2['appdata']['toLowerCase'](),_0xf3f2('0x11'))){var _0x942a00=_0x4856e2[_0xf3f2('0xd')][_0xf3f2('0x12')]('=');dials[_0x4856e2['uniqueid']]={'routeId':_0x942a00[0x1]};}}catch(_0xa8fd02){utils[_0xf3f2('0x13')](util[_0xf3f2('0xb')](_0xf3f2('0x14'),_0x4856e2[_0xf3f2('0x9')]),_0xa8fd02);}};exports[_0xf3f2('0x15')]=function(_0x55ab7f){try{utils[_0xf3f2('0xa')](util[_0xf3f2('0xb')](_0xf3f2('0x16'),_0x55ab7f[_0xf3f2('0x9')]),_0x55ab7f);if(!_[_0xf3f2('0x17')](_0x55ab7f[_0xf3f2('0x18')][_0xf3f2('0x19')])){utils[_0xf3f2('0x1')](util[_0xf3f2('0xb')](_0xf3f2('0x1a'),_0x55ab7f[_0xf3f2('0x9')],_0x55ab7f[_0xf3f2('0x1b')]));dials[_0x55ab7f[_0xf3f2('0x9')]]={'routeId':_0x55ab7f[_0xf3f2('0x1b')]};}}catch(_0x5f0b4e){utils[_0xf3f2('0x13')](util[_0xf3f2('0xb')](_0xf3f2('0x16'),_0x55ab7f[_0xf3f2('0x9')]),_0x5f0b4e);}};exports[_0xf3f2('0x1c')]=function(_0x12ee00){try{if(!_['isNil'](dials[_0x12ee00[_0xf3f2('0x9')]])){utils[_0xf3f2('0xa')](util[_0xf3f2('0xb')](_0xf3f2('0x1d'),_0x12ee00[_0xf3f2('0x9')]),_0x12ee00);dials[_0x12ee00[_0xf3f2('0x9')]]=_[_0xf3f2('0x1e')](dials[_0x12ee00['uniqueid']],_0x12ee00);dials[_0x12ee00['uniqueid']][_0xf3f2('0x1f')]=utils[_0xf3f2('0x20')]();dials[_0x12ee00[_0xf3f2('0x9')]][_0xf3f2('0x21')]=_0xf3f2('0x22');utils['info'](util[_0xf3f2('0xb')](_0xf3f2('0x23'),_0x12ee00[_0xf3f2('0x9')],dials[_0x12ee00[_0xf3f2('0x9')]][_0xf3f2('0x1f')]));}}catch(_0x3bb71f){utils[_0xf3f2('0x13')](util[_0xf3f2('0xb')]('[%s][dials][dialbegin]',_0x12ee00[_0xf3f2('0x9')]),_0x3bb71f);}};exports[_0xf3f2('0x24')]=function(_0xc5dfe5){try{if(!_['isNil'](dials[_0xc5dfe5['uniqueid']])){utils[_0xf3f2('0xa')](util[_0xf3f2('0xb')](_0xf3f2('0x25'),_0xc5dfe5['uniqueid']),_0xc5dfe5);dials[_0xc5dfe5[_0xf3f2('0x9')]][_0xf3f2('0x6')]=_0xc5dfe5['dialstatus'];if(_0xc5dfe5['dialstatus']==_0xf3f2('0x26')){dials[_0xc5dfe5[_0xf3f2('0x9')]]=_[_0xf3f2('0x1e')](dials[_0xc5dfe5[_0xf3f2('0x9')]],_0xc5dfe5);dials[_0xc5dfe5[_0xf3f2('0x9')]][_0xf3f2('0x27')]=utils[_0xf3f2('0x20')]();dials[_0xc5dfe5['uniqueid']][_0xf3f2('0x21')]=_0xf3f2('0x28');utils[_0xf3f2('0x1')](util[_0xf3f2('0xb')](_0xf3f2('0x29'),_0xc5dfe5[_0xf3f2('0x9')],_0xc5dfe5['dialstatus'],dials[_0xc5dfe5['uniqueid']][_0xf3f2('0x27')]));}else{utils[_0xf3f2('0x1')](util[_0xf3f2('0xb')](_0xf3f2('0x2a'),_0xc5dfe5[_0xf3f2('0x9')],_0xc5dfe5[_0xf3f2('0x6')]));}}}catch(_0x508dac){utils[_0xf3f2('0x13')](util[_0xf3f2('0xb')](_0xf3f2('0x25'),_0xc5dfe5[_0xf3f2('0x9')]),_0x508dac);}};exports['hangup']=function(_0x5e43d7){try{if(!_[_0xf3f2('0x17')](dials[_0x5e43d7[_0xf3f2('0x9')]])){utils[_0xf3f2('0xa')](util[_0xf3f2('0xb')](_0xf3f2('0x2b'),_0x5e43d7[_0xf3f2('0x9')]),_0x5e43d7);utils[_0xf3f2('0x1')](util[_0xf3f2('0xb')](_0xf3f2('0x2c'),_0x5e43d7['uniqueid'],_0x5e43d7['calleridnum'],_0x5e43d7[_0xf3f2('0x2d')],_0x5e43d7[_0xf3f2('0x2e')]));dials[_0x5e43d7['uniqueid']]=_[_0xf3f2('0x1e')](dials[_0x5e43d7[_0xf3f2('0x9')]],{'endtime':utils['now'](),'lastevent':_0xf3f2('0x2f')});dials[_0x5e43d7['uniqueid']][_0xf3f2('0x30')]=utils['diffTime'](dials[_0x5e43d7['uniqueid']]['endtime'],dials[_0x5e43d7[_0xf3f2('0x9')]][_0xf3f2('0x1f')]);dials[_0x5e43d7['uniqueid']][_0xf3f2('0x31')]=utils[_0xf3f2('0x32')](dials[_0x5e43d7[_0xf3f2('0x9')]][_0xf3f2('0x27')]||dials[_0x5e43d7[_0xf3f2('0x9')]]['endtime'],dials[_0x5e43d7[_0xf3f2('0x9')]][_0xf3f2('0x1f')]);dials[_0x5e43d7['uniqueid']][_0xf3f2('0x33')]=dials[_0x5e43d7[_0xf3f2('0x9')]][_0xf3f2('0x27')]?utils[_0xf3f2('0x32')](dials[_0x5e43d7['uniqueid']][_0xf3f2('0x34')],dials[_0x5e43d7[_0xf3f2('0x9')]][_0xf3f2('0x27')]):0x0;writeDB(dials[_0x5e43d7[_0xf3f2('0x9')]]);}}catch(_0x4c0b5c){utils['error'](util[_0xf3f2('0xb')](_0xf3f2('0x2b'),_0x5e43d7[_0xf3f2('0x9')]),_0x4c0b5c);}};
\ No newline at end of file