Built motion from commit 7db2bc834.|1.0.35
[motion.git] / server / config / agi / lib / scripts / index.js
index 4e4c07a..c6919ab 100644 (file)
@@ -1 +1 @@
-var _0x19a2=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x66\x73","\x70\x61\x74\x68","\x68\x74\x74\x70","\x68\x74\x74\x70\x73","\x70\x61\x72\x73\x65","\x75\x72\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x72\x61\x6E\x64\x6F\x6D\x73\x74\x72\x69\x6E\x67","\x73\x6F\x78","\x67\x6F\x6F\x67\x6C\x65\x2D\x74\x74\x73\x2D\x61\x70\x69","\x75\x74\x69\x6C","\x71\x75\x65\x72\x79\x73\x74\x72\x69\x6E\x67","\x6D\x6F\x6D\x65\x6E\x74","\x61\x77\x73\x2D\x73\x64\x6B","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x61\x70\x69\x2E\x69\x73\x70\x65\x65\x63\x68\x2E\x6F\x72\x67\x2F\x61\x70\x69\x2F\x72\x65\x73\x74","\x70\x72\x6F\x74\x6F\x63\x6F\x6C","\x68\x74\x74\x70\x73\x3A","\x68\x6F\x73\x74","\x57\x48\x41\x54\x5F\x45\x56\x45\x52","\x65\x6E\x64","\x65\x72\x72\x6F\x72","\x6F\x6E","\x73\x74\x61\x74\x75\x73\x43\x6F\x64\x65","\x72\x65\x71\x75\x65\x73\x74\x20\x74\x6F\x20","\x20\x66\x61\x69\x6C\x65\x64\x2C\x20\x73\x74\x61\x74\x75\x73\x20\x63\x6F\x64\x65\x20\x3D\x20","\x20\x28","\x73\x74\x61\x74\x75\x73\x4D\x65\x73\x73\x61\x67\x65","\x29","\x63\x72\x65\x61\x74\x65\x57\x72\x69\x74\x65\x53\x74\x72\x65\x61\x6D","\x66\x69\x6E\x69\x73\x68","\x63\x6C\x6F\x73\x65","\x75\x6E\x6C\x69\x6E\x6B","\x70\x69\x70\x65","\x67\x65\x74","","\x64\x61\x74\x61","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x68\x6F\x73\x74\x6E\x61\x6D\x65","\x70\x6F\x72\x74","\x50\x4F\x53\x54","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x6A\x73\x6F\x6E","\x75\x74\x66\x38","\x73\x65\x74\x45\x6E\x63\x6F\x64\x69\x6E\x67","\x72\x65\x71\x75\x65\x73\x74","\x77\x72\x69\x74\x65","\x77\x61\x76","\x74\x72\x61\x6E\x73\x63\x6F\x64\x65","\x73\x74\x61\x72\x74","\x41\x75\x64\x69\x6F\x53\x74\x72\x65\x61\x6D","\x77\x72\x69\x74\x65\x46\x69\x6C\x65","\x49\x6E\x76\x61\x6C\x69\x64\x20\x64\x61\x74\x61\x20\x72\x65\x73\x70\x6F\x6E\x73\x65\x20\x66\x72\x6F\x6D\x20\x61\x77\x73\x20\x50\x6F\x6C\x6C\x79\x21","\x4E\x6F\x20\x64\x61\x74\x61\x20\x72\x65\x73\x70\x6F\x6E\x73\x65\x20\x66\x72\x6F\x6D\x20\x61\x77\x73\x20\x50\x6F\x6C\x6C\x79\x21","\x73\x79\x6E\x74\x68\x65\x73\x69\x7A\x65\x53\x70\x65\x65\x63\x68","\x72\x65\x61\x64\x46\x69\x6C\x65\x53\x79\x6E\x63","\x62\x61\x73\x65\x36\x34","\x67\x6F\x6F\x67\x6C\x65\x54\x54\x53","\x2E","\x73\x70\x6C\x69\x74","\x74\x68\x65\x6E","\x74\x6D\x70","\x67\x65\x6E\x65\x72\x61\x74\x65","\x2E\x77\x61\x76","\x72\x65\x73\x6F\x6C\x76\x65","\x2E\x6D\x70\x33","\x65\x6E","\x69\x73\x70\x65\x65\x63\x68\x54\x54\x53","\x25\x73\x3F\x61\x70\x69\x6B\x65\x79\x3D\x25\x73\x26\x61\x63\x74\x69\x6F\x6E\x3D\x63\x6F\x6E\x76\x65\x72\x74\x26\x74\x65\x78\x74\x3D\x25\x73\x26\x76\x6F\x69\x63\x65\x3D\x25\x73\x26\x73\x70\x65\x65\x64\x3D\x25\x73\x26\x66\x6F\x72\x6D\x61\x74\x3D\x6D\x70\x33","\x66\x6F\x72\x6D\x61\x74","\x61\x77\x73\x50\x6F\x6C\x6C\x79","\x6D\x70\x33","\x69\x73\x70\x65\x65\x63\x68\x41\x53\x52","\x25\x73\x3F\x61\x70\x69\x6B\x65\x79\x3D\x25\x73\x26\x61\x63\x74\x69\x6F\x6E\x3D\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x26\x6C\x6F\x63\x61\x6C\x65\x3D\x25\x73\x26\x63\x6F\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65\x3D\x61\x75\x64\x69\x6F\x2F\x78\x2D\x77\x61\x76\x26\x61\x75\x64\x69\x6F\x3D\x25\x73\x26\x25\x73","\x6D\x6F\x64\x65\x6C\x3D\x25\x73","\x66\x72\x65\x65\x66\x6F\x72\x6D\x3D\x33","\x74\x69\x67\x65\x72\x44\x69\x61\x6C\x43\x61\x6C\x6C\x62\x61\x63\x6B","\x68\x74\x74\x70\x3A\x2F\x2F\x6C\x6F\x63\x61\x6C\x68\x6F\x73\x74\x2F\x61\x70\x69\x2F\x72\x65\x73\x74\x2F\x63\x6F\x6E\x74\x61\x63\x74\x2F\x69\x6E\x73\x65\x72\x74","\x2C","\x74\x72\x69\x6D","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x6D\x69\x6E\x75\x74\x65\x73","\x61\x64\x64","\x73\x74\x61\x74\x75\x73","\x64\x69\x72\x4E\x61\x6D\x65"];_0x19a2[0];var fs=require(_0x19a2[1]);var path=require(_0x19a2[2]);var http=require(_0x19a2[3]);var https=require(_0x19a2[4]);var urlParse=require(_0x19a2[6])[_0x19a2[5]];var BPromise=require(_0x19a2[7]);var rs=require(_0x19a2[8]);var sox=require(_0x19a2[9]);var tts=require(_0x19a2[10]);var util=require(_0x19a2[11]);var querystring=require(_0x19a2[12]);var moment=require(_0x19a2[13]);var AWS=require(_0x19a2[14]);var ISPEECH_API=_0x19a2[15];function downloadFile(_0xb9f6x10,_0xb9f6x11){return  new BPromise(function(_0xb9f6x12,_0xb9f6x13){var _0xb9f6x14=urlParse(_0xb9f6x10);var _0xb9f6x15=_0xb9f6x14[_0x19a2[16]]=== _0x19a2[17]?https:http;var _0xb9f6x16={host:_0xb9f6x14[_0x19a2[18]],path:_0xb9f6x14[_0x19a2[2]],headers:{"\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74":_0x19a2[19]}};_0xb9f6x15[_0x19a2[34]](_0xb9f6x16,function(_0xb9f6x18){if(_0xb9f6x18[_0x19a2[23]]!== 200){_0xb9f6x13( new Error(_0x19a2[24]+ _0xb9f6x10+ _0x19a2[25]+ _0xb9f6x18[_0x19a2[23]]+ _0x19a2[26]+ _0xb9f6x18[_0x19a2[27]]+ _0x19a2[28]));return};var _0xb9f6x19=fs[_0x19a2[29]](_0xb9f6x11);_0xb9f6x19[_0x19a2[22]](_0x19a2[30],function(){_0xb9f6x19[_0x19a2[31]](_0xb9f6x12)});_0xb9f6x19[_0x19a2[22]](_0x19a2[21],function(_0xb9f6x17){fs[_0x19a2[32]](_0xb9f6x11);_0xb9f6x13(_0xb9f6x17)});_0xb9f6x18[_0x19a2[33]](_0xb9f6x19)})[_0x19a2[22]](_0x19a2[21],function(_0xb9f6x17){_0xb9f6x13(_0xb9f6x17)})[_0x19a2[20]]()})}function uploadFile(_0xb9f6x10){return  new BPromise(function(_0xb9f6x12,_0xb9f6x13){var _0xb9f6x14=urlParse(_0xb9f6x10);var _0xb9f6x15=_0xb9f6x14[_0x19a2[16]]=== _0x19a2[17]?https:http;var _0xb9f6x16={host:_0xb9f6x14[_0x19a2[18]],path:_0xb9f6x14[_0x19a2[2]],headers:{"\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74":_0x19a2[19]}};_0xb9f6x15[_0x19a2[34]](_0xb9f6x16,function(_0xb9f6x18){if(_0xb9f6x18[_0x19a2[23]]!== 200){_0xb9f6x13( new Error(_0x19a2[24]+ _0xb9f6x10+ _0x19a2[25]+ _0xb9f6x18[_0x19a2[23]]+ _0x19a2[26]+ _0xb9f6x18[_0x19a2[27]]+ _0x19a2[28]));return};var _0xb9f6x1b=_0x19a2[35];_0xb9f6x18[_0x19a2[22]](_0x19a2[36],function(_0xb9f6x1c){_0xb9f6x1b+= _0xb9f6x1c});_0xb9f6x18[_0x19a2[22]](_0x19a2[20],function(){_0xb9f6x12(_0xb9f6x1b)})})[_0x19a2[22]](_0x19a2[21],function(_0xb9f6x17){_0xb9f6x13(_0xb9f6x17)})[_0x19a2[20]]()})}function tigerDialAPI(_0xb9f6x10,_0xb9f6x1e){return  new BPromise(function(_0xb9f6x12,_0xb9f6x13){var _0xb9f6x1f=JSON[_0x19a2[37]](_0xb9f6x1e);var _0xb9f6x14=urlParse(_0xb9f6x10);var _0xb9f6x15=_0xb9f6x14[_0x19a2[16]]=== _0x19a2[17]?https:http;var _0xb9f6x16={hostname:_0xb9f6x14[_0x19a2[38]],path:_0xb9f6x14[_0x19a2[2]],port:_0xb9f6x14[_0x19a2[39]],method:_0x19a2[40],headers:{"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65":_0x19a2[41]}};var _0xb9f6x20=_0xb9f6x15[_0x19a2[44]](_0xb9f6x16,function(_0xb9f6x18){if(_0xb9f6x18[_0x19a2[23]]!== 200){_0xb9f6x13( new Error(_0x19a2[24]+ _0xb9f6x10+ _0x19a2[25]+ _0xb9f6x18[_0x19a2[23]]+ _0x19a2[26]+ _0xb9f6x18[_0x19a2[27]]+ _0x19a2[28]));return};_0xb9f6x18[_0x19a2[43]](_0x19a2[42]);var _0xb9f6x1b=_0x19a2[35];_0xb9f6x18[_0x19a2[22]](_0x19a2[36],function(_0xb9f6x1c){_0xb9f6x1b+= _0xb9f6x1c});_0xb9f6x18[_0x19a2[22]](_0x19a2[20],function(){_0xb9f6x12(_0xb9f6x1b)})});_0xb9f6x20[_0x19a2[22]](_0x19a2[21],function(_0xb9f6x17){_0xb9f6x13(_0xb9f6x17)});_0xb9f6x20[_0x19a2[45]](_0xb9f6x1f);_0xb9f6x20[_0x19a2[20]]()})}function convertFile(_0xb9f6x19,_0xb9f6x11){return  new BPromise(function(_0xb9f6x12,_0xb9f6x13){var _0xb9f6x22=sox[_0x19a2[47]](_0xb9f6x19,_0xb9f6x11,{sampleRate:8000,format:_0x19a2[46],channelCount:1,bitRate:192* 1024,compressionQuality:5});_0xb9f6x22[_0x19a2[22]](_0x19a2[21],function(_0xb9f6x17){_0xb9f6x13(_0xb9f6x17)});_0xb9f6x22[_0x19a2[22]](_0x19a2[20],function(){_0xb9f6x12()});_0xb9f6x22[_0x19a2[48]]()})}function pollyResult(_0xb9f6x24,_0xb9f6x25,_0xb9f6x26){return  new BPromise(function(_0xb9f6x12,_0xb9f6x13){_0xb9f6x24[_0x19a2[53]](_0xb9f6x25,function(_0xb9f6x17,_0xb9f6x27){if(_0xb9f6x17){_0xb9f6x13(_0xb9f6x17)}else {if(_0xb9f6x27){if(_0xb9f6x27[_0x19a2[49]] instanceof  Buffer){fs[_0x19a2[50]](_0xb9f6x26,_0xb9f6x27.AudioStream,function(_0xb9f6x17){if(_0xb9f6x17){_0xb9f6x13(_0xb9f6x17)}else {_0xb9f6x12()}})}else {_0xb9f6x13( new Error(_0x19a2[51]))}}else {_0xb9f6x13( new Error(_0x19a2[52]))}}})})}function base64Encode(_0xb9f6x19){var _0xb9f6x29=fs[_0x19a2[54]](_0xb9f6x19);return  new Buffer(_0xb9f6x29).toString(_0x19a2[55])}exports[_0x19a2[56]]= function(_0xb9f6x2a,_0xb9f6x2b){var _0xb9f6x26;var _0xb9f6x2c;return tts(_0xb9f6x2a,_0xb9f6x2b|| _0x19a2[65],1)[_0x19a2[59]](function(_0xb9f6x10){_0xb9f6x26= path[_0x19a2[63]](__dirname,_0x19a2[60],rs[_0x19a2[61]](4)+ _0x19a2[64]);return downloadFile(_0xb9f6x10,_0xb9f6x26)})[_0x19a2[59]](function(){_0xb9f6x2c= path[_0x19a2[63]](__dirname,_0x19a2[60],rs[_0x19a2[61]](4)+ _0x19a2[62]);return convertFile(_0xb9f6x26,_0xb9f6x2c)})[_0x19a2[59]](function(){fs[_0x19a2[32]](_0xb9f6x26);return _0xb9f6x2c[_0x19a2[58]](_0x19a2[57])[0]})};exports[_0x19a2[66]]= function(_0xb9f6x2d,_0xb9f6x2a,_0xb9f6x2b,_0xb9f6x2e){var _0xb9f6x10=util[_0x19a2[68]](_0x19a2[67],ISPEECH_API,_0xb9f6x2d,encodeURIComponent(_0xb9f6x2a),_0xb9f6x2b,_0xb9f6x2e);var _0xb9f6x26=path[_0x19a2[63]](__dirname,_0x19a2[60],rs[_0x19a2[61]](4)+ _0x19a2[64]);var _0xb9f6x2c;return downloadFile(_0xb9f6x10,_0xb9f6x26)[_0x19a2[59]](function(){_0xb9f6x2c= path[_0x19a2[63]](__dirname,_0x19a2[60],rs[_0x19a2[61]](4)+ _0x19a2[62]);return convertFile(_0xb9f6x26,_0xb9f6x2c)})[_0x19a2[59]](function(){fs[_0x19a2[32]](_0xb9f6x26);return _0xb9f6x2c[_0x19a2[58]](_0x19a2[57])[0]})};exports[_0x19a2[69]]= function(_0xb9f6x2f,_0xb9f6x30,_0xb9f6x31,_0xb9f6x32,_0xb9f6x2a){var _0xb9f6x33= new AWS.Polly({accessKeyId:_0xb9f6x2f,secretAccessKey:_0xb9f6x30,region:_0xb9f6x31});var _0xb9f6x25={"\x54\x65\x78\x74":_0xb9f6x2a,OutputFormat:_0x19a2[70],VoiceId:_0xb9f6x32};var _0xb9f6x26=path[_0x19a2[63]](__dirname,_0x19a2[60],rs[_0x19a2[61]](4)+ _0x19a2[64]);var _0xb9f6x2c;return pollyResult(_0xb9f6x33,_0xb9f6x25,_0xb9f6x26)[_0x19a2[59]](function(){_0xb9f6x2c= path[_0x19a2[63]](__dirname,_0x19a2[60],rs[_0x19a2[61]](4)+ _0x19a2[62]);return convertFile(_0xb9f6x26,_0xb9f6x2c)})[_0x19a2[59]](function(){fs[_0x19a2[32]](_0xb9f6x26);return _0xb9f6x2c[_0x19a2[58]](_0x19a2[57])[0]})};exports[_0x19a2[71]]= function(_0xb9f6x26,_0xb9f6x2d,_0xb9f6x2b,_0xb9f6x34){var _0xb9f6x10=util[_0x19a2[68]](_0x19a2[72],ISPEECH_API,_0xb9f6x2d,_0xb9f6x2b,base64Encode(_0xb9f6x26),_0xb9f6x34?util[_0x19a2[68]](_0x19a2[73],encodeURIComponent(_0xb9f6x34)):_0x19a2[74]);return uploadFile(_0xb9f6x10)[_0x19a2[59]](function(_0xb9f6x18){return querystring[_0x19a2[5]](_0xb9f6x18)})};exports[_0x19a2[75]]= function(_0xb9f6x35,_0xb9f6x36,_0xb9f6x37,_0xb9f6x38,_0xb9f6x39){var _0xb9f6x10=_0x19a2[76];var _0xb9f6x1e={id_list:parseInt(_0xb9f6x35),name:_0xb9f6x36|| _0x19a2[35],phones:_0xb9f6x37[_0x19a2[78]]()[_0x19a2[58]](_0x19a2[77]),description:_0xb9f6x38|| _0x19a2[35],planningtime:moment()[_0x19a2[81]](_0xb9f6x39|| 5,_0x19a2[80])[_0x19a2[68]](_0x19a2[79])};return tigerDialAPI(_0xb9f6x10,_0xb9f6x1e)[_0x19a2[59]](function(_0xb9f6x18){var _0xb9f6x3a=JSON[_0x19a2[5]](_0xb9f6x18);if(_0xb9f6x3a[_0x19a2[82]]> 0){return true};return false})};exports[_0x19a2[83]]= function(){return __dirname}
\ No newline at end of file
+var _0x8e0d=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x66\x73","\x70\x61\x74\x68","\x68\x74\x74\x70","\x68\x74\x74\x70\x73","\x70\x61\x72\x73\x65","\x75\x72\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x72\x61\x6E\x64\x6F\x6D\x73\x74\x72\x69\x6E\x67","\x73\x6F\x78","\x67\x6F\x6F\x67\x6C\x65\x2D\x74\x74\x73\x2D\x61\x70\x69","\x75\x74\x69\x6C","\x71\x75\x65\x72\x79\x73\x74\x72\x69\x6E\x67","\x6D\x6F\x6D\x65\x6E\x74","\x61\x77\x73\x2D\x73\x64\x6B","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x61\x70\x69\x2E\x69\x73\x70\x65\x65\x63\x68\x2E\x6F\x72\x67\x2F\x61\x70\x69\x2F\x72\x65\x73\x74","\x70\x72\x6F\x74\x6F\x63\x6F\x6C","\x68\x74\x74\x70\x73\x3A","\x68\x6F\x73\x74","\x57\x48\x41\x54\x5F\x45\x56\x45\x52","\x65\x6E\x64","\x65\x72\x72\x6F\x72","\x6F\x6E","\x73\x74\x61\x74\x75\x73\x43\x6F\x64\x65","\x72\x65\x71\x75\x65\x73\x74\x20\x74\x6F\x20","\x20\x66\x61\x69\x6C\x65\x64\x2C\x20\x73\x74\x61\x74\x75\x73\x20\x63\x6F\x64\x65\x20\x3D\x20","\x20\x28","\x73\x74\x61\x74\x75\x73\x4D\x65\x73\x73\x61\x67\x65","\x29","\x63\x72\x65\x61\x74\x65\x57\x72\x69\x74\x65\x53\x74\x72\x65\x61\x6D","\x66\x69\x6E\x69\x73\x68","\x63\x6C\x6F\x73\x65","\x75\x6E\x6C\x69\x6E\x6B","\x70\x69\x70\x65","\x67\x65\x74","","\x64\x61\x74\x61","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x68\x6F\x73\x74\x6E\x61\x6D\x65","\x70\x6F\x72\x74","\x50\x4F\x53\x54","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x6A\x73\x6F\x6E","\x75\x74\x66\x38","\x73\x65\x74\x45\x6E\x63\x6F\x64\x69\x6E\x67","\x72\x65\x71\x75\x65\x73\x74","\x77\x72\x69\x74\x65","\x77\x61\x76","\x74\x72\x61\x6E\x73\x63\x6F\x64\x65","\x73\x74\x61\x72\x74","\x41\x75\x64\x69\x6F\x53\x74\x72\x65\x61\x6D","\x77\x72\x69\x74\x65\x46\x69\x6C\x65","\x49\x6E\x76\x61\x6C\x69\x64\x20\x64\x61\x74\x61\x20\x72\x65\x73\x70\x6F\x6E\x73\x65\x20\x66\x72\x6F\x6D\x20\x61\x77\x73\x20\x50\x6F\x6C\x6C\x79\x21","\x4E\x6F\x20\x64\x61\x74\x61\x20\x72\x65\x73\x70\x6F\x6E\x73\x65\x20\x66\x72\x6F\x6D\x20\x61\x77\x73\x20\x50\x6F\x6C\x6C\x79\x21","\x73\x79\x6E\x74\x68\x65\x73\x69\x7A\x65\x53\x70\x65\x65\x63\x68","\x72\x65\x61\x64\x46\x69\x6C\x65\x53\x79\x6E\x63","\x62\x61\x73\x65\x36\x34","\x67\x6F\x6F\x67\x6C\x65\x54\x54\x53","\x2E","\x73\x70\x6C\x69\x74","\x74\x68\x65\x6E","\x74\x6D\x70","\x67\x65\x6E\x65\x72\x61\x74\x65","\x2E\x77\x61\x76","\x72\x65\x73\x6F\x6C\x76\x65","\x2E\x6D\x70\x33","\x65\x6E","\x69\x73\x70\x65\x65\x63\x68\x54\x54\x53","\x25\x73\x3F\x61\x70\x69\x6B\x65\x79\x3D\x25\x73\x26\x61\x63\x74\x69\x6F\x6E\x3D\x63\x6F\x6E\x76\x65\x72\x74\x26\x74\x65\x78\x74\x3D\x25\x73\x26\x76\x6F\x69\x63\x65\x3D\x25\x73\x26\x73\x70\x65\x65\x64\x3D\x25\x73\x26\x66\x6F\x72\x6D\x61\x74\x3D\x6D\x70\x33","\x66\x6F\x72\x6D\x61\x74","\x61\x77\x73\x50\x6F\x6C\x6C\x79","\x6D\x70\x33","\x69\x73\x70\x65\x65\x63\x68\x41\x53\x52","\x25\x73\x3F\x61\x70\x69\x6B\x65\x79\x3D\x25\x73\x26\x61\x63\x74\x69\x6F\x6E\x3D\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x26\x6C\x6F\x63\x61\x6C\x65\x3D\x25\x73\x26\x63\x6F\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65\x3D\x61\x75\x64\x69\x6F\x2F\x78\x2D\x77\x61\x76\x26\x61\x75\x64\x69\x6F\x3D\x25\x73\x26\x25\x73","\x6D\x6F\x64\x65\x6C\x3D\x25\x73","\x66\x72\x65\x65\x66\x6F\x72\x6D\x3D\x33","\x74\x69\x67\x65\x72\x44\x69\x61\x6C\x43\x61\x6C\x6C\x62\x61\x63\x6B","\x68\x74\x74\x70\x3A\x2F\x2F\x6C\x6F\x63\x61\x6C\x68\x6F\x73\x74\x2F\x61\x70\x69\x2F\x72\x65\x73\x74\x2F\x63\x6F\x6E\x74\x61\x63\x74\x2F\x69\x6E\x73\x65\x72\x74","\x2C","\x74\x72\x69\x6D","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x6D\x69\x6E\x75\x74\x65\x73","\x61\x64\x64","\x73\x74\x61\x74\x75\x73","\x64\x69\x72\x4E\x61\x6D\x65"];_0x8e0d[0];var fs=require(_0x8e0d[1]);var path=require(_0x8e0d[2]);var http=require(_0x8e0d[3]);var https=require(_0x8e0d[4]);var urlParse=require(_0x8e0d[6])[_0x8e0d[5]];var BPromise=require(_0x8e0d[7]);var rs=require(_0x8e0d[8]);var sox=require(_0x8e0d[9]);var tts=require(_0x8e0d[10]);var util=require(_0x8e0d[11]);var querystring=require(_0x8e0d[12]);var moment=require(_0x8e0d[13]);var AWS=require(_0x8e0d[14]);var ISPEECH_API=_0x8e0d[15];function downloadFile(_0xafe0x10,_0xafe0x11){return  new BPromise(function(_0xafe0x12,_0xafe0x13){var _0xafe0x14=urlParse(_0xafe0x10);var _0xafe0x15=_0xafe0x14[_0x8e0d[16]]=== _0x8e0d[17]?https:http;var _0xafe0x16={host:_0xafe0x14[_0x8e0d[18]],path:_0xafe0x14[_0x8e0d[2]],headers:{"\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74":_0x8e0d[19]}};_0xafe0x15[_0x8e0d[34]](_0xafe0x16,function(_0xafe0x18){if(_0xafe0x18[_0x8e0d[23]]!== 200){_0xafe0x13( new Error(_0x8e0d[24]+ _0xafe0x10+ _0x8e0d[25]+ _0xafe0x18[_0x8e0d[23]]+ _0x8e0d[26]+ _0xafe0x18[_0x8e0d[27]]+ _0x8e0d[28]));return};var _0xafe0x19=fs[_0x8e0d[29]](_0xafe0x11);_0xafe0x19[_0x8e0d[22]](_0x8e0d[30],function(){_0xafe0x19[_0x8e0d[31]](_0xafe0x12)});_0xafe0x19[_0x8e0d[22]](_0x8e0d[21],function(_0xafe0x17){fs[_0x8e0d[32]](_0xafe0x11);_0xafe0x13(_0xafe0x17)});_0xafe0x18[_0x8e0d[33]](_0xafe0x19)})[_0x8e0d[22]](_0x8e0d[21],function(_0xafe0x17){_0xafe0x13(_0xafe0x17)})[_0x8e0d[20]]()})}function uploadFile(_0xafe0x10){return  new BPromise(function(_0xafe0x12,_0xafe0x13){var _0xafe0x14=urlParse(_0xafe0x10);var _0xafe0x15=_0xafe0x14[_0x8e0d[16]]=== _0x8e0d[17]?https:http;var _0xafe0x16={host:_0xafe0x14[_0x8e0d[18]],path:_0xafe0x14[_0x8e0d[2]],headers:{"\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74":_0x8e0d[19]}};_0xafe0x15[_0x8e0d[34]](_0xafe0x16,function(_0xafe0x18){if(_0xafe0x18[_0x8e0d[23]]!== 200){_0xafe0x13( new Error(_0x8e0d[24]+ _0xafe0x10+ _0x8e0d[25]+ _0xafe0x18[_0x8e0d[23]]+ _0x8e0d[26]+ _0xafe0x18[_0x8e0d[27]]+ _0x8e0d[28]));return};var _0xafe0x1b=_0x8e0d[35];_0xafe0x18[_0x8e0d[22]](_0x8e0d[36],function(_0xafe0x1c){_0xafe0x1b+= _0xafe0x1c});_0xafe0x18[_0x8e0d[22]](_0x8e0d[20],function(){_0xafe0x12(_0xafe0x1b)})})[_0x8e0d[22]](_0x8e0d[21],function(_0xafe0x17){_0xafe0x13(_0xafe0x17)})[_0x8e0d[20]]()})}function tigerDialAPI(_0xafe0x10,_0xafe0x1e){return  new BPromise(function(_0xafe0x12,_0xafe0x13){var _0xafe0x1f=JSON[_0x8e0d[37]](_0xafe0x1e);var _0xafe0x14=urlParse(_0xafe0x10);var _0xafe0x15=_0xafe0x14[_0x8e0d[16]]=== _0x8e0d[17]?https:http;var _0xafe0x16={hostname:_0xafe0x14[_0x8e0d[38]],path:_0xafe0x14[_0x8e0d[2]],port:_0xafe0x14[_0x8e0d[39]],method:_0x8e0d[40],headers:{"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65":_0x8e0d[41]}};var _0xafe0x20=_0xafe0x15[_0x8e0d[44]](_0xafe0x16,function(_0xafe0x18){if(_0xafe0x18[_0x8e0d[23]]!== 200){_0xafe0x13( new Error(_0x8e0d[24]+ _0xafe0x10+ _0x8e0d[25]+ _0xafe0x18[_0x8e0d[23]]+ _0x8e0d[26]+ _0xafe0x18[_0x8e0d[27]]+ _0x8e0d[28]));return};_0xafe0x18[_0x8e0d[43]](_0x8e0d[42]);var _0xafe0x1b=_0x8e0d[35];_0xafe0x18[_0x8e0d[22]](_0x8e0d[36],function(_0xafe0x1c){_0xafe0x1b+= _0xafe0x1c});_0xafe0x18[_0x8e0d[22]](_0x8e0d[20],function(){_0xafe0x12(_0xafe0x1b)})});_0xafe0x20[_0x8e0d[22]](_0x8e0d[21],function(_0xafe0x17){_0xafe0x13(_0xafe0x17)});_0xafe0x20[_0x8e0d[45]](_0xafe0x1f);_0xafe0x20[_0x8e0d[20]]()})}function convertFile(_0xafe0x19,_0xafe0x11){return  new BPromise(function(_0xafe0x12,_0xafe0x13){var _0xafe0x22=sox[_0x8e0d[47]](_0xafe0x19,_0xafe0x11,{sampleRate:8000,format:_0x8e0d[46],channelCount:1,bitRate:192* 1024,compressionQuality:5});_0xafe0x22[_0x8e0d[22]](_0x8e0d[21],function(_0xafe0x17){_0xafe0x13(_0xafe0x17)});_0xafe0x22[_0x8e0d[22]](_0x8e0d[20],function(){_0xafe0x12()});_0xafe0x22[_0x8e0d[48]]()})}function pollyResult(_0xafe0x24,_0xafe0x25,_0xafe0x26){return  new BPromise(function(_0xafe0x12,_0xafe0x13){_0xafe0x24[_0x8e0d[53]](_0xafe0x25,function(_0xafe0x17,_0xafe0x27){if(_0xafe0x17){_0xafe0x13(_0xafe0x17)}else {if(_0xafe0x27){if(_0xafe0x27[_0x8e0d[49]] instanceof  Buffer){fs[_0x8e0d[50]](_0xafe0x26,_0xafe0x27.AudioStream,function(_0xafe0x17){if(_0xafe0x17){_0xafe0x13(_0xafe0x17)}else {_0xafe0x12()}})}else {_0xafe0x13( new Error(_0x8e0d[51]))}}else {_0xafe0x13( new Error(_0x8e0d[52]))}}})})}function base64Encode(_0xafe0x19){var _0xafe0x29=fs[_0x8e0d[54]](_0xafe0x19);return  new Buffer(_0xafe0x29).toString(_0x8e0d[55])}exports[_0x8e0d[56]]= function(_0xafe0x2a,_0xafe0x2b){var _0xafe0x26;var _0xafe0x2c;return tts(_0xafe0x2a,_0xafe0x2b|| _0x8e0d[65],1)[_0x8e0d[59]](function(_0xafe0x10){_0xafe0x26= path[_0x8e0d[63]](__dirname,_0x8e0d[60],rs[_0x8e0d[61]](4)+ _0x8e0d[64]);return downloadFile(_0xafe0x10,_0xafe0x26)})[_0x8e0d[59]](function(){_0xafe0x2c= path[_0x8e0d[63]](__dirname,_0x8e0d[60],rs[_0x8e0d[61]](4)+ _0x8e0d[62]);return convertFile(_0xafe0x26,_0xafe0x2c)})[_0x8e0d[59]](function(){fs[_0x8e0d[32]](_0xafe0x26);return _0xafe0x2c[_0x8e0d[58]](_0x8e0d[57])[0]})};exports[_0x8e0d[66]]= function(_0xafe0x2d,_0xafe0x2a,_0xafe0x2b,_0xafe0x2e){var _0xafe0x10=util[_0x8e0d[68]](_0x8e0d[67],ISPEECH_API,_0xafe0x2d,encodeURIComponent(_0xafe0x2a),_0xafe0x2b,_0xafe0x2e);var _0xafe0x26=path[_0x8e0d[63]](__dirname,_0x8e0d[60],rs[_0x8e0d[61]](4)+ _0x8e0d[64]);var _0xafe0x2c;return downloadFile(_0xafe0x10,_0xafe0x26)[_0x8e0d[59]](function(){_0xafe0x2c= path[_0x8e0d[63]](__dirname,_0x8e0d[60],rs[_0x8e0d[61]](4)+ _0x8e0d[62]);return convertFile(_0xafe0x26,_0xafe0x2c)})[_0x8e0d[59]](function(){fs[_0x8e0d[32]](_0xafe0x26);return _0xafe0x2c[_0x8e0d[58]](_0x8e0d[57])[0]})};exports[_0x8e0d[69]]= function(_0xafe0x2f,_0xafe0x30,_0xafe0x31,_0xafe0x32,_0xafe0x2a){var _0xafe0x33= new AWS.Polly({accessKeyId:_0xafe0x2f,secretAccessKey:_0xafe0x30,region:_0xafe0x31});var _0xafe0x25={"\x54\x65\x78\x74":_0xafe0x2a,OutputFormat:_0x8e0d[70],VoiceId:_0xafe0x32};var _0xafe0x26=path[_0x8e0d[63]](__dirname,_0x8e0d[60],rs[_0x8e0d[61]](4)+ _0x8e0d[64]);var _0xafe0x2c;return pollyResult(_0xafe0x33,_0xafe0x25,_0xafe0x26)[_0x8e0d[59]](function(){_0xafe0x2c= path[_0x8e0d[63]](__dirname,_0x8e0d[60],rs[_0x8e0d[61]](4)+ _0x8e0d[62]);return convertFile(_0xafe0x26,_0xafe0x2c)})[_0x8e0d[59]](function(){fs[_0x8e0d[32]](_0xafe0x26);return _0xafe0x2c[_0x8e0d[58]](_0x8e0d[57])[0]})};exports[_0x8e0d[71]]= function(_0xafe0x26,_0xafe0x2d,_0xafe0x2b,_0xafe0x34){var _0xafe0x10=util[_0x8e0d[68]](_0x8e0d[72],ISPEECH_API,_0xafe0x2d,_0xafe0x2b,base64Encode(_0xafe0x26),_0xafe0x34?util[_0x8e0d[68]](_0x8e0d[73],encodeURIComponent(_0xafe0x34)):_0x8e0d[74]);return uploadFile(_0xafe0x10)[_0x8e0d[59]](function(_0xafe0x18){return querystring[_0x8e0d[5]](_0xafe0x18)})};exports[_0x8e0d[75]]= function(_0xafe0x35,_0xafe0x36,_0xafe0x37,_0xafe0x38,_0xafe0x39){var _0xafe0x10=_0x8e0d[76];var _0xafe0x1e={id_list:parseInt(_0xafe0x35),name:_0xafe0x36|| _0x8e0d[35],phones:_0xafe0x37[_0x8e0d[78]]()[_0x8e0d[58]](_0x8e0d[77]),description:_0xafe0x38|| _0x8e0d[35],planningtime:moment()[_0x8e0d[81]](_0xafe0x39|| 5,_0x8e0d[80])[_0x8e0d[68]](_0x8e0d[79])};return tigerDialAPI(_0xafe0x10,_0xafe0x1e)[_0x8e0d[59]](function(_0xafe0x18){var _0xafe0x3a=JSON[_0x8e0d[5]](_0xafe0x18);if(_0xafe0x3a[_0x8e0d[82]]> 0){return true};return false})};exports[_0x8e0d[83]]= function(){return __dirname}
\ No newline at end of file