Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / services / xdr / dials.controller.js
index 2958da4..522f2d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa100=['variable','value','assign','starttime','now','lastevent','ANSWER','answertime','connect','hangup','complete','duration','endtime','diffTime','billableseconds','lodash','util','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','dialstatus','request','CreateVoiceDialReport','newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error','stack','isNil'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0xa100,0x1b1));var _0x0a10=function(_0x1c6f10,_0x5eed05){_0x1c6f10=_0x1c6f10-0x0;var _0x5a9683=_0xa100[_0x1c6f10];return _0x5a9683;};'use strict';var _=require(_0x0a10('0x0'));var util=require(_0x0a10('0x1'));var utils=require(_0x0a10('0x2'));var dials={};function writeDB(_0x366a73){utils[_0x0a10('0x3')](util[_0x0a10('0x4')](_0x0a10('0x5'),_0x366a73[_0x0a10('0x6')],_0x366a73[_0x0a10('0x7')],_0x366a73[_0x0a10('0x8')],_0x366a73['calleridnum'],_0x366a73['connectedlinenum'],_0x366a73[_0x0a10('0x9')]));utils[_0x0a10('0xa')](_0x0a10('0xb'),_0x366a73);delete dials[_0x366a73[_0x0a10('0x6')]];}exports[_0x0a10('0xc')]=function(_0x4b5db3){try{if(_0x4b5db3[_0x0a10('0xd')][_0x0a10('0xe')]()==_0x0a10('0xf')&&_[_0x0a10('0x10')](_0x4b5db3[_0x0a10('0x11')][_0x0a10('0xe')](),_0x0a10('0x12'))){var _0x4554af=_0x4b5db3[_0x0a10('0x11')][_0x0a10('0x13')]('=');dials[_0x4b5db3['uniqueid']]={'routeId':_0x4554af[0x1]};}}catch(_0x532e8b){utils[_0x0a10('0x14')](_0x532e8b[_0x0a10('0x15')]);}};exports['varset']=function(_0x57c37d){try{if(!_[_0x0a10('0x16')](_0x57c37d[_0x0a10('0x17')]['outboundrouteid'])){dials[_0x57c37d[_0x0a10('0x6')]]={'routeId':_0x57c37d[_0x0a10('0x18')]};}}catch(_0x4c869e){utils['error'](_0x4c869e[_0x0a10('0x15')]);}};exports['dialbegin']=function(_0x7fccae){try{if(!_['isNil'](dials[_0x7fccae[_0x0a10('0x6')]])){dials[_0x7fccae[_0x0a10('0x6')]]=_[_0x0a10('0x19')](dials[_0x7fccae[_0x0a10('0x6')]],_0x7fccae);dials[_0x7fccae[_0x0a10('0x6')]][_0x0a10('0x1a')]=utils[_0x0a10('0x1b')]();dials[_0x7fccae[_0x0a10('0x6')]][_0x0a10('0x1c')]='called';}}catch(_0x55d1c8){utils[_0x0a10('0x14')](_0x55d1c8[_0x0a10('0x15')]);}};exports['dialend']=function(_0x1e4f21){try{if(!_['isNil'](dials[_0x1e4f21[_0x0a10('0x6')]])){dials[_0x1e4f21['uniqueid']][_0x0a10('0x9')]=_0x1e4f21['dialstatus'];if(_0x1e4f21['dialstatus']==_0x0a10('0x1d')){dials[_0x1e4f21[_0x0a10('0x6')]]=_['assign'](dials[_0x1e4f21['uniqueid']],_0x1e4f21);dials[_0x1e4f21[_0x0a10('0x6')]][_0x0a10('0x1e')]=utils['now']();dials[_0x1e4f21[_0x0a10('0x6')]][_0x0a10('0x1c')]=_0x0a10('0x1f');}}}catch(_0x355c98){utils[_0x0a10('0x14')](_0x355c98['stack']);}};exports[_0x0a10('0x20')]=function(_0x42b63c){try{if(!_[_0x0a10('0x16')](dials[_0x42b63c[_0x0a10('0x6')]])){dials[_0x42b63c[_0x0a10('0x6')]]=_[_0x0a10('0x19')](dials[_0x42b63c[_0x0a10('0x6')]],{'endtime':utils[_0x0a10('0x1b')](),'lastevent':_0x0a10('0x21')});dials[_0x42b63c[_0x0a10('0x6')]][_0x0a10('0x22')]=utils['diffTime'](dials[_0x42b63c[_0x0a10('0x6')]][_0x0a10('0x23')],dials[_0x42b63c[_0x0a10('0x6')]][_0x0a10('0x1a')]);dials[_0x42b63c[_0x0a10('0x6')]]['holdtime']=utils[_0x0a10('0x24')](dials[_0x42b63c[_0x0a10('0x6')]][_0x0a10('0x1e')]||dials[_0x42b63c[_0x0a10('0x6')]][_0x0a10('0x23')],dials[_0x42b63c[_0x0a10('0x6')]][_0x0a10('0x1a')]);dials[_0x42b63c['uniqueid']][_0x0a10('0x25')]=dials[_0x42b63c[_0x0a10('0x6')]]['answertime']?utils[_0x0a10('0x24')](dials[_0x42b63c[_0x0a10('0x6')]]['endtime'],dials[_0x42b63c[_0x0a10('0x6')]][_0x0a10('0x1e')]):0x0;writeDB(dials[_0x42b63c[_0x0a10('0x6')]]);}}catch(_0xf2ce82){utils[_0x0a10('0x14')](_0xf2ce82['stack']);}};
\ 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