Built motion from commit c0cdc9d8.|2.6.28
[motion2.git] / server / api / voiceExtension / voiceExtension.model.js
index 2e103d9..f024ccf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64f7=['catch','define','VoiceExtension','voice_extensions','get','concat','Hangup','./voiceExtension.attributes','exports','type','context','exten','NoOp','CDR(routeAlias)=','alias','No\x20alias\x20set','inbound','Set','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url','length','trunk','param','phone','split','prefix','${EXTEN:','${EXTEN}','SIP','none','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','then','intervals','map','tag','toLowerCase','CDR(tag)=','callerID','Set(CALLERID(all)=','playback','includes','app','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appType','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last'];(function(_0x1298e5,_0x429a78){var _0x39d2b0=function(_0x5dd000){while(--_0x5dd000){_0x1298e5['push'](_0x1298e5['shift']());}};_0x39d2b0(++_0x429a78);}(_0x64f7,0xa3));var _0x764f=function(_0x1c190b,_0x12bfb1){_0x1c190b=_0x1c190b-0x0;var _0x53535a=_0x64f7[_0x1c190b];return _0x53535a;};'use strict';var _=require('lodash');var attributes=require(_0x764f('0x0'));module[_0x764f('0x1')]=function(_0x368a80){var _0x585aff=_0x368a80['models'];function _0x5f0064(_0x183ed3){var _0x594a2d=0x2;var _0x425fc4=[{'type':_0x183ed3[_0x764f('0x2')],'app':'Set','appdata':'CDR(type)='+_0x183ed3['type'],'context':_0x183ed3[_0x764f('0x3')],'exten':_0x183ed3[_0x764f('0x4')],'priority':_0x594a2d++,'VoiceExtensionId':_0x183ed3['id']},{'type':_0x183ed3[_0x764f('0x2')],'app':_0x183ed3['alias']?'Set':_0x764f('0x5'),'appdata':_0x183ed3['alias']?_0x764f('0x6')+_0x183ed3[_0x764f('0x7')]:_0x764f('0x8'),'context':_0x183ed3['context'],'exten':_0x183ed3[_0x764f('0x4')],'priority':_0x594a2d++,'VoiceExtensionId':_0x183ed3['id']}];if(_0x183ed3['type']==='inbound'){_0x425fc4['push']({'type':_0x764f('0x9'),'app':_0x764f('0xa'),'appdata':_0x764f('0xb')+_0x183ed3['id'],'context':_0x183ed3['context'],'exten':_0x183ed3[_0x764f('0x4')],'priority':_0x594a2d++,'VoiceExtensionId':_0x183ed3['id']});}_0x425fc4[_0x764f('0xc')]({'type':_0x183ed3[_0x764f('0x2')],'app':_0x764f('0xa'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x183ed3[_0x764f('0x3')],'exten':_0x183ed3[_0x764f('0x4')],'priority':_0x594a2d++,'VoiceExtensionId':_0x183ed3['id']},{'type':_0x183ed3[_0x764f('0x2')],'app':_0x764f('0xa'),'appdata':_0x764f('0xd'),'context':_0x183ed3[_0x764f('0x3')],'exten':_0x183ed3[_0x764f('0x4')],'priority':_0x594a2d++,'VoiceExtensionId':_0x183ed3['id']},{'type':_0x183ed3[_0x764f('0x2')],'app':'Set','appdata':_0x764f('0xe'),'context':_0x183ed3[_0x764f('0x3')],'exten':_0x183ed3[_0x764f('0x4')],'priority':_0x594a2d++,'VoiceExtensionId':_0x183ed3['id']});return _0x425fc4;}function _0x3e3316(_0x1f4265){var _0x3cceb8=0x2;var _0x139e46=[{'type':_0x764f('0xf'),'app':_0x764f('0xa'),'appdata':_0x764f('0x10'),'context':_0x1f4265[_0x764f('0x3')],'exten':_0x1f4265['exten'],'priority':_0x3cceb8++,'VoiceExtensionId':_0x1f4265['id']},{'type':_0x764f('0xf'),'app':_0x1f4265[_0x764f('0x7')]?_0x764f('0xa'):_0x764f('0x5'),'appdata':_0x1f4265['alias']?'CDR(routeAlias)='+_0x1f4265[_0x764f('0x7')]:_0x764f('0x8'),'context':_0x1f4265[_0x764f('0x3')],'exten':_0x1f4265['exten'],'priority':_0x3cceb8++,'VoiceExtensionId':_0x1f4265['id']},{'type':_0x764f('0xf'),'app':_0x764f('0xa'),'appdata':_0x764f('0x11')+(_0x1f4265['cutdigits']?'${EXTEN:'+_0x1f4265[_0x764f('0x12')]+'}':'${EXTEN}'),'context':_0x1f4265[_0x764f('0x3')],'exten':_0x1f4265[_0x764f('0x4')],'priority':_0x3cceb8++,'VoiceExtensionId':_0x1f4265['id']},{'type':_0x764f('0xf'),'app':_0x764f('0xa'),'appdata':_0x764f('0xb')+_0x1f4265['id'],'context':_0x1f4265[_0x764f('0x3')],'exten':_0x1f4265[_0x764f('0x4')],'priority':_0x3cceb8++,'VoiceExtensionId':_0x1f4265['id']},{'type':_0x764f('0xf'),'app':_0x764f('0x13'),'appdata':_0x764f('0x14')+(_0x3cceb8+0x2)+'):Goto('+(_0x3cceb8+0x1)+')','context':_0x1f4265['context'],'exten':_0x1f4265['exten'],'priority':_0x3cceb8++,'VoiceExtensionId':_0x1f4265['id']},{'type':_0x764f('0xf'),'app':_0x764f('0xa'),'appdata':_0x1f4265[_0x764f('0x12')]?_0x764f('0x15')+_0x1f4265[_0x764f('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x1f4265[_0x764f('0x3')],'exten':_0x1f4265[_0x764f('0x4')],'priority':_0x3cceb8++,'VoiceExtensionId':_0x1f4265['id']},{'type':_0x764f('0xf'),'app':_0x764f('0xa'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1f4265['context'],'exten':_0x1f4265[_0x764f('0x4')],'priority':_0x3cceb8++,'VoiceExtensionId':_0x1f4265['id']},{'type':_0x764f('0xf'),'app':_0x764f('0xa'),'appdata':_0x764f('0xd'),'context':_0x1f4265[_0x764f('0x3')],'exten':_0x1f4265[_0x764f('0x4')],'priority':_0x3cceb8++,'VoiceExtensionId':_0x1f4265['id']},{'type':'outbound','app':_0x764f('0xa'),'appdata':_0x764f('0xe'),'context':_0x1f4265[_0x764f('0x3')],'exten':_0x1f4265[_0x764f('0x4')],'priority':_0x3cceb8++,'VoiceExtensionId':_0x1f4265['id']},{'type':_0x764f('0xf'),'app':_0x764f('0xa'),'appdata':_0x764f('0x16')+_0x1f4265['id'],'context':_0x1f4265[_0x764f('0x3')],'exten':_0x1f4265[_0x764f('0x4')],'priority':_0x3cceb8++,'VoiceExtensionId':_0x1f4265['id']}];if(_0x1f4265[_0x764f('0x17')](_0x764f('0x18'))&&_0x1f4265['recordingFormat']!=='none'){_0x139e46[_0x764f('0xc')]({'type':_0x764f('0xf'),'app':_0x764f('0xa'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1f4265[_0x764f('0x3')],'exten':_0x1f4265[_0x764f('0x4')],'priority':_0x3cceb8++,'VoiceExtensionId':_0x1f4265['id']},{'type':'outbound','app':_0x764f('0xa'),'appdata':_0x764f('0x19')+_0x1f4265['recordingFormat']||_0x764f('0x1a'),'context':_0x1f4265[_0x764f('0x3')],'exten':_0x1f4265[_0x764f('0x4')],'priority':_0x3cceb8++,'VoiceExtensionId':_0x1f4265['id']});}return _0x139e46;}function _0x2f5403(_0x21c1cc,_0x584478){var _0x536e31=[{'name':'trunk','param':0x0},{'name':_0x764f('0x1b'),'param':0x1},{'name':_0x764f('0x1c'),'param':0x2},{'name':_0x764f('0x1d'),'param':0x3}];var _0x2247df={};var _0x42c7f8=_0x584478['split'](',');var _0x36cfd0=[];for(var _0x35937a=0x0;_0x35937a<_0x536e31[_0x764f('0x1e')];_0x35937a++){switch(_0x536e31[_0x35937a]['name']){case _0x764f('0x1f'):_0x2247df[_0x764f('0x1f')]=_0x42c7f8[_0x536e31[_0x35937a][_0x764f('0x20')]]['split']('/')[0x1];_0x2247df[_0x764f('0x21')]=_0x42c7f8[_0x536e31[_0x35937a][_0x764f('0x20')]][_0x764f('0x22')]('/')[0x2];_0x2247df['prefix']=_0x2247df[_0x764f('0x21')]?_0x2247df[_0x764f('0x21')]['split']('$')[0x0]:undefined;_0x2247df[_0x764f('0x21')]=_0x21c1cc[_0x764f('0x12')]?(_0x2247df[_0x764f('0x23')]||'')+_0x764f('0x24')+_0x21c1cc[_0x764f('0x12')]+'}':(_0x2247df['prefix']||'')+_0x764f('0x25');_0x36cfd0[_0x536e31[_0x35937a][_0x764f('0x20')]]=[_0x764f('0x26'),_0x2247df[_0x764f('0x1f')],_0x2247df[_0x764f('0x21')]]['join']('/');break;case _0x764f('0x1c'):_0x2247df['options']=_0x42c7f8[_0x536e31[_0x35937a]['param']];if(_0x21c1cc['recordingFormat']!==_0x764f('0x27')){if(_0x2247df[_0x764f('0x1c')]['indexOf'](_0x764f('0x28'))<0x0){_0x2247df['options']+=_0x764f('0x28');}}else{_0x2247df[_0x764f('0x1c')]=_0x2247df[_0x764f('0x1c')][_0x764f('0x29')](_0x764f('0x28'),'');}_0x36cfd0[_0x536e31[_0x35937a][_0x764f('0x20')]]=_0x2247df[_0x764f('0x1c')];break;default:_0x36cfd0[_0x536e31[_0x35937a][_0x764f('0x20')]]=_0x42c7f8[_0x536e31[_0x35937a][_0x764f('0x20')]];}}return _0x36cfd0[_0x764f('0x2a')](',');}function _0x1aad7d(_0x41b5a0,_0x4a5eac,_0x98460c){return new Promise(function(_0x3aa761,_0x3595e9){var _0x1f800b=[];if(_[_0x764f('0x2b')](_0x4a5eac))return _0x3aa761(_0x1f800b);_0x585aff[_0x764f('0x2c')][_0x764f('0x2d')]({'attributes':['id',_0x764f('0x2e'),_0x764f('0x2f')],'raw':!![]})[_0x764f('0x30')](function(_0x4f7b40){for(var _0x10a032=0x0,_0x1f967e=0x0;_0x10a032<_0x4a5eac[_0x764f('0x1e')];_0x10a032++,_0x1f967e=0x0){var _0x2f686f=_0x4a5eac[_0x10a032];var _0x5e1e29=[];var _0x4e7117=[];delete _0x2f686f['id'];if(_0x2f686f[_0x764f('0x2e')]!=='*,*,*,*'){_0x2f686f[_0x764f('0x31')]=[_0x2f686f['interval']];}else{_0x2f686f['intervals']=_0x2f686f['IntervalId']?_[_0x764f('0x32')](_['filter'](_0x4f7b40,{'IntervalId':_0x2f686f['IntervalId']}),'interval'):[];}_0x2f686f[_0x764f('0x3')]=_0x41b5a0[_0x764f('0x3')];_0x2f686f[_0x764f('0x4')]=_0x41b5a0[_0x764f('0x4')];if(_0x2f686f[_0x764f('0x2')])_0x2f686f[_0x764f('0x2')]=_0x2f686f[_0x764f('0x2')]['toLowerCase']();if(_0x41b5a0[_0x764f('0x2')]===_0x764f('0xf')){if(_0x2f686f[_0x764f('0x17')](_0x764f('0x33'))&&_0x2f686f['tag']&&_0x2f686f[_0x764f('0x33')]!=='--'){_0x5e1e29[_0x764f('0xc')]({'type':_0x2f686f[_0x764f('0x2')][_0x764f('0x34')](),'app':'Set','appdata':_0x764f('0x35')+_0x2f686f['tag'],'context':_0x41b5a0[_0x764f('0x3')],'exten':_0x41b5a0[_0x764f('0x4')],'priority':_0x2f686f[_0x764f('0x31')]['length']+_0x98460c+_0x1f967e++,'VoiceExtensionId':_0x41b5a0['id']});}_0x5e1e29[_0x764f('0xc')]({'type':_0x2f686f[_0x764f('0x2')][_0x764f('0x34')](),'app':_0x764f('0x13'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x2f686f[_0x764f('0x36')]?_0x764f('0x37')+_0x2f686f[_0x764f('0x36')]+')':'NoOp(No\x20number\x20available)'),'context':_0x41b5a0[_0x764f('0x3')],'exten':_0x41b5a0[_0x764f('0x4')],'priority':_0x2f686f[_0x764f('0x31')][_0x764f('0x1e')]+_0x98460c+_0x1f967e++,'VoiceExtensionId':_0x41b5a0['id']});}else{if(_0x2f686f[_0x764f('0x17')]('answer')){if(['queue',_0x764f('0x38')][_0x764f('0x39')](_0x2f686f[_0x764f('0x3a')]['toLowerCase']())&&_0x2f686f['appType']!==_0x764f('0x3b')){if(_0x2f686f[_0x764f('0x3c')]){_0x5e1e29['push']({'type':_0x2f686f[_0x764f('0x2')][_0x764f('0x34')](),'app':_0x764f('0x13'),'appdata':_0x764f('0x3d'),'context':_0x41b5a0[_0x764f('0x3')],'exten':_0x41b5a0[_0x764f('0x4')],'priority':_0x2f686f['intervals'][_0x764f('0x1e')]+_0x98460c+_0x1f967e++,'VoiceExtensionId':_0x41b5a0['id']});_0x5e1e29[_0x764f('0xc')]({'type':_0x2f686f[_0x764f('0x2')][_0x764f('0x34')](),'app':_0x764f('0xa'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x41b5a0['context'],'exten':_0x41b5a0[_0x764f('0x4')],'priority':_0x2f686f[_0x764f('0x31')][_0x764f('0x1e')]+_0x98460c+_0x1f967e++,'VoiceExtensionId':_0x41b5a0['id']});}else{_0x5e1e29[_0x764f('0xc')]({'type':_0x2f686f[_0x764f('0x2')]['toLowerCase'](),'app':_0x764f('0x13'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x41b5a0['context'],'exten':_0x41b5a0[_0x764f('0x4')],'priority':_0x2f686f['intervals']['length']+_0x98460c+_0x1f967e++,'VoiceExtensionId':_0x41b5a0['id']});_0x5e1e29[_0x764f('0xc')]({'type':_0x2f686f[_0x764f('0x2')]['toLowerCase'](),'app':_0x764f('0xa'),'appdata':_0x764f('0x3e'),'context':_0x41b5a0[_0x764f('0x3')],'exten':_0x41b5a0[_0x764f('0x4')],'priority':_0x2f686f['intervals'][_0x764f('0x1e')]+_0x98460c+_0x1f967e++,'VoiceExtensionId':_0x41b5a0['id']});}}}}for(var _0x18c1e0=0x0;_0x18c1e0<_0x2f686f[_0x764f('0x31')][_0x764f('0x1e')];_0x18c1e0++){var _0x8ac1c0=_0x98460c+_0x2f686f[_0x764f('0x31')][_0x764f('0x1e')];var _0x38c565=_0x18c1e0===_0x2f686f['intervals'][_0x764f('0x1e')]-0x1?_0x98460c+_0x5e1e29[_0x764f('0x1e')]+_0x4e7117[_0x764f('0x1e')]+0x2:_0x98460c+_0x18c1e0+0x1;_0x5e1e29[_0x764f('0x3f')](_0x18c1e0,0x0,{'type':_0x41b5a0['type'],'app':'GotoIfTime','appdata':_0x2f686f['intervals'][_0x18c1e0]+'?'+_0x41b5a0[_0x764f('0x3')]+_0x764f('0x40')+_0x8ac1c0+':'+_0x41b5a0[_0x764f('0x3')]+',${EXTEN},'+_0x38c565,'exten':_0x41b5a0[_0x764f('0x4')],'context':_0x41b5a0['context'],'priority':_0x98460c+_0x18c1e0,'VoiceExtensionId':_0x41b5a0['id']});}if(_0x2f686f[_0x764f('0x41')]==='outboundDial'){_0x2f686f[_0x764f('0x42')]=_0x2f5403(_0x41b5a0,_0x2f686f[_0x764f('0x42')]);}if(_0x2f686f[_0x764f('0x41')]===_0x764f('0x43')){_0x5e1e29[_0x764f('0xc')]({'type':_0x2f686f['type'][_0x764f('0x34')](),'app':_0x764f('0xa'),'appdata':_0x764f('0x44'),'context':_0x41b5a0['context'],'exten':_0x41b5a0[_0x764f('0x4')],'priority':_0x2f686f['intervals'][_0x764f('0x1e')]+_0x98460c+_0x1f967e++,'VoiceExtensionId':_0x41b5a0['id']});}_0x2f686f[_0x764f('0x45')]=_0x5e1e29[_0x764f('0x1e')]?_[_0x764f('0x46')](_0x5e1e29)[_0x764f('0x45')]+0x1:_0x98460c;_0x1f800b=_['concat'](_0x1f800b,_0x5e1e29,[_0x2f686f],_0x4e7117);_0x98460c=_[_0x764f('0x46')](_0x1f800b)[_0x764f('0x45')]+0x1;}return _0x3aa761(_0x1f800b);})[_0x764f('0x47')](function(_0xdad216){_0x3595e9(_0xdad216);});});}return _0x368a80[_0x764f('0x48')](_0x764f('0x49'),attributes,{'tableName':_0x764f('0x4a'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x354e28){var _0x25d507=this[_0x764f('0x4b')]({'plain':!![]});var _0x1760ac=_0x25d507[_0x764f('0x2')]===_0x764f('0xf')?_0x3e3316(_0x25d507):_0x5f0064(_0x25d507);return _0x1aad7d(_0x25d507,_0x354e28,_[_0x764f('0x46')](_0x1760ac)['priority']+0x1)[_0x764f('0x30')](function(_0x2daedb){var _0x146615=_[_0x764f('0x4c')](_0x1760ac,_0x2daedb);_0x146615[_0x764f('0xc')]({'type':_0x25d507[_0x764f('0x2')],'app':_0x764f('0x4d'),'exten':_0x25d507[_0x764f('0x4')],'context':_0x25d507[_0x764f('0x3')],'priority':_[_0x764f('0x46')](_0x146615)[_0x764f('0x45')]+0x1,'VoiceExtensionId':_0x25d507['id']});return _0x146615;});}}});};
\ No newline at end of file
+var _0x3182=['inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','url','split','trunk','param','phone','prefix','SIP','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','interval','IntervalId','then','length','*,*,*,*','intervals','map','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','VoiceExtension','voice_extensions','get','Hangup','lodash','exports','Set','CDR(type)=','type','context','exten','alias','No\x20alias\x20set'];(function(_0x22c19e,_0x574112){var _0x387ffa=function(_0x410842){while(--_0x410842){_0x22c19e['push'](_0x22c19e['shift']());}};_0x387ffa(++_0x574112);}(_0x3182,0x99));var _0x2318=function(_0x3d2295,_0x2eb436){_0x3d2295=_0x3d2295-0x0;var _0x2fb84a=_0x3182[_0x3d2295];return _0x2fb84a;};'use strict';var _=require(_0x2318('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x2318('0x1')]=function(_0x57d04b){var _0x11da18=_0x57d04b['models'];function _0xaf0d9e(_0x5b0d74){var _0x556d75=0x2;var _0x21cd0a=[{'type':_0x5b0d74['type'],'app':_0x2318('0x2'),'appdata':_0x2318('0x3')+_0x5b0d74[_0x2318('0x4')],'context':_0x5b0d74[_0x2318('0x5')],'exten':_0x5b0d74[_0x2318('0x6')],'priority':_0x556d75++,'VoiceExtensionId':_0x5b0d74['id']},{'type':_0x5b0d74['type'],'app':_0x5b0d74[_0x2318('0x7')]?_0x2318('0x2'):'NoOp','appdata':_0x5b0d74[_0x2318('0x7')]?'CDR(routeAlias)='+_0x5b0d74[_0x2318('0x7')]:_0x2318('0x8'),'context':_0x5b0d74['context'],'exten':_0x5b0d74['exten'],'priority':_0x556d75++,'VoiceExtensionId':_0x5b0d74['id']}];if(_0x5b0d74['type']===_0x2318('0x9')){_0x21cd0a[_0x2318('0xa')]({'type':_0x2318('0x9'),'app':_0x2318('0x2'),'appdata':_0x2318('0xb')+_0x5b0d74['id'],'context':_0x5b0d74[_0x2318('0x5')],'exten':_0x5b0d74[_0x2318('0x6')],'priority':_0x556d75++,'VoiceExtensionId':_0x5b0d74['id']});}_0x21cd0a['push']({'type':_0x5b0d74[_0x2318('0x4')],'app':_0x2318('0x2'),'appdata':_0x2318('0xc'),'context':_0x5b0d74[_0x2318('0x5')],'exten':_0x5b0d74[_0x2318('0x6')],'priority':_0x556d75++,'VoiceExtensionId':_0x5b0d74['id']},{'type':_0x5b0d74['type'],'app':_0x2318('0x2'),'appdata':_0x2318('0xd'),'context':_0x5b0d74[_0x2318('0x5')],'exten':_0x5b0d74[_0x2318('0x6')],'priority':_0x556d75++,'VoiceExtensionId':_0x5b0d74['id']},{'type':_0x5b0d74[_0x2318('0x4')],'app':_0x2318('0x2'),'appdata':_0x2318('0xe'),'context':_0x5b0d74[_0x2318('0x5')],'exten':_0x5b0d74['exten'],'priority':_0x556d75++,'VoiceExtensionId':_0x5b0d74['id']});return _0x21cd0a;}function _0x46aa1f(_0x4f38b0){var _0x5e97b7=0x2;var _0x1960a3=[{'type':_0x2318('0xf'),'app':_0x2318('0x2'),'appdata':_0x2318('0x10'),'context':_0x4f38b0[_0x2318('0x5')],'exten':_0x4f38b0[_0x2318('0x6')],'priority':_0x5e97b7++,'VoiceExtensionId':_0x4f38b0['id']},{'type':'outbound','app':_0x4f38b0['alias']?_0x2318('0x2'):'NoOp','appdata':_0x4f38b0[_0x2318('0x7')]?'CDR(routeAlias)='+_0x4f38b0[_0x2318('0x7')]:_0x2318('0x8'),'context':_0x4f38b0[_0x2318('0x5')],'exten':_0x4f38b0[_0x2318('0x6')],'priority':_0x5e97b7++,'VoiceExtensionId':_0x4f38b0['id']},{'type':_0x2318('0xf'),'app':_0x2318('0x2'),'appdata':'CDR(destination)='+(_0x4f38b0[_0x2318('0x11')]?_0x2318('0x12')+_0x4f38b0[_0x2318('0x11')]+'}':_0x2318('0x13')),'context':_0x4f38b0[_0x2318('0x5')],'exten':_0x4f38b0[_0x2318('0x6')],'priority':_0x5e97b7++,'VoiceExtensionId':_0x4f38b0['id']},{'type':_0x2318('0xf'),'app':_0x2318('0x2'),'appdata':_0x2318('0xb')+_0x4f38b0['id'],'context':_0x4f38b0[_0x2318('0x5')],'exten':_0x4f38b0[_0x2318('0x6')],'priority':_0x5e97b7++,'VoiceExtensionId':_0x4f38b0['id']},{'type':_0x2318('0xf'),'app':_0x2318('0x14'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5e97b7+0x2)+_0x2318('0x15')+(_0x5e97b7+0x1)+')','context':_0x4f38b0[_0x2318('0x5')],'exten':_0x4f38b0[_0x2318('0x6')],'priority':_0x5e97b7++,'VoiceExtensionId':_0x4f38b0['id']},{'type':_0x2318('0xf'),'app':_0x2318('0x2'),'appdata':_0x4f38b0[_0x2318('0x11')]?_0x2318('0x16')+_0x4f38b0[_0x2318('0x11')]+'}':'CDR(prefix)=noprefix','context':_0x4f38b0[_0x2318('0x5')],'exten':_0x4f38b0['exten'],'priority':_0x5e97b7++,'VoiceExtensionId':_0x4f38b0['id']},{'type':_0x2318('0xf'),'app':_0x2318('0x2'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4f38b0[_0x2318('0x5')],'exten':_0x4f38b0[_0x2318('0x6')],'priority':_0x5e97b7++,'VoiceExtensionId':_0x4f38b0['id']},{'type':_0x2318('0xf'),'app':_0x2318('0x2'),'appdata':_0x2318('0xd'),'context':_0x4f38b0[_0x2318('0x5')],'exten':_0x4f38b0['exten'],'priority':_0x5e97b7++,'VoiceExtensionId':_0x4f38b0['id']},{'type':_0x2318('0xf'),'app':_0x2318('0x2'),'appdata':_0x2318('0xe'),'context':_0x4f38b0[_0x2318('0x5')],'exten':_0x4f38b0['exten'],'priority':_0x5e97b7++,'VoiceExtensionId':_0x4f38b0['id']},{'type':_0x2318('0xf'),'app':_0x2318('0x2'),'appdata':_0x2318('0x17')+_0x4f38b0['id'],'context':_0x4f38b0[_0x2318('0x5')],'exten':_0x4f38b0[_0x2318('0x6')],'priority':_0x5e97b7++,'VoiceExtensionId':_0x4f38b0['id']}];if(_0x4f38b0[_0x2318('0x18')](_0x2318('0x19'))&&_0x4f38b0[_0x2318('0x19')]!==_0x2318('0x1a')){_0x1960a3['push']({'type':_0x2318('0xf'),'app':'Set','appdata':_0x2318('0x1b'),'context':_0x4f38b0[_0x2318('0x5')],'exten':_0x4f38b0['exten'],'priority':_0x5e97b7++,'VoiceExtensionId':_0x4f38b0['id']},{'type':'outbound','app':_0x2318('0x2'),'appdata':_0x2318('0x1c')+_0x4f38b0[_0x2318('0x19')]||'wav','context':_0x4f38b0[_0x2318('0x5')],'exten':_0x4f38b0[_0x2318('0x6')],'priority':_0x5e97b7++,'VoiceExtensionId':_0x4f38b0['id']});}return _0x1960a3;}function _0x4347ec(_0x1c7b04,_0x567e82){var _0x1280f9=[{'name':'trunk','param':0x0},{'name':_0x2318('0x1d'),'param':0x1},{'name':_0x2318('0x1e'),'param':0x2},{'name':_0x2318('0x1f'),'param':0x3}];var _0x12b33c={};var _0x40edc0=_0x567e82[_0x2318('0x20')](',');var _0xb234e8=[];for(var _0x57b34e=0x0;_0x57b34e<_0x1280f9['length'];_0x57b34e++){switch(_0x1280f9[_0x57b34e]['name']){case'trunk':_0x12b33c[_0x2318('0x21')]=_0x40edc0[_0x1280f9[_0x57b34e][_0x2318('0x22')]][_0x2318('0x20')]('/')[0x1];_0x12b33c[_0x2318('0x23')]=_0x40edc0[_0x1280f9[_0x57b34e][_0x2318('0x22')]][_0x2318('0x20')]('/')[0x2];_0x12b33c[_0x2318('0x24')]=_0x12b33c[_0x2318('0x23')]?_0x12b33c[_0x2318('0x23')][_0x2318('0x20')]('$')[0x0]:undefined;_0x12b33c['phone']=_0x1c7b04[_0x2318('0x11')]?(_0x12b33c[_0x2318('0x24')]||'')+_0x2318('0x12')+_0x1c7b04[_0x2318('0x11')]+'}':(_0x12b33c['prefix']||'')+_0x2318('0x13');_0xb234e8[_0x1280f9[_0x57b34e][_0x2318('0x22')]]=[_0x2318('0x25'),_0x12b33c[_0x2318('0x21')],_0x12b33c[_0x2318('0x23')]]['join']('/');break;case _0x2318('0x1e'):_0x12b33c[_0x2318('0x1e')]=_0x40edc0[_0x1280f9[_0x57b34e][_0x2318('0x22')]];if(_0x1c7b04[_0x2318('0x19')]!==_0x2318('0x1a')){if(_0x12b33c['options'][_0x2318('0x26')]('U(xcally-mixmonitor-context)')<0x0){_0x12b33c[_0x2318('0x1e')]+=_0x2318('0x27');}}else{_0x12b33c[_0x2318('0x1e')]=_0x12b33c[_0x2318('0x1e')][_0x2318('0x28')](_0x2318('0x27'),'');}_0xb234e8[_0x1280f9[_0x57b34e][_0x2318('0x22')]]=_0x12b33c['options'];break;default:_0xb234e8[_0x1280f9[_0x57b34e][_0x2318('0x22')]]=_0x40edc0[_0x1280f9[_0x57b34e]['param']];}}return _0xb234e8[_0x2318('0x29')](',');}function _0x2a2d00(_0x2a1f6e,_0x2c438,_0x3442d8){return new Promise(function(_0x51ce31,_0x24c4fe){var _0xe1cdce=[];if(_[_0x2318('0x2a')](_0x2c438))return _0x51ce31(_0xe1cdce);_0x11da18[_0x2318('0x2b')]['findAll']({'attributes':['id',_0x2318('0x2c'),_0x2318('0x2d')],'raw':!![]})[_0x2318('0x2e')](function(_0x56bd4a){for(var _0x3a0aeb=0x0,_0x4a7d01=0x0;_0x3a0aeb<_0x2c438[_0x2318('0x2f')];_0x3a0aeb++,_0x4a7d01=0x0){var _0x2e0f62=_0x2c438[_0x3a0aeb];var _0x3eb534=[];var _0x49b879=[];delete _0x2e0f62['id'];if(_0x2e0f62[_0x2318('0x2c')]!==_0x2318('0x30')){_0x2e0f62[_0x2318('0x31')]=[_0x2e0f62[_0x2318('0x2c')]];}else{_0x2e0f62['intervals']=_0x2e0f62[_0x2318('0x2d')]?_[_0x2318('0x32')](_['filter'](_0x56bd4a,{'IntervalId':_0x2e0f62[_0x2318('0x2d')]}),_0x2318('0x2c')):[];}_0x2e0f62[_0x2318('0x5')]=_0x2a1f6e['context'];_0x2e0f62[_0x2318('0x6')]=_0x2a1f6e['exten'];if(_0x2e0f62[_0x2318('0x4')])_0x2e0f62['type']=_0x2e0f62['type']['toLowerCase']();if(_0x2a1f6e[_0x2318('0x4')]===_0x2318('0xf')){if(_0x2e0f62['hasOwnProperty'](_0x2318('0x33'))&&_0x2e0f62['tag']&&_0x2e0f62[_0x2318('0x33')]!=='--'){_0x3eb534[_0x2318('0xa')]({'type':_0x2e0f62['type'][_0x2318('0x34')](),'app':_0x2318('0x2'),'appdata':_0x2318('0x35')+_0x2e0f62[_0x2318('0x33')],'context':_0x2a1f6e[_0x2318('0x5')],'exten':_0x2a1f6e['exten'],'priority':_0x2e0f62[_0x2318('0x31')]['length']+_0x3442d8+_0x4a7d01++,'VoiceExtensionId':_0x2a1f6e['id']});}_0x3eb534['push']({'type':_0x2e0f62[_0x2318('0x4')][_0x2318('0x34')](),'app':_0x2318('0x14'),'appdata':_0x2318('0x36')+(_0x2e0f62[_0x2318('0x37')]?_0x2318('0x38')+_0x2e0f62[_0x2318('0x37')]+')':_0x2318('0x39')),'context':_0x2a1f6e[_0x2318('0x5')],'exten':_0x2a1f6e['exten'],'priority':_0x2e0f62[_0x2318('0x31')][_0x2318('0x2f')]+_0x3442d8+_0x4a7d01++,'VoiceExtensionId':_0x2a1f6e['id']});}else{if(_0x2e0f62[_0x2318('0x18')](_0x2318('0x3a'))){if([_0x2318('0x3b'),'playback']['includes'](_0x2e0f62[_0x2318('0x3c')][_0x2318('0x34')]())&&_0x2e0f62['appType']!==_0x2318('0x3d')){if(_0x2e0f62[_0x2318('0x3a')]){_0x3eb534['push']({'type':_0x2e0f62[_0x2318('0x4')][_0x2318('0x34')](),'app':_0x2318('0x14'),'appdata':_0x2318('0x3e'),'context':_0x2a1f6e['context'],'exten':_0x2a1f6e[_0x2318('0x6')],'priority':_0x2e0f62[_0x2318('0x31')]['length']+_0x3442d8+_0x4a7d01++,'VoiceExtensionId':_0x2a1f6e['id']});_0x3eb534[_0x2318('0xa')]({'type':_0x2e0f62[_0x2318('0x4')]['toLowerCase'](),'app':_0x2318('0x2'),'appdata':_0x2318('0x3f'),'context':_0x2a1f6e['context'],'exten':_0x2a1f6e[_0x2318('0x6')],'priority':_0x2e0f62['intervals'][_0x2318('0x2f')]+_0x3442d8+_0x4a7d01++,'VoiceExtensionId':_0x2a1f6e['id']});}else{_0x3eb534[_0x2318('0xa')]({'type':_0x2e0f62['type']['toLowerCase'](),'app':'ExecIf','appdata':_0x2318('0x40'),'context':_0x2a1f6e[_0x2318('0x5')],'exten':_0x2a1f6e[_0x2318('0x6')],'priority':_0x2e0f62['intervals'][_0x2318('0x2f')]+_0x3442d8+_0x4a7d01++,'VoiceExtensionId':_0x2a1f6e['id']});_0x3eb534[_0x2318('0xa')]({'type':_0x2e0f62[_0x2318('0x4')][_0x2318('0x34')](),'app':_0x2318('0x2'),'appdata':_0x2318('0x41'),'context':_0x2a1f6e[_0x2318('0x5')],'exten':_0x2a1f6e['exten'],'priority':_0x2e0f62['intervals'][_0x2318('0x2f')]+_0x3442d8+_0x4a7d01++,'VoiceExtensionId':_0x2a1f6e['id']});}}}}for(var _0x7a1880=0x0;_0x7a1880<_0x2e0f62[_0x2318('0x31')][_0x2318('0x2f')];_0x7a1880++){var _0x5e2ae3=_0x3442d8+_0x2e0f62[_0x2318('0x31')][_0x2318('0x2f')];var _0x39cdd5=_0x7a1880===_0x2e0f62[_0x2318('0x31')][_0x2318('0x2f')]-0x1?_0x3442d8+_0x3eb534[_0x2318('0x2f')]+_0x49b879[_0x2318('0x2f')]+0x2:_0x3442d8+_0x7a1880+0x1;_0x3eb534[_0x2318('0x42')](_0x7a1880,0x0,{'type':_0x2a1f6e[_0x2318('0x4')],'app':_0x2318('0x43'),'appdata':_0x2e0f62[_0x2318('0x31')][_0x7a1880]+'?'+_0x2a1f6e[_0x2318('0x5')]+_0x2318('0x44')+_0x5e2ae3+':'+_0x2a1f6e[_0x2318('0x5')]+_0x2318('0x44')+_0x39cdd5,'exten':_0x2a1f6e[_0x2318('0x6')],'context':_0x2a1f6e['context'],'priority':_0x3442d8+_0x7a1880,'VoiceExtensionId':_0x2a1f6e['id']});}if(_0x2e0f62[_0x2318('0x45')]==='outboundDial'){_0x2e0f62[_0x2318('0x46')]=_0x4347ec(_0x2a1f6e,_0x2e0f62[_0x2318('0x46')]);}if(_0x2e0f62[_0x2318('0x45')]===_0x2318('0x47')){_0x3eb534[_0x2318('0xa')]({'type':_0x2e0f62[_0x2318('0x4')][_0x2318('0x34')](),'app':_0x2318('0x2'),'appdata':_0x2318('0x48'),'context':_0x2a1f6e[_0x2318('0x5')],'exten':_0x2a1f6e['exten'],'priority':_0x2e0f62['intervals'][_0x2318('0x2f')]+_0x3442d8+_0x4a7d01++,'VoiceExtensionId':_0x2a1f6e['id']});}_0x2e0f62[_0x2318('0x49')]=_0x3eb534[_0x2318('0x2f')]?_[_0x2318('0x4a')](_0x3eb534)['priority']+0x1:_0x3442d8;_0xe1cdce=_[_0x2318('0x4b')](_0xe1cdce,_0x3eb534,[_0x2e0f62],_0x49b879);_0x3442d8=_['last'](_0xe1cdce)['priority']+0x1;}return _0x51ce31(_0xe1cdce);})[_0x2318('0x4c')](function(_0x10fee6){_0x24c4fe(_0x10fee6);});});}return _0x57d04b['define'](_0x2318('0x4d'),attributes,{'tableName':_0x2318('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3c557c){var _0x4cff0d=this[_0x2318('0x4f')]({'plain':!![]});var _0x5bf1d6=_0x4cff0d[_0x2318('0x4')]==='outbound'?_0x46aa1f(_0x4cff0d):_0xaf0d9e(_0x4cff0d);return _0x2a2d00(_0x4cff0d,_0x3c557c,_[_0x2318('0x4a')](_0x5bf1d6)[_0x2318('0x49')]+0x1)[_0x2318('0x2e')](function(_0x1b5d1c){var _0x24fe45=_[_0x2318('0x4b')](_0x5bf1d6,_0x1b5d1c);_0x24fe45[_0x2318('0xa')]({'type':_0x4cff0d['type'],'app':_0x2318('0x50'),'exten':_0x4cff0d[_0x2318('0x6')],'context':_0x4cff0d['context'],'priority':_[_0x2318('0x4a')](_0x24fe45)[_0x2318('0x49')]+0x1,'VoiceExtensionId':_0x4cff0d['id']});return _0x24fe45;});}}});};
\ No newline at end of file