Built motion from commit d3a776a.|0.0.126
[motion.git] / server / utils / voice_extension.js
1 var _0xa7ac=["\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x49\x6E\x74\x65\x72\x76\x61\x6C","\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x63\x72\x65\x61\x74\x65\x41\x70\x70\x73","\x72\x6F\x75\x74\x65\x55\x70\x64\x61\x74\x65","\x69\x64","\x62\x6F\x64\x79","\x74\x68\x65\x6E","\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x70\x61\x72\x61\x6D\x73","\x64\x65\x73\x74\x72\x6F\x79","\x75\x70\x64\x61\x74\x65","\x61\x6C\x6C","\x65\x78\x74\x65\x6E","\x74\x79\x70\x65","\x63\x6F\x6E\x74\x65\x78\x74","\x53\x65\x74","\x43\x44\x52\x28\x74\x79\x70\x65\x29\x3D\x25\x73","\x66\x6F\x72\x6D\x61\x74","\x6D\x65\x72\x67\x65","\x70\x75\x73\x68","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x43\x44\x52\x28\x74\x61\x67\x29\x3D\x25\x73","\x74\x61\x67","\x2D\x2D","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x49\x6E\x74\x65\x72\x76\x61\x6C\x49\x64","\x66\x69\x6C\x74\x65\x72","\x69\x6E\x74\x65\x72\x76\x61\x6C","\x6D\x61\x70","\x2A\x2C\x2A\x2C\x2A\x2C\x2A","\x66\x69\x6E\x64","\x6E\x61\x6D\x65","\x4E\x6F\x4F\x50","\x61\x70\x70","\x20\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x20\x53\x74\x61\x72\x74","\x47\x6F\x74\x6F\x49\x66\x54\x69\x6D\x65","\x25\x73\x3F\x25\x73\x2C\x24\x7B\x45\x58\x54\x45\x4E\x7D\x2C\x25\x73\x3A\x25\x73\x2C\x24\x7B\x45\x58\x54\x45\x4E\x7D\x2C\x25\x73","\x66\x6F\x72\x45\x61\x63\x68","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x64\x69\x61\x6C","\x61\x70\x70\x64\x61\x74\x61","\x43\x41\x4C\x4C\x45\x52\x49\x44\x28\x61\x6C\x6C\x29\x3D\x25\x73","\x53\x6B\x69\x70\x70\x65\x64\x20\x43\x61\x6C\x6C\x65\x72\x49\x44\x20\x53\x65\x74","\x72\x65\x63\x6F\x72\x64","\x4D\x69\x78\x4D\x6F\x6E\x69\x74\x6F\x72","\x24\x7B\x55\x4E\x49\x51\x55\x45\x49\x44\x7D\x2E\x77\x61\x76\x2C\x61\x62","\x53\x6B\x69\x70\x70\x65\x64\x20\x4D\x69\x78\x4D\x6F\x6E\x69\x74\x6F\x72","\x71\x75\x65\x75\x65","\x63\x75\x73\x74\x6F\x6D","\x50\x72\x6F\x67\x72\x65\x73\x73","","\x53\x6B\x69\x70\x70\x65\x64\x20\x50\x72\x6F\x67\x72\x65\x73\x73","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x72\x6F\x75\x74\x65\x69\x64\x3D\x25\x64","\x53\x6B\x69\x70\x70\x65\x64\x20\x4F\x75\x74\x6F\x75\x6E\x64\x20\x52\x6F\x75\x74\x65\x20\x49\x64\x20\x53\x65\x74","\x61\x70\x70\x54\x79\x70\x65","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x44\x69\x61\x6C","\x53\x49\x50\x2F\x25\x73\x2F\x25\x73\x24\x7B\x45\x58\x54\x45\x4E\x3A\x25\x73\x7D\x2C\x25\x73\x2C\x25\x73\x2C\x25\x73","\x63\x75\x74\x64\x69\x67\x69\x74\x73","\x65\x78\x74\x65\x72\x6E\x61\x6C\x44\x69\x61\x6C","\x53\x49\x50\x2F\x25\x73\x2F\x25\x73\x2C\x25\x73\x2C\x25\x73\x2C\x25\x73","\x69\x6E\x74\x65\x72\x6E\x61\x6C\x44\x69\x61\x6C","\x53\x49\x50\x2F\x25\x73\x2C\x25\x73\x2C\x25\x73\x2C\x25\x73","\x2C","\x6A\x6F\x69\x6E","\x53\x74\x6F\x70\x4D\x69\x78\x4D\x6F\x6E\x69\x74\x6F\x72","\x53\x6B\x69\x70\x70\x65\x64\x20\x53\x74\x6F\x70\x4D\x69\x78\x4D\x6F\x6E\x69\x74\x6F\x72","\x20\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x20\x45\x6E\x64","\x20\x63\x61\x6C\x6C\x20\x65\x6E\x64","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x48\x61\x6E\x67\x75\x70","\x66\x69\x6E\x64\x41\x6C\x6C"];var _=require(_0xa7ac[0]);var util=require(_0xa7ac[1]);var Interval=require(_0xa7ac[3])[_0xa7ac[2]];var sequelize=require(_0xa7ac[3])[_0xa7ac[4]];var VoiceExtension=require(_0xa7ac[3])[_0xa7ac[5]];exports[_0xa7ac[6]]= createApplications;exports[_0xa7ac[7]]= function(_0xec88x6,_0xec88x7){var sequelize=require(_0xa7ac[3])[_0xa7ac[4]];var VoiceExtension=require(_0xa7ac[3])[_0xa7ac[5]];if(_0xec88x6[_0xa7ac[9]][_0xa7ac[8]]){delete _0xec88x6[_0xa7ac[9]][_0xa7ac[8]]};return VoiceExtension[_0xa7ac[16]](_0xec88x6[_0xa7ac[9]],{where:{id:_0xec88x6[_0xa7ac[14]][_0xa7ac[8]]},transaction:_0xec88x7})[_0xa7ac[10]](function(_0xec88x8){if(_0xec88x6[_0xa7ac[9]][_0xa7ac[11]]){_0xec88x6[_0xa7ac[9]][_0xa7ac[8]]= _0xec88x6[_0xa7ac[14]][_0xa7ac[8]];return VoiceExtension[_0xa7ac[15]]({where:{VoiceExtensionId:_0xec88x6[_0xa7ac[14]][_0xa7ac[8]]},transaction:_0xec88x7})}})[_0xa7ac[10]](function(){if(_0xec88x6[_0xa7ac[9]][_0xa7ac[11]]&& Array[_0xa7ac[12]](_0xec88x6[_0xa7ac[9]].Applications)&& _0xec88x6[_0xa7ac[9]][_0xa7ac[11]][_0xa7ac[13]]){return _0xec88x6[_0xa7ac[9]]}})[_0xa7ac[10]](createApplications(_0xec88x6[_0xa7ac[9]].Applications,_0xec88x7))};function createApplications(_0xec88xa,_0xec88x7){var Interval=require(_0xa7ac[3])[_0xa7ac[2]];var VoiceExtension=require(_0xa7ac[3])[_0xa7ac[5]];return function(_0xec88x8){if(_0xec88x8){return Interval[_0xa7ac[76]]()[_0xa7ac[10]](function(_0xec88xb){var _0xec88xc=2;var _0xec88xd={exten:_0xec88x8[_0xa7ac[18]],type:_0xec88x8[_0xa7ac[19]],context:_0xec88x8[_0xa7ac[20]],VoiceExtensionId:_0xec88x8[_0xa7ac[8]]};var _0xec88xe=[];var _0xec88xf=7;var _0xec88x10=[],_0xec88x11=[];_0xec88x10[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[21],appdata:util[_0xa7ac[23]](_0xa7ac[22],_0xec88x8[_0xa7ac[19]]),priority:_0xec88xc},_0xec88xd));_0xec88xc++;if(_0xec88x8[_0xa7ac[19]]=== _0xa7ac[26]){_0xec88x10[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[21],appdata:util[_0xa7ac[23]](_0xa7ac[27],_0xec88x8[_0xa7ac[28]]|| _0xa7ac[29]),priority:_0xec88xc},_0xec88xd));_0xec88xc++};_0xec88xe[_0xa7ac[25]](VoiceExtension[_0xa7ac[30]](_0xec88x10,{transaction:_0xec88x7}));_0xec88xa[_0xa7ac[43]](function(_0xec88x12){var _0xec88x13=[];var _0xec88x14=[];if(_0xec88x12[_0xa7ac[31]]){var _0xec88x15=_[_0xa7ac[32]](_0xec88xb,{IntervalId:_0xec88x12[_0xa7ac[31]]});_0xec88x13= _0xec88x15[_0xa7ac[13]]?_[_0xa7ac[34]](_0xec88x15,_0xa7ac[33]):[_0xa7ac[35]];var _0xec88x16=_[_0xa7ac[36]](_0xec88xb,{id:_0xec88x12[_0xa7ac[31]]});_0xec88x12[_0xa7ac[33]]= _0xec88x16?_0xec88x16[_0xa7ac[37]]:_0xa7ac[35]}else {_0xec88x13= [_0xec88x12[_0xa7ac[33]]]};_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[38],appdata:_0xec88x12[_0xa7ac[39]]+ _0xa7ac[40],priority:_0xec88xc},_0xec88xd));_0xec88xc++;var _0xec88x17=_0xec88x13[_0xa7ac[13]];_0xec88x13[_0xa7ac[43]](function(_0xec88x18,_0xec88x19){_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[41],appdata:util[_0xa7ac[23]](_0xa7ac[42],_0xec88x18,_0xec88x8[_0xa7ac[20]],_0xec88xc+ (_0xec88x17- _0xec88x19),_0xec88x8[_0xa7ac[20]],((_0xec88x19+ 1)< _0xec88x17)?_0xec88xc+ 1:_0xec88xc+ _0xec88xf),priority:_0xec88xc},_0xec88xd));_0xec88xc++});if(_0xec88x12[_0xa7ac[39]][_0xa7ac[44]]()=== _0xa7ac[45]&& _0xec88x8[_0xa7ac[19]]=== _0xa7ac[26]&& _0xec88x12[_0xa7ac[46]][1]){_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[21],appdata:util[_0xa7ac[23]](_0xa7ac[47],_0xec88x12[_0xa7ac[46]][1]),priority:_0xec88xc},_0xec88xd))}else {_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[38],appdata:_0xa7ac[48],priority:_0xec88xc},_0xec88xd))};_0xec88xc++;if(_0xec88x12[_0xa7ac[39]][_0xa7ac[44]]()=== _0xa7ac[45]&& _0xec88x8[_0xa7ac[49]]&& _0xec88x8[_0xa7ac[19]]=== _0xa7ac[26]){_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[50],appdata:_0xa7ac[51],priority:_0xec88xc},_0xec88xd))}else {_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[38],appdata:_0xa7ac[52],priority:_0xec88xc},_0xec88xd))};_0xec88xc++;if(_0xec88x12[_0xa7ac[39]][_0xa7ac[44]]()=== _0xa7ac[53]&& _0xec88x12[_0xa7ac[39]]!== _0xa7ac[54]){_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[55],appdata:_0xa7ac[56],priority:_0xec88xc},_0xec88xd))}else {_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[38],appdata:_0xa7ac[57],priority:_0xec88xc},_0xec88xd))};_0xec88xc++;if(_0xec88x12[_0xa7ac[39]][_0xa7ac[44]]()=== _0xa7ac[45]&& _0xec88x8[_0xa7ac[19]]=== _0xa7ac[26]){_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[21],appdata:util[_0xa7ac[23]](_0xa7ac[58],_0xec88x8[_0xa7ac[8]]|| _0xa7ac[56]),priority:_0xec88xc},_0xec88xd))}else {_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[38],appdata:_0xa7ac[59],priority:_0xec88xc},_0xec88xd))};_0xec88xc++;if(_0xec88x12[_0xa7ac[39]][_0xa7ac[44]]()=== _0xa7ac[45]&& _0xec88x12[_0xa7ac[60]]=== _0xa7ac[61]){_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xec88x12[_0xa7ac[39]],appdata:util[_0xa7ac[23]](_0xa7ac[62],_0xec88x12[_0xa7ac[46]][0],_0xec88x12[_0xa7ac[46]][2]|| _0xa7ac[56],_0xec88x8[_0xa7ac[63]]|| 0,_0xec88x12[_0xa7ac[46]][3]|| _0xa7ac[56],_0xec88x12[_0xa7ac[46]][4]|| _0xa7ac[56],_0xec88x12[_0xa7ac[46]][5]|| _0xa7ac[56]),priority:_0xec88xc,IntervalId:_0xec88x12[_0xa7ac[31]]|| null,interval:_0xec88x12[_0xa7ac[33]]|| _0xa7ac[35],isApp:true,callerID:_0xec88x12[_0xa7ac[46]][1]|| null,appType:_0xec88x12[_0xa7ac[60]]},_0xec88xd))}else {if(_0xec88x12[_0xa7ac[39]][_0xa7ac[44]]()=== _0xa7ac[45]&& _0xec88x12[_0xa7ac[60]]=== _0xa7ac[64]){_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xec88x12[_0xa7ac[39]],appdata:util[_0xa7ac[23]](_0xa7ac[65],_0xec88x12[_0xa7ac[46]][0],_0xec88x12[_0xa7ac[46]][1],_0xec88x12[_0xa7ac[46]][2]|| _0xa7ac[56],_0xec88x12[_0xa7ac[46]][3]|| _0xa7ac[56],_0xec88x12[_0xa7ac[46]][4]|| _0xa7ac[56]),priority:_0xec88xc,IntervalId:_0xec88x12[_0xa7ac[31]]|| null,interval:_0xec88x12[_0xa7ac[33]]|| _0xa7ac[35],isApp:true,appType:_0xec88x12[_0xa7ac[60]]},_0xec88xd))}else {if(_0xec88x12[_0xa7ac[39]][_0xa7ac[44]]()=== _0xa7ac[45]&& _0xec88x12[_0xa7ac[60]]=== _0xa7ac[66]){_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xec88x12[_0xa7ac[39]],appdata:util[_0xa7ac[23]](_0xa7ac[67],_0xec88x12[_0xa7ac[46]][0],_0xec88x12[_0xa7ac[46]][1]|| _0xa7ac[56],_0xec88x12[_0xa7ac[46]][2]|| _0xa7ac[56],_0xec88x12[_0xa7ac[46]][3]|| _0xa7ac[56]),priority:_0xec88xc,IntervalId:_0xec88x12[_0xa7ac[31]]|| null,interval:_0xec88x12[_0xa7ac[33]]|| _0xa7ac[35],isApp:true,appType:_0xec88x12[_0xa7ac[60]]},_0xec88xd))}else {_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xec88x12[_0xa7ac[39]],appdata:_0xec88x12[_0xa7ac[46]][_0xa7ac[69]](_0xa7ac[68]),priority:_0xec88xc,IntervalId:_0xec88x12[_0xa7ac[31]],interval:_0xec88x12[_0xa7ac[33]]|| _0xa7ac[35],isApp:true,appType:_0xec88x12[_0xa7ac[60]]|| null},_0xec88xd))}}};_0xec88xc++;if(_0xec88x12[_0xa7ac[39]][_0xa7ac[44]]()=== _0xa7ac[45]&& _0xec88x8[_0xa7ac[49]]&& _0xec88x8[_0xa7ac[19]]=== _0xa7ac[26]){_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[70],appdata:_0xa7ac[56],priority:_0xec88xc},_0xec88xd))}else {_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[38],appdata:_0xa7ac[71],priority:_0xec88xc},_0xec88xd))};_0xec88xc++;_0xec88x14[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[38],appdata:_0xec88x12[_0xa7ac[39]]+ _0xa7ac[72],priority:_0xec88xc},_0xec88xd));_0xec88xc++;_0xec88xe[_0xa7ac[25]](VoiceExtension[_0xa7ac[30]](_0xec88x14,{transaction:_0xec88x7}))});_0xec88x11[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[38],appdata:_0xec88x8[_0xa7ac[19]]+ _0xa7ac[73],priority:_0xec88xc},_0xec88xd));_0xec88xc++;if(_0xec88x8[_0xa7ac[19]]=== _0xa7ac[74]|| _0xec88x8[_0xa7ac[19]]=== _0xa7ac[26]){_0xec88x11[_0xa7ac[25]](_[_0xa7ac[24]]({app:_0xa7ac[75],appdata:_0xa7ac[56],priority:_0xec88xc},_0xec88xd));_0xec88xc++};_0xec88xe[_0xa7ac[25]](VoiceExtension[_0xa7ac[30]](_0xec88x11,{transaction:_0xec88x7}));return _0xec88xe})[_0xa7ac[17]]()}}}