Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / components / extensions / rewrite.js
index 5435d3d..e4209d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8262=['XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','models','then','VoiceExtension','findAll','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','find','extensions','push','type','format','CDR(type)=%s','context','outbound','extension','CDR(destination)=','cutdigits','${EXTEN}','Set','CDR(routeid)=','VoiceExtensionId','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','hasOwnProperty','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer'];(function(_0x533eb8,_0x2023ef){var _0x267bc4=function(_0x557d63){while(--_0x557d63){_0x533eb8['push'](_0x533eb8['shift']());}};_0x267bc4(++_0x2023ef);}(_0x8262,0x9d));var _0x2826=function(_0x1722c8,_0x941803){_0x1722c8=_0x1722c8-0x0;var _0x34772a=_0x8262[_0x1722c8];return _0x34772a;};'use strict';var _=require(_0x2826('0x0'));var util=require(_0x2826('0x1'));function rewrite(_0x15c1d6,_0x267c2e){var _0x1629e1=this;return _0x15c1d6[_0x2826('0x2')]['Interval']['findAll']({'raw':!![]})[_0x2826('0x3')](function(_0x54ffcb){_0x1629e1['intervals']=_0x54ffcb;return _0x15c1d6[_0x2826('0x2')][_0x2826('0x4')][_0x2826('0x5')]({'where':{'IntervalId':_0x267c2e[_0x2826('0x6')]},'raw':!![]});})[_0x2826('0x3')](function(_0xf141e){return _0x15c1d6[_0x2826('0x2')][_0x2826('0x4')][_0x2826('0x5')]({'where':{'exten':{'$in':_['uniq'](_[_0x2826('0x7')](_0xf141e,_0x2826('0x8')))}},'order':[{'raw':_0x2826('0x9')}],'raw':!![]});})['then'](function(_0x2a5f71){var _0x415c8b=_[_0x2826('0xa')](_0x2a5f71,{'priority':'1'});var _0x411252=_[_0x2826('0xa')](_0x2a5f71,{'isApp':0x1});var _0x688b7a=_[_0x2826('0xb')](_0x411252,'exten');var _0x50f887=[_0x2826('0xc'),_0x2826('0xd')];var _0x298a67=[];var _0xe844f8=[];for(var _0x426919 in _0x688b7a){if(_0x688b7a['hasOwnProperty'](_0x426919)){_0x1629e1[_0x2826('0xe')]=0x2;_0x1629e1['extensions']=[];_0x1629e1['extension']=_[_0x2826('0xf')](_0x415c8b,{'exten':_0x688b7a[_0x426919][0x0][_0x2826('0x8')]});_0x1629e1[_0x2826('0x10')][_0x2826('0x11')]({'type':_0x688b7a[_0x426919][0x0][_0x2826('0x12')],'app':'Set','appdata':util[_0x2826('0x13')](_0x2826('0x14'),_0x688b7a[_0x426919][0x0][_0x2826('0x12')]),'context':_0x688b7a[_0x426919][0x0][_0x2826('0x15')],'exten':_0x688b7a[_0x426919][0x0][_0x2826('0x8')],'priority':_0x1629e1[_0x2826('0xe')]++,'VoiceExtensionId':_0x688b7a[_0x426919][0x0]['VoiceExtensionId']});if(_0x688b7a[_0x426919][0x0][_0x2826('0x12')]===_0x2826('0x16')){if(_0x1629e1[_0x2826('0x17')]){_0x1629e1[_0x2826('0x10')][_0x2826('0x11')]({'type':_0x688b7a[_0x426919][0x0][_0x2826('0x12')],'app':'Set','appdata':_0x2826('0x18')+(_0x1629e1[_0x2826('0x17')][_0x2826('0x19')]?'${EXTEN:'+_0x1629e1[_0x2826('0x17')][_0x2826('0x19')]+'}':_0x2826('0x1a')),'context':_0x688b7a[_0x426919][0x0][_0x2826('0x15')],'exten':_0x688b7a[_0x426919][0x0]['exten'],'priority':_0x1629e1[_0x2826('0xe')]++,'VoiceExtensionId':_0x688b7a[_0x426919][0x0]['VoiceExtensionId']});}_0x1629e1['extensions'][_0x2826('0x11')]({'type':_0x688b7a[_0x426919][0x0][_0x2826('0x12')],'app':_0x2826('0x1b'),'appdata':_0x2826('0x1c')+_0x688b7a[_0x426919][0x0]['VoiceExtensionId'],'context':_0x688b7a[_0x426919][0x0][_0x2826('0x15')],'exten':_0x688b7a[_0x426919][0x0][_0x2826('0x8')],'priority':_0x1629e1[_0x2826('0xe')]++,'VoiceExtensionId':_0x688b7a[_0x426919][0x0][_0x2826('0x1d')]});var _0x39f843=_0x1629e1['priority']++;_0x1629e1[_0x2826('0x10')][_0x2826('0x11')]({'type':_0x688b7a[_0x426919][0x0]['type'],'app':_0x2826('0x1e'),'appdata':_0x2826('0x1f')+(_0x39f843+0x2)+_0x2826('0x20')+(_0x39f843+0x1)+')','context':_0x688b7a[_0x426919][0x0][_0x2826('0x15')],'exten':_0x688b7a[_0x426919][0x0][_0x2826('0x8')],'priority':_0x39f843,'VoiceExtensionId':_0x688b7a[_0x426919][0x0]['VoiceExtensionId']});if(_0x1629e1[_0x2826('0x17')]){_0x1629e1[_0x2826('0x10')][_0x2826('0x11')]({'type':_0x688b7a[_0x426919][0x0][_0x2826('0x12')],'app':_0x2826('0x1b'),'appdata':_0x1629e1[_0x2826('0x17')][_0x2826('0x19')]?_0x2826('0x21')+_0x1629e1[_0x2826('0x17')][_0x2826('0x19')]+'}':_0x2826('0x22'),'context':_0x688b7a[_0x426919][0x0][_0x2826('0x15')],'exten':_0x688b7a[_0x426919][0x0][_0x2826('0x8')],'priority':_0x1629e1[_0x2826('0xe')]++,'VoiceExtensionId':_0x688b7a[_0x426919][0x0][_0x2826('0x1d')]});}_0x1629e1[_0x2826('0x10')]['push']({'type':_0x688b7a[_0x426919][0x0][_0x2826('0x12')],'app':_0x2826('0x1b'),'appdata':_0x2826('0x23')+_0x688b7a[_0x426919][0x0][_0x2826('0x1d')],'context':_0x688b7a[_0x426919][0x0][_0x2826('0x15')],'exten':_0x688b7a[_0x426919][0x0][_0x2826('0x8')],'priority':_0x1629e1[_0x2826('0xe')]++,'VoiceExtensionId':_0x688b7a[_0x426919][0x0]['VoiceExtensionId']});if(_0x1629e1[_0x2826('0x17')]&&_0x1629e1[_0x2826('0x17')]['hasOwnProperty'](_0x2826('0x24'))&&_0x1629e1['extension'][_0x2826('0x24')]!==_0x2826('0x25')){_0x1629e1[_0x2826('0x10')]['push']({'type':_0x688b7a[_0x426919][0x0]['type'],'app':_0x2826('0x1b'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x688b7a[_0x426919][0x0][_0x2826('0x15')],'exten':_0x688b7a[_0x426919][0x0][_0x2826('0x8')],'priority':_0x1629e1['priority']++,'VoiceExtensionId':_0x688b7a[_0x426919][0x0][_0x2826('0x1d')]});_0x1629e1[_0x2826('0x10')][_0x2826('0x11')]({'type':_0x688b7a[_0x426919][0x0]['type'],'app':'Set','appdata':_0x2826('0x26')+_0x1629e1[_0x2826('0x17')][_0x2826('0x24')]||_0x2826('0x27'),'context':_0x688b7a[_0x426919][0x0][_0x2826('0x15')],'exten':_0x688b7a[_0x426919][0x0][_0x2826('0x8')],'priority':_0x1629e1[_0x2826('0xe')]++,'VoiceExtensionId':_0x688b7a[_0x426919][0x0]['VoiceExtensionId']});}}_0x1629e1[_0x2826('0x10')]['push']({'type':_0x688b7a[_0x426919][0x0][_0x2826('0x12')],'app':_0x2826('0x1b'),'appdata':_0x2826('0x28'),'context':_0x688b7a[_0x426919][0x0][_0x2826('0x15')],'exten':_0x688b7a[_0x426919][0x0][_0x2826('0x8')],'priority':_0x1629e1['priority']++,'VoiceExtensionId':_0x688b7a[_0x426919][0x0]['VoiceExtensionId']});_0x1629e1['extensions'][_0x2826('0x11')]({'type':_0x688b7a[_0x426919][0x0][_0x2826('0x12')],'app':_0x2826('0x1b'),'appdata':_0x2826('0x29'),'context':_0x688b7a[_0x426919][0x0][_0x2826('0x15')],'exten':_0x688b7a[_0x426919][0x0]['exten'],'priority':_0x1629e1[_0x2826('0xe')]++,'VoiceExtensionId':_0x688b7a[_0x426919][0x0]['VoiceExtensionId']});_0x1629e1[_0x2826('0x10')]['push']({'type':_0x688b7a[_0x426919][0x0][_0x2826('0x12')],'app':_0x2826('0x1b'),'appdata':_0x2826('0x2a'),'context':_0x688b7a[_0x426919][0x0][_0x2826('0x15')],'exten':_0x688b7a[_0x426919][0x0][_0x2826('0x8')],'priority':_0x1629e1[_0x2826('0xe')]++,'VoiceExtensionId':_0x688b7a[_0x426919][0x0][_0x2826('0x1d')]});for(var _0x5409c9=0x0,_0x76a4a7=0x0;_0x5409c9<_0x688b7a[_0x426919][_0x2826('0x2b')];_0x5409c9+=0x1,_0x76a4a7=0x0){var _0x337161=_0x688b7a[_0x426919][_0x5409c9];if(_0x337161[_0x2826('0x12')]){_0x337161[_0x2826('0x12')]=_0x337161[_0x2826('0x12')][_0x2826('0x2c')]();}var _0x1ff243=[];var _0x4b68bd=[];delete _0x337161['id'];delete _0x337161[_0x2826('0x2d')];delete _0x337161[_0x2826('0x2e')];var _0x3eddba=_0x337161[_0x2826('0x2f')]!==_0x2826('0x30')?[_0x337161[_0x2826('0x2f')]]:_0x337161[_0x2826('0x6')]?_[_0x2826('0x7')](_[_0x2826('0xa')](_0x1629e1['intervals'],{'IntervalId':_0x337161[_0x2826('0x6')]}),_0x2826('0x2f')):[];if(_0x337161[_0x2826('0x31')](_0x2826('0x32'))){if(_0x337161[_0x2826('0x32')]&&_0x337161[_0x2826('0x32')]!=='--'){_0x1ff243[_0x2826('0x11')]({'type':_0x337161[_0x2826('0x12')],'app':'Set','appdata':'CDR(tag)='+_0x337161[_0x2826('0x32')],'context':_0x337161[_0x2826('0x15')],'exten':_0x337161[_0x2826('0x8')],'priority':_0x3eddba[_0x2826('0x2b')]+_0x1629e1['priority']+_0x76a4a7++,'VoiceExtensionId':_0x337161['VoiceExtensionId']});}}if(_0x337161['type']===_0x2826('0x16')&&_0x337161[_0x2826('0x31')](_0x2826('0x33'))){if(_0x337161[_0x2826('0x33')]){_0x1ff243[_0x2826('0x11')]({'type':_0x337161[_0x2826('0x12')],'app':_0x2826('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x337161[_0x2826('0x33')]+')','context':_0x337161['context'],'exten':_0x337161[_0x2826('0x8')],'priority':_0x3eddba[_0x2826('0x2b')]+_0x1629e1[_0x2826('0xe')]+_0x76a4a7++,'VoiceExtensionId':_0x337161[_0x2826('0x1d')]});}else{_0x1ff243[_0x2826('0x11')]({'type':_0x337161[_0x2826('0x12')],'app':'ExecIf','appdata':_0x2826('0x34'),'context':_0x337161[_0x2826('0x15')],'exten':_0x337161[_0x2826('0x8')],'priority':_0x3eddba[_0x2826('0x2b')]+_0x1629e1[_0x2826('0xe')]+_0x76a4a7++,'VoiceExtensionId':_0x337161[_0x2826('0x1d')]});}}if(_0x337161['hasOwnProperty'](_0x2826('0x35'))){if(_0x50f887[_0x2826('0x36')](_0x337161[_0x2826('0x37')][_0x2826('0x2c')]())>=0x0&&_0x337161[_0x2826('0x38')]!==_0x2826('0x39')){if(_0x337161['answer']){_0x1ff243[_0x2826('0x11')]({'type':_0x337161[_0x2826('0x12')],'app':_0x2826('0x1e'),'appdata':_0x2826('0x3a'),'context':_0x337161[_0x2826('0x15')],'exten':_0x337161[_0x2826('0x8')],'priority':_0x3eddba[_0x2826('0x2b')]+_0x1629e1[_0x2826('0xe')]+_0x76a4a7++,'VoiceExtensionId':_0x337161['VoiceExtensionId']});_0x1ff243[_0x2826('0x11')]({'type':_0x337161[_0x2826('0x12')],'app':_0x2826('0x1b'),'appdata':_0x2826('0x3b'),'context':_0x337161[_0x2826('0x15')],'exten':_0x337161[_0x2826('0x8')],'priority':_0x3eddba[_0x2826('0x2b')]+_0x1629e1['priority']+_0x76a4a7++,'VoiceExtensionId':_0x337161[_0x2826('0x1d')]});}else{_0x1ff243[_0x2826('0x11')]({'type':_0x337161['type'],'app':_0x2826('0x1e'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x337161['context'],'exten':_0x337161['exten'],'priority':_0x3eddba[_0x2826('0x2b')]+_0x1629e1['priority']+_0x76a4a7++,'VoiceExtensionId':_0x337161[_0x2826('0x1d')]});_0x1ff243[_0x2826('0x11')]({'type':_0x337161[_0x2826('0x12')],'app':_0x2826('0x1b'),'appdata':_0x2826('0x3c'),'context':_0x337161['context'],'exten':_0x337161[_0x2826('0x8')],'priority':_0x3eddba[_0x2826('0x2b')]+_0x1629e1[_0x2826('0xe')]+_0x76a4a7++,'VoiceExtensionId':_0x337161[_0x2826('0x1d')]});}}}for(var _0x5a1627=0x0;_0x5a1627<_0x3eddba[_0x2826('0x2b')];_0x5a1627+=0x1){var _0x1ed9dc=_0x1629e1[_0x2826('0xe')]+_0x3eddba[_0x2826('0x2b')];var _0x23a5a3=_0x5a1627===_0x3eddba[_0x2826('0x2b')]-0x1?_0x1629e1[_0x2826('0xe')]+_0x1ff243[_0x2826('0x2b')]+_0x4b68bd[_0x2826('0x2b')]+0x2:_0x1629e1[_0x2826('0xe')]+_0x5a1627+0x1;_0x1ff243['splice'](_0x5a1627,0x0,{'type':_0x337161[_0x2826('0x12')],'app':_0x2826('0x3d'),'appdata':_0x3eddba[_0x5a1627]+'?'+_0x337161[_0x2826('0x15')]+_0x2826('0x3e')+_0x1ed9dc+':'+_0x337161[_0x2826('0x15')]+_0x2826('0x3e')+_0x23a5a3,'exten':_0x337161[_0x2826('0x8')],'context':_0x337161[_0x2826('0x15')],'priority':_0x1629e1['priority']+_0x5a1627,'VoiceExtensionId':_0x688b7a[_0x426919][0x0][_0x2826('0x1d')]});}_0x337161[_0x2826('0xe')]=_0x1ff243[_0x2826('0x2b')]?_[_0x2826('0x3f')](_0x1ff243)[_0x2826('0xe')]+0x1:_0x1629e1[_0x2826('0xe')];_0x1629e1[_0x2826('0xe')]=(_0x4b68bd['length']?_[_0x2826('0x3f')](_0x4b68bd)[_0x2826('0xe')]:_0x337161[_0x2826('0xe')])+0x1;_0x1629e1['extensions']=_[_0x2826('0x40')](_0x1629e1['extensions'],_0x1ff243,[_0x337161],_0x4b68bd);}_0x1629e1[_0x2826('0x10')][_0x2826('0x11')]({'type':_0x688b7a[_0x426919][0x0][_0x2826('0x12')],'app':_0x2826('0x41'),'exten':_0x688b7a[_0x426919][0x0][_0x2826('0x8')],'context':_0x688b7a[_0x426919][0x0][_0x2826('0x15')],'priority':_0x1629e1[_0x2826('0xe')],'VoiceExtensionId':_0x688b7a[_0x426919][0x0][_0x2826('0x1d')]});_0x298a67[_0x2826('0x11')](_0x688b7a[_0x426919][0x0][_0x2826('0x1d')]);_0xe844f8=_[_0x2826('0x40')](_0xe844f8,_0x1629e1[_0x2826('0x10')]);}}return _0x15c1d6[_0x2826('0x42')](function(_0xb93d39){return _0x15c1d6['models'][_0x2826('0x4')][_0x2826('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x298a67}},'transaction':_0xb93d39})[_0x2826('0x3')](function(_0x86ccd0){return _0x15c1d6[_0x2826('0x2')]['VoiceExtension']['bulkCreate'](_[_0x2826('0x44')](_0xe844f8,_0x2826('0xe')),{'transaction':_0xb93d39});});});})[_0x2826('0x45')](function(_0x14643e){console[_0x2826('0x46')](_0x14643e);});}exports[_0x2826('0x47')]=rewrite;
\ No newline at end of file
+var _0x0b1f=['intervals','VoiceExtension','then','findAll','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','find','push','type','format','outbound','extension','Set','cutdigits','${EXTEN}','context','VoiceExtensionId','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','updatedAt','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','util','models'];(function(_0x589073,_0x2c0aef){var _0x5a607a=function(_0x59b549){while(--_0x59b549){_0x589073['push'](_0x589073['shift']());}};_0x5a607a(++_0x2c0aef);}(_0x0b1f,0x82));var _0xf0b1=function(_0x5d52af,_0x29fd44){_0x5d52af=_0x5d52af-0x0;var _0x2737eb=_0x0b1f[_0x5d52af];return _0x2737eb;};'use strict';var _=require('lodash');var util=require(_0xf0b1('0x0'));function rewrite(_0x3f597a,_0x2164bb){var _0x51c639=this;return _0x3f597a[_0xf0b1('0x1')]['Interval']['findAll']({'raw':!![]})['then'](function(_0x363de0){_0x51c639[_0xf0b1('0x2')]=_0x363de0;return _0x3f597a[_0xf0b1('0x1')][_0xf0b1('0x3')]['findAll']({'where':{'IntervalId':_0x2164bb['IntervalId']},'raw':!![]});})[_0xf0b1('0x4')](function(_0x2473f0){return _0x3f597a[_0xf0b1('0x1')][_0xf0b1('0x3')][_0xf0b1('0x5')]({'where':{'exten':{'$in':_[_0xf0b1('0x6')](_[_0xf0b1('0x7')](_0x2473f0,_0xf0b1('0x8')))}},'order':[{'raw':_0xf0b1('0x9')}],'raw':!![]});})[_0xf0b1('0x4')](function(_0x15bd8e){var _0x5772e4=_[_0xf0b1('0xa')](_0x15bd8e,{'priority':'1'});var _0x5997c2=_[_0xf0b1('0xa')](_0x15bd8e,{'isApp':0x1});var _0x3dc4c9=_[_0xf0b1('0xb')](_0x5997c2,_0xf0b1('0x8'));var _0x237c4b=[_0xf0b1('0xc'),_0xf0b1('0xd')];var _0xe8a65f=[];var _0xa67fc5=[];for(var _0x520055 in _0x3dc4c9){if(_0x3dc4c9[_0xf0b1('0xe')](_0x520055)){_0x51c639[_0xf0b1('0xf')]=0x2;_0x51c639[_0xf0b1('0x10')]=[];_0x51c639['extension']=_[_0xf0b1('0x11')](_0x5772e4,{'exten':_0x3dc4c9[_0x520055][0x0]['exten']});_0x51c639[_0xf0b1('0x10')][_0xf0b1('0x12')]({'type':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x13')],'app':'Set','appdata':util[_0xf0b1('0x14')]('CDR(type)=%s',_0x3dc4c9[_0x520055][0x0]['type']),'context':_0x3dc4c9[_0x520055][0x0]['context'],'exten':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x8')],'priority':_0x51c639[_0xf0b1('0xf')]++,'VoiceExtensionId':_0x3dc4c9[_0x520055][0x0]['VoiceExtensionId']});if(_0x3dc4c9[_0x520055][0x0]['type']===_0xf0b1('0x15')){if(_0x51c639[_0xf0b1('0x16')]){_0x51c639[_0xf0b1('0x10')][_0xf0b1('0x12')]({'type':_0x3dc4c9[_0x520055][0x0]['type'],'app':_0xf0b1('0x17'),'appdata':'CDR(destination)='+(_0x51c639[_0xf0b1('0x16')][_0xf0b1('0x18')]?'${EXTEN:'+_0x51c639['extension'][_0xf0b1('0x18')]+'}':_0xf0b1('0x19')),'context':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1a')],'exten':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x8')],'priority':_0x51c639[_0xf0b1('0xf')]++,'VoiceExtensionId':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1b')]});}_0x51c639['extensions'][_0xf0b1('0x12')]({'type':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x13')],'app':'Set','appdata':_0xf0b1('0x1c')+_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1b')],'context':_0x3dc4c9[_0x520055][0x0]['context'],'exten':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x8')],'priority':_0x51c639[_0xf0b1('0xf')]++,'VoiceExtensionId':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1b')]});var _0x18b95e=_0x51c639[_0xf0b1('0xf')]++;_0x51c639[_0xf0b1('0x10')][_0xf0b1('0x12')]({'type':_0x3dc4c9[_0x520055][0x0]['type'],'app':_0xf0b1('0x1d'),'appdata':_0xf0b1('0x1e')+(_0x18b95e+0x2)+_0xf0b1('0x1f')+(_0x18b95e+0x1)+')','context':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1a')],'exten':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x8')],'priority':_0x18b95e,'VoiceExtensionId':_0x3dc4c9[_0x520055][0x0]['VoiceExtensionId']});if(_0x51c639['extension']){_0x51c639[_0xf0b1('0x10')][_0xf0b1('0x12')]({'type':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x13')],'app':_0xf0b1('0x17'),'appdata':_0x51c639[_0xf0b1('0x16')][_0xf0b1('0x18')]?_0xf0b1('0x20')+_0x51c639[_0xf0b1('0x16')][_0xf0b1('0x18')]+'}':_0xf0b1('0x21'),'context':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1a')],'exten':_0x3dc4c9[_0x520055][0x0]['exten'],'priority':_0x51c639[_0xf0b1('0xf')]++,'VoiceExtensionId':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1b')]});}_0x51c639[_0xf0b1('0x10')][_0xf0b1('0x12')]({'type':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x13')],'app':_0xf0b1('0x17'),'appdata':_0xf0b1('0x22')+_0x3dc4c9[_0x520055][0x0]['VoiceExtensionId'],'context':_0x3dc4c9[_0x520055][0x0]['context'],'exten':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x8')],'priority':_0x51c639['priority']++,'VoiceExtensionId':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1b')]});if(_0x51c639[_0xf0b1('0x16')]&&_0x51c639[_0xf0b1('0x16')][_0xf0b1('0xe')](_0xf0b1('0x23'))&&_0x51c639[_0xf0b1('0x16')][_0xf0b1('0x23')]!==_0xf0b1('0x24')){_0x51c639['extensions'][_0xf0b1('0x12')]({'type':_0x3dc4c9[_0x520055][0x0]['type'],'app':_0xf0b1('0x17'),'appdata':_0xf0b1('0x25'),'context':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1a')],'exten':_0x3dc4c9[_0x520055][0x0]['exten'],'priority':_0x51c639[_0xf0b1('0xf')]++,'VoiceExtensionId':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1b')]});_0x51c639[_0xf0b1('0x10')][_0xf0b1('0x12')]({'type':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x13')],'app':_0xf0b1('0x17'),'appdata':_0xf0b1('0x26')+_0x51c639[_0xf0b1('0x16')][_0xf0b1('0x23')]||'wav','context':_0x3dc4c9[_0x520055][0x0]['context'],'exten':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x8')],'priority':_0x51c639[_0xf0b1('0xf')]++,'VoiceExtensionId':_0x3dc4c9[_0x520055][0x0]['VoiceExtensionId']});}}_0x51c639[_0xf0b1('0x10')]['push']({'type':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x13')],'app':'Set','appdata':_0xf0b1('0x27'),'context':_0x3dc4c9[_0x520055][0x0]['context'],'exten':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x8')],'priority':_0x51c639[_0xf0b1('0xf')]++,'VoiceExtensionId':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1b')]});_0x51c639['extensions'][_0xf0b1('0x12')]({'type':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x13')],'app':_0xf0b1('0x17'),'appdata':_0xf0b1('0x28'),'context':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1a')],'exten':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x8')],'priority':_0x51c639[_0xf0b1('0xf')]++,'VoiceExtensionId':_0x3dc4c9[_0x520055][0x0]['VoiceExtensionId']});_0x51c639['extensions'][_0xf0b1('0x12')]({'type':_0x3dc4c9[_0x520055][0x0]['type'],'app':_0xf0b1('0x17'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1a')],'exten':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x8')],'priority':_0x51c639[_0xf0b1('0xf')]++,'VoiceExtensionId':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1b')]});for(var _0x1fbec9=0x0,_0x41b6a1=0x0;_0x1fbec9<_0x3dc4c9[_0x520055][_0xf0b1('0x29')];_0x1fbec9+=0x1,_0x41b6a1=0x0){var _0xab2606=_0x3dc4c9[_0x520055][_0x1fbec9];if(_0xab2606[_0xf0b1('0x13')]){_0xab2606[_0xf0b1('0x13')]=_0xab2606[_0xf0b1('0x13')][_0xf0b1('0x2a')]();}var _0xf401f5=[];var _0x1cc9e1=[];delete _0xab2606['id'];delete _0xab2606['createdAt'];delete _0xab2606[_0xf0b1('0x2b')];var _0x36313a=_0xab2606['interval']!==_0xf0b1('0x2c')?[_0xab2606['interval']]:_0xab2606[_0xf0b1('0x2d')]?_['map'](_[_0xf0b1('0xa')](_0x51c639[_0xf0b1('0x2')],{'IntervalId':_0xab2606['IntervalId']}),'interval'):[];if(_0xab2606[_0xf0b1('0xe')](_0xf0b1('0x2e'))){if(_0xab2606[_0xf0b1('0x2e')]&&_0xab2606[_0xf0b1('0x2e')]!=='--'){_0xf401f5[_0xf0b1('0x12')]({'type':_0xab2606[_0xf0b1('0x13')],'app':_0xf0b1('0x17'),'appdata':_0xf0b1('0x2f')+_0xab2606[_0xf0b1('0x2e')],'context':_0xab2606['context'],'exten':_0xab2606[_0xf0b1('0x8')],'priority':_0x36313a[_0xf0b1('0x29')]+_0x51c639[_0xf0b1('0xf')]+_0x41b6a1++,'VoiceExtensionId':_0xab2606[_0xf0b1('0x1b')]});}}if(_0xab2606[_0xf0b1('0x13')]===_0xf0b1('0x15')&&_0xab2606[_0xf0b1('0xe')](_0xf0b1('0x30'))){if(_0xab2606['callerID']){_0xf401f5[_0xf0b1('0x12')]({'type':_0xab2606[_0xf0b1('0x13')],'app':'ExecIf','appdata':_0xf0b1('0x31')+_0xab2606['callerID']+')','context':_0xab2606[_0xf0b1('0x1a')],'exten':_0xab2606[_0xf0b1('0x8')],'priority':_0x36313a[_0xf0b1('0x29')]+_0x51c639[_0xf0b1('0xf')]+_0x41b6a1++,'VoiceExtensionId':_0xab2606[_0xf0b1('0x1b')]});}else{_0xf401f5[_0xf0b1('0x12')]({'type':_0xab2606[_0xf0b1('0x13')],'app':'ExecIf','appdata':_0xf0b1('0x32'),'context':_0xab2606['context'],'exten':_0xab2606['exten'],'priority':_0x36313a[_0xf0b1('0x29')]+_0x51c639[_0xf0b1('0xf')]+_0x41b6a1++,'VoiceExtensionId':_0xab2606['VoiceExtensionId']});}}if(_0xab2606[_0xf0b1('0xe')]('answer')){if(_0x237c4b[_0xf0b1('0x33')](_0xab2606[_0xf0b1('0x34')][_0xf0b1('0x2a')]())>=0x0&&_0xab2606['appType']!==_0xf0b1('0x35')){if(_0xab2606[_0xf0b1('0x36')]){_0xf401f5[_0xf0b1('0x12')]({'type':_0xab2606[_0xf0b1('0x13')],'app':_0xf0b1('0x1d'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0xab2606['context'],'exten':_0xab2606[_0xf0b1('0x8')],'priority':_0x36313a[_0xf0b1('0x29')]+_0x51c639['priority']+_0x41b6a1++,'VoiceExtensionId':_0xab2606[_0xf0b1('0x1b')]});_0xf401f5[_0xf0b1('0x12')]({'type':_0xab2606[_0xf0b1('0x13')],'app':'Set','appdata':_0xf0b1('0x37'),'context':_0xab2606[_0xf0b1('0x1a')],'exten':_0xab2606['exten'],'priority':_0x36313a['length']+_0x51c639[_0xf0b1('0xf')]+_0x41b6a1++,'VoiceExtensionId':_0xab2606[_0xf0b1('0x1b')]});}else{_0xf401f5[_0xf0b1('0x12')]({'type':_0xab2606['type'],'app':'ExecIf','appdata':_0xf0b1('0x38'),'context':_0xab2606[_0xf0b1('0x1a')],'exten':_0xab2606[_0xf0b1('0x8')],'priority':_0x36313a[_0xf0b1('0x29')]+_0x51c639[_0xf0b1('0xf')]+_0x41b6a1++,'VoiceExtensionId':_0xab2606[_0xf0b1('0x1b')]});_0xf401f5['push']({'type':_0xab2606[_0xf0b1('0x13')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0xab2606[_0xf0b1('0x1a')],'exten':_0xab2606['exten'],'priority':_0x36313a[_0xf0b1('0x29')]+_0x51c639['priority']+_0x41b6a1++,'VoiceExtensionId':_0xab2606[_0xf0b1('0x1b')]});}}}for(var _0x40ab7a=0x0;_0x40ab7a<_0x36313a[_0xf0b1('0x29')];_0x40ab7a+=0x1){var _0x1d91d0=_0x51c639['priority']+_0x36313a['length'];var _0x148611=_0x40ab7a===_0x36313a[_0xf0b1('0x29')]-0x1?_0x51c639[_0xf0b1('0xf')]+_0xf401f5[_0xf0b1('0x29')]+_0x1cc9e1[_0xf0b1('0x29')]+0x2:_0x51c639['priority']+_0x40ab7a+0x1;_0xf401f5['splice'](_0x40ab7a,0x0,{'type':_0xab2606['type'],'app':'GotoIfTime','appdata':_0x36313a[_0x40ab7a]+'?'+_0xab2606[_0xf0b1('0x1a')]+_0xf0b1('0x39')+_0x1d91d0+':'+_0xab2606[_0xf0b1('0x1a')]+_0xf0b1('0x39')+_0x148611,'exten':_0xab2606[_0xf0b1('0x8')],'context':_0xab2606[_0xf0b1('0x1a')],'priority':_0x51c639[_0xf0b1('0xf')]+_0x40ab7a,'VoiceExtensionId':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1b')]});}_0xab2606[_0xf0b1('0xf')]=_0xf401f5['length']?_['last'](_0xf401f5)[_0xf0b1('0xf')]+0x1:_0x51c639[_0xf0b1('0xf')];_0x51c639[_0xf0b1('0xf')]=(_0x1cc9e1[_0xf0b1('0x29')]?_[_0xf0b1('0x3a')](_0x1cc9e1)[_0xf0b1('0xf')]:_0xab2606[_0xf0b1('0xf')])+0x1;_0x51c639[_0xf0b1('0x10')]=_[_0xf0b1('0x3b')](_0x51c639[_0xf0b1('0x10')],_0xf401f5,[_0xab2606],_0x1cc9e1);}_0x51c639['extensions'][_0xf0b1('0x12')]({'type':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x13')],'app':_0xf0b1('0x3c'),'exten':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x8')],'context':_0x3dc4c9[_0x520055][0x0]['context'],'priority':_0x51c639[_0xf0b1('0xf')],'VoiceExtensionId':_0x3dc4c9[_0x520055][0x0][_0xf0b1('0x1b')]});_0xe8a65f['push'](_0x3dc4c9[_0x520055][0x0]['VoiceExtensionId']);_0xa67fc5=_[_0xf0b1('0x3b')](_0xa67fc5,_0x51c639[_0xf0b1('0x10')]);}}return _0x3f597a[_0xf0b1('0x3d')](function(_0x599e0e){return _0x3f597a[_0xf0b1('0x1')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0xe8a65f}},'transaction':_0x599e0e})[_0xf0b1('0x4')](function(_0x459146){return _0x3f597a[_0xf0b1('0x1')]['VoiceExtension'][_0xf0b1('0x3e')](_[_0xf0b1('0x3f')](_0xa67fc5,_0xf0b1('0xf')),{'transaction':_0x599e0e});});});})[_0xf0b1('0x40')](function(_0x36e95d){console[_0xf0b1('0x41')](_0x36e95d);});}exports['rewrite']=rewrite;
\ No newline at end of file