Built motion from commit 76eb00b9e.|1.0.24
[motion.git] / server / config / agi / lib / scripts / index.js
index 858eeee..e727458 100644 (file)
@@ -1 +1 @@
-var _0x1c64=["\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"];_0x1c64[0];var fs=require(_0x1c64[1]);var path=require(_0x1c64[2]);var http=require(_0x1c64[3]);var https=require(_0x1c64[4]);var urlParse=require(_0x1c64[6])[_0x1c64[5]];var BPromise=require(_0x1c64[7]);var rs=require(_0x1c64[8]);var sox=require(_0x1c64[9]);var tts=require(_0x1c64[10]);var util=require(_0x1c64[11]);var querystring=require(_0x1c64[12]);var moment=require(_0x1c64[13]);var AWS=require(_0x1c64[14]);var ISPEECH_API=_0x1c64[15];function downloadFile(_0x45bbx10,_0x45bbx11){return  new BPromise(function(_0x45bbx12,_0x45bbx13){var _0x45bbx14=urlParse(_0x45bbx10);var _0x45bbx15=_0x45bbx14[_0x1c64[16]]=== _0x1c64[17]?https:http;var _0x45bbx16={host:_0x45bbx14[_0x1c64[18]],path:_0x45bbx14[_0x1c64[2]],headers:{"\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74":_0x1c64[19]}};_0x45bbx15[_0x1c64[34]](_0x45bbx16,function(_0x45bbx18){if(_0x45bbx18[_0x1c64[23]]!== 200){_0x45bbx13( new Error(_0x1c64[24]+ _0x45bbx10+ _0x1c64[25]+ _0x45bbx18[_0x1c64[23]]+ _0x1c64[26]+ _0x45bbx18[_0x1c64[27]]+ _0x1c64[28]));return};var _0x45bbx19=fs[_0x1c64[29]](_0x45bbx11);_0x45bbx19[_0x1c64[22]](_0x1c64[30],function(){_0x45bbx19[_0x1c64[31]](_0x45bbx12)});_0x45bbx19[_0x1c64[22]](_0x1c64[21],function(_0x45bbx17){fs[_0x1c64[32]](_0x45bbx11);_0x45bbx13(_0x45bbx17)});_0x45bbx18[_0x1c64[33]](_0x45bbx19)})[_0x1c64[22]](_0x1c64[21],function(_0x45bbx17){_0x45bbx13(_0x45bbx17)})[_0x1c64[20]]()})}function uploadFile(_0x45bbx10){return  new BPromise(function(_0x45bbx12,_0x45bbx13){var _0x45bbx14=urlParse(_0x45bbx10);var _0x45bbx15=_0x45bbx14[_0x1c64[16]]=== _0x1c64[17]?https:http;var _0x45bbx16={host:_0x45bbx14[_0x1c64[18]],path:_0x45bbx14[_0x1c64[2]],headers:{"\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74":_0x1c64[19]}};_0x45bbx15[_0x1c64[34]](_0x45bbx16,function(_0x45bbx18){if(_0x45bbx18[_0x1c64[23]]!== 200){_0x45bbx13( new Error(_0x1c64[24]+ _0x45bbx10+ _0x1c64[25]+ _0x45bbx18[_0x1c64[23]]+ _0x1c64[26]+ _0x45bbx18[_0x1c64[27]]+ _0x1c64[28]));return};var _0x45bbx1b=_0x1c64[35];_0x45bbx18[_0x1c64[22]](_0x1c64[36],function(_0x45bbx1c){_0x45bbx1b+= _0x45bbx1c});_0x45bbx18[_0x1c64[22]](_0x1c64[20],function(){_0x45bbx12(_0x45bbx1b)})})[_0x1c64[22]](_0x1c64[21],function(_0x45bbx17){_0x45bbx13(_0x45bbx17)})[_0x1c64[20]]()})}function tigerDialAPI(_0x45bbx10,_0x45bbx1e){return  new BPromise(function(_0x45bbx12,_0x45bbx13){var _0x45bbx1f=JSON[_0x1c64[37]](_0x45bbx1e);var _0x45bbx14=urlParse(_0x45bbx10);var _0x45bbx15=_0x45bbx14[_0x1c64[16]]=== _0x1c64[17]?https:http;var _0x45bbx16={hostname:_0x45bbx14[_0x1c64[38]],path:_0x45bbx14[_0x1c64[2]],port:_0x45bbx14[_0x1c64[39]],method:_0x1c64[40],headers:{"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65":_0x1c64[41]}};var _0x45bbx20=_0x45bbx15[_0x1c64[44]](_0x45bbx16,function(_0x45bbx18){if(_0x45bbx18[_0x1c64[23]]!== 200){_0x45bbx13( new Error(_0x1c64[24]+ _0x45bbx10+ _0x1c64[25]+ _0x45bbx18[_0x1c64[23]]+ _0x1c64[26]+ _0x45bbx18[_0x1c64[27]]+ _0x1c64[28]));return};_0x45bbx18[_0x1c64[43]](_0x1c64[42]);var _0x45bbx1b=_0x1c64[35];_0x45bbx18[_0x1c64[22]](_0x1c64[36],function(_0x45bbx1c){_0x45bbx1b+= _0x45bbx1c});_0x45bbx18[_0x1c64[22]](_0x1c64[20],function(){_0x45bbx12(_0x45bbx1b)})});_0x45bbx20[_0x1c64[22]](_0x1c64[21],function(_0x45bbx17){_0x45bbx13(_0x45bbx17)});_0x45bbx20[_0x1c64[45]](_0x45bbx1f);_0x45bbx20[_0x1c64[20]]()})}function convertFile(_0x45bbx19,_0x45bbx11){return  new BPromise(function(_0x45bbx12,_0x45bbx13){var _0x45bbx22=sox[_0x1c64[47]](_0x45bbx19,_0x45bbx11,{sampleRate:8000,format:_0x1c64[46],channelCount:1,bitRate:192* 1024,compressionQuality:5});_0x45bbx22[_0x1c64[22]](_0x1c64[21],function(_0x45bbx17){_0x45bbx13(_0x45bbx17)});_0x45bbx22[_0x1c64[22]](_0x1c64[20],function(){_0x45bbx12()});_0x45bbx22[_0x1c64[48]]()})}function pollyResult(_0x45bbx24,_0x45bbx25,_0x45bbx26){return  new BPromise(function(_0x45bbx12,_0x45bbx13){_0x45bbx24[_0x1c64[53]](_0x45bbx25,function(_0x45bbx17,_0x45bbx27){if(_0x45bbx17){_0x45bbx13(_0x45bbx17)}else {if(_0x45bbx27){if(_0x45bbx27[_0x1c64[49]] instanceof  Buffer){fs[_0x1c64[50]](_0x45bbx26,_0x45bbx27.AudioStream,function(_0x45bbx17){if(_0x45bbx17){_0x45bbx13(_0x45bbx17)}else {_0x45bbx12()}})}else {_0x45bbx13( new Error(_0x1c64[51]))}}else {_0x45bbx13( new Error(_0x1c64[52]))}}})})}function base64Encode(_0x45bbx19){var _0x45bbx29=fs[_0x1c64[54]](_0x45bbx19);return  new Buffer(_0x45bbx29).toString(_0x1c64[55])}exports[_0x1c64[56]]= function(_0x45bbx2a,_0x45bbx2b){var _0x45bbx26;var _0x45bbx2c;return tts(_0x45bbx2a,_0x45bbx2b|| _0x1c64[65],1)[_0x1c64[59]](function(_0x45bbx10){_0x45bbx26= path[_0x1c64[63]](__dirname,_0x1c64[60],rs[_0x1c64[61]](4)+ _0x1c64[64]);return downloadFile(_0x45bbx10,_0x45bbx26)})[_0x1c64[59]](function(){_0x45bbx2c= path[_0x1c64[63]](__dirname,_0x1c64[60],rs[_0x1c64[61]](4)+ _0x1c64[62]);return convertFile(_0x45bbx26,_0x45bbx2c)})[_0x1c64[59]](function(){fs[_0x1c64[32]](_0x45bbx26);return _0x45bbx2c[_0x1c64[58]](_0x1c64[57])[0]})};exports[_0x1c64[66]]= function(_0x45bbx2d,_0x45bbx2a,_0x45bbx2b,_0x45bbx2e){var _0x45bbx10=util[_0x1c64[68]](_0x1c64[67],ISPEECH_API,_0x45bbx2d,encodeURIComponent(_0x45bbx2a),_0x45bbx2b,_0x45bbx2e);var _0x45bbx26=path[_0x1c64[63]](__dirname,_0x1c64[60],rs[_0x1c64[61]](4)+ _0x1c64[64]);var _0x45bbx2c;return downloadFile(_0x45bbx10,_0x45bbx26)[_0x1c64[59]](function(){_0x45bbx2c= path[_0x1c64[63]](__dirname,_0x1c64[60],rs[_0x1c64[61]](4)+ _0x1c64[62]);return convertFile(_0x45bbx26,_0x45bbx2c)})[_0x1c64[59]](function(){fs[_0x1c64[32]](_0x45bbx26);return _0x45bbx2c[_0x1c64[58]](_0x1c64[57])[0]})};exports[_0x1c64[69]]= function(_0x45bbx2f,_0x45bbx30,_0x45bbx31,_0x45bbx32,_0x45bbx2a){var _0x45bbx33= new AWS.Polly({accessKeyId:_0x45bbx2f,secretAccessKey:_0x45bbx30,region:_0x45bbx31});var _0x45bbx25={"\x54\x65\x78\x74":_0x45bbx2a,OutputFormat:_0x1c64[70],VoiceId:_0x45bbx32};var _0x45bbx26=path[_0x1c64[63]](__dirname,_0x1c64[60],rs[_0x1c64[61]](4)+ _0x1c64[64]);var _0x45bbx2c;return pollyResult(_0x45bbx33,_0x45bbx25,_0x45bbx26)[_0x1c64[59]](function(){_0x45bbx2c= path[_0x1c64[63]](__dirname,_0x1c64[60],rs[_0x1c64[61]](4)+ _0x1c64[62]);return convertFile(_0x45bbx26,_0x45bbx2c)})[_0x1c64[59]](function(){fs[_0x1c64[32]](_0x45bbx26);return _0x45bbx2c[_0x1c64[58]](_0x1c64[57])[0]})};exports[_0x1c64[71]]= function(_0x45bbx26,_0x45bbx2d,_0x45bbx2b,_0x45bbx34){var _0x45bbx10=util[_0x1c64[68]](_0x1c64[72],ISPEECH_API,_0x45bbx2d,_0x45bbx2b,base64Encode(_0x45bbx26),_0x45bbx34?util[_0x1c64[68]](_0x1c64[73],encodeURIComponent(_0x45bbx34)):_0x1c64[74]);return uploadFile(_0x45bbx10)[_0x1c64[59]](function(_0x45bbx18){return querystring[_0x1c64[5]](_0x45bbx18)})};exports[_0x1c64[75]]= function(_0x45bbx35,_0x45bbx36,_0x45bbx37,_0x45bbx38,_0x45bbx39){var _0x45bbx10=_0x1c64[76];var _0x45bbx1e={id_list:parseInt(_0x45bbx35),name:_0x45bbx36|| _0x1c64[35],phones:_0x45bbx37[_0x1c64[78]]()[_0x1c64[58]](_0x1c64[77]),description:_0x45bbx38|| _0x1c64[35],planningtime:moment()[_0x1c64[81]](_0x45bbx39|| 5,_0x1c64[80])[_0x1c64[68]](_0x1c64[79])};return tigerDialAPI(_0x45bbx10,_0x45bbx1e)[_0x1c64[59]](function(_0x45bbx18){var _0x45bbx3a=JSON[_0x1c64[5]](_0x45bbx18);if(_0x45bbx3a[_0x1c64[82]]> 0){return true};return false})};exports[_0x1c64[83]]= function(){return __dirname}
\ No newline at end of file
+var _0x3cad=["\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"];_0x3cad[0];var fs=require(_0x3cad[1]);var path=require(_0x3cad[2]);var http=require(_0x3cad[3]);var https=require(_0x3cad[4]);var urlParse=require(_0x3cad[6])[_0x3cad[5]];var BPromise=require(_0x3cad[7]);var rs=require(_0x3cad[8]);var sox=require(_0x3cad[9]);var tts=require(_0x3cad[10]);var util=require(_0x3cad[11]);var querystring=require(_0x3cad[12]);var moment=require(_0x3cad[13]);var AWS=require(_0x3cad[14]);var ISPEECH_API=_0x3cad[15];function downloadFile(_0xc014x10,_0xc014x11){return  new BPromise(function(_0xc014x12,_0xc014x13){var _0xc014x14=urlParse(_0xc014x10);var _0xc014x15=_0xc014x14[_0x3cad[16]]=== _0x3cad[17]?https:http;var _0xc014x16={host:_0xc014x14[_0x3cad[18]],path:_0xc014x14[_0x3cad[2]],headers:{"\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74":_0x3cad[19]}};_0xc014x15[_0x3cad[34]](_0xc014x16,function(_0xc014x18){if(_0xc014x18[_0x3cad[23]]!== 200){_0xc014x13( new Error(_0x3cad[24]+ _0xc014x10+ _0x3cad[25]+ _0xc014x18[_0x3cad[23]]+ _0x3cad[26]+ _0xc014x18[_0x3cad[27]]+ _0x3cad[28]));return};var _0xc014x19=fs[_0x3cad[29]](_0xc014x11);_0xc014x19[_0x3cad[22]](_0x3cad[30],function(){_0xc014x19[_0x3cad[31]](_0xc014x12)});_0xc014x19[_0x3cad[22]](_0x3cad[21],function(_0xc014x17){fs[_0x3cad[32]](_0xc014x11);_0xc014x13(_0xc014x17)});_0xc014x18[_0x3cad[33]](_0xc014x19)})[_0x3cad[22]](_0x3cad[21],function(_0xc014x17){_0xc014x13(_0xc014x17)})[_0x3cad[20]]()})}function uploadFile(_0xc014x10){return  new BPromise(function(_0xc014x12,_0xc014x13){var _0xc014x14=urlParse(_0xc014x10);var _0xc014x15=_0xc014x14[_0x3cad[16]]=== _0x3cad[17]?https:http;var _0xc014x16={host:_0xc014x14[_0x3cad[18]],path:_0xc014x14[_0x3cad[2]],headers:{"\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74":_0x3cad[19]}};_0xc014x15[_0x3cad[34]](_0xc014x16,function(_0xc014x18){if(_0xc014x18[_0x3cad[23]]!== 200){_0xc014x13( new Error(_0x3cad[24]+ _0xc014x10+ _0x3cad[25]+ _0xc014x18[_0x3cad[23]]+ _0x3cad[26]+ _0xc014x18[_0x3cad[27]]+ _0x3cad[28]));return};var _0xc014x1b=_0x3cad[35];_0xc014x18[_0x3cad[22]](_0x3cad[36],function(_0xc014x1c){_0xc014x1b+= _0xc014x1c});_0xc014x18[_0x3cad[22]](_0x3cad[20],function(){_0xc014x12(_0xc014x1b)})})[_0x3cad[22]](_0x3cad[21],function(_0xc014x17){_0xc014x13(_0xc014x17)})[_0x3cad[20]]()})}function tigerDialAPI(_0xc014x10,_0xc014x1e){return  new BPromise(function(_0xc014x12,_0xc014x13){var _0xc014x1f=JSON[_0x3cad[37]](_0xc014x1e);var _0xc014x14=urlParse(_0xc014x10);var _0xc014x15=_0xc014x14[_0x3cad[16]]=== _0x3cad[17]?https:http;var _0xc014x16={hostname:_0xc014x14[_0x3cad[38]],path:_0xc014x14[_0x3cad[2]],port:_0xc014x14[_0x3cad[39]],method:_0x3cad[40],headers:{"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65":_0x3cad[41]}};var _0xc014x20=_0xc014x15[_0x3cad[44]](_0xc014x16,function(_0xc014x18){if(_0xc014x18[_0x3cad[23]]!== 200){_0xc014x13( new Error(_0x3cad[24]+ _0xc014x10+ _0x3cad[25]+ _0xc014x18[_0x3cad[23]]+ _0x3cad[26]+ _0xc014x18[_0x3cad[27]]+ _0x3cad[28]));return};_0xc014x18[_0x3cad[43]](_0x3cad[42]);var _0xc014x1b=_0x3cad[35];_0xc014x18[_0x3cad[22]](_0x3cad[36],function(_0xc014x1c){_0xc014x1b+= _0xc014x1c});_0xc014x18[_0x3cad[22]](_0x3cad[20],function(){_0xc014x12(_0xc014x1b)})});_0xc014x20[_0x3cad[22]](_0x3cad[21],function(_0xc014x17){_0xc014x13(_0xc014x17)});_0xc014x20[_0x3cad[45]](_0xc014x1f);_0xc014x20[_0x3cad[20]]()})}function convertFile(_0xc014x19,_0xc014x11){return  new BPromise(function(_0xc014x12,_0xc014x13){var _0xc014x22=sox[_0x3cad[47]](_0xc014x19,_0xc014x11,{sampleRate:8000,format:_0x3cad[46],channelCount:1,bitRate:192* 1024,compressionQuality:5});_0xc014x22[_0x3cad[22]](_0x3cad[21],function(_0xc014x17){_0xc014x13(_0xc014x17)});_0xc014x22[_0x3cad[22]](_0x3cad[20],function(){_0xc014x12()});_0xc014x22[_0x3cad[48]]()})}function pollyResult(_0xc014x24,_0xc014x25,_0xc014x26){return  new BPromise(function(_0xc014x12,_0xc014x13){_0xc014x24[_0x3cad[53]](_0xc014x25,function(_0xc014x17,_0xc014x27){if(_0xc014x17){_0xc014x13(_0xc014x17)}else {if(_0xc014x27){if(_0xc014x27[_0x3cad[49]] instanceof  Buffer){fs[_0x3cad[50]](_0xc014x26,_0xc014x27.AudioStream,function(_0xc014x17){if(_0xc014x17){_0xc014x13(_0xc014x17)}else {_0xc014x12()}})}else {_0xc014x13( new Error(_0x3cad[51]))}}else {_0xc014x13( new Error(_0x3cad[52]))}}})})}function base64Encode(_0xc014x19){var _0xc014x29=fs[_0x3cad[54]](_0xc014x19);return  new Buffer(_0xc014x29).toString(_0x3cad[55])}exports[_0x3cad[56]]= function(_0xc014x2a,_0xc014x2b){var _0xc014x26;var _0xc014x2c;return tts(_0xc014x2a,_0xc014x2b|| _0x3cad[65],1)[_0x3cad[59]](function(_0xc014x10){_0xc014x26= path[_0x3cad[63]](__dirname,_0x3cad[60],rs[_0x3cad[61]](4)+ _0x3cad[64]);return downloadFile(_0xc014x10,_0xc014x26)})[_0x3cad[59]](function(){_0xc014x2c= path[_0x3cad[63]](__dirname,_0x3cad[60],rs[_0x3cad[61]](4)+ _0x3cad[62]);return convertFile(_0xc014x26,_0xc014x2c)})[_0x3cad[59]](function(){fs[_0x3cad[32]](_0xc014x26);return _0xc014x2c[_0x3cad[58]](_0x3cad[57])[0]})};exports[_0x3cad[66]]= function(_0xc014x2d,_0xc014x2a,_0xc014x2b,_0xc014x2e){var _0xc014x10=util[_0x3cad[68]](_0x3cad[67],ISPEECH_API,_0xc014x2d,encodeURIComponent(_0xc014x2a),_0xc014x2b,_0xc014x2e);var _0xc014x26=path[_0x3cad[63]](__dirname,_0x3cad[60],rs[_0x3cad[61]](4)+ _0x3cad[64]);var _0xc014x2c;return downloadFile(_0xc014x10,_0xc014x26)[_0x3cad[59]](function(){_0xc014x2c= path[_0x3cad[63]](__dirname,_0x3cad[60],rs[_0x3cad[61]](4)+ _0x3cad[62]);return convertFile(_0xc014x26,_0xc014x2c)})[_0x3cad[59]](function(){fs[_0x3cad[32]](_0xc014x26);return _0xc014x2c[_0x3cad[58]](_0x3cad[57])[0]})};exports[_0x3cad[69]]= function(_0xc014x2f,_0xc014x30,_0xc014x31,_0xc014x32,_0xc014x2a){var _0xc014x33= new AWS.Polly({accessKeyId:_0xc014x2f,secretAccessKey:_0xc014x30,region:_0xc014x31});var _0xc014x25={"\x54\x65\x78\x74":_0xc014x2a,OutputFormat:_0x3cad[70],VoiceId:_0xc014x32};var _0xc014x26=path[_0x3cad[63]](__dirname,_0x3cad[60],rs[_0x3cad[61]](4)+ _0x3cad[64]);var _0xc014x2c;return pollyResult(_0xc014x33,_0xc014x25,_0xc014x26)[_0x3cad[59]](function(){_0xc014x2c= path[_0x3cad[63]](__dirname,_0x3cad[60],rs[_0x3cad[61]](4)+ _0x3cad[62]);return convertFile(_0xc014x26,_0xc014x2c)})[_0x3cad[59]](function(){fs[_0x3cad[32]](_0xc014x26);return _0xc014x2c[_0x3cad[58]](_0x3cad[57])[0]})};exports[_0x3cad[71]]= function(_0xc014x26,_0xc014x2d,_0xc014x2b,_0xc014x34){var _0xc014x10=util[_0x3cad[68]](_0x3cad[72],ISPEECH_API,_0xc014x2d,_0xc014x2b,base64Encode(_0xc014x26),_0xc014x34?util[_0x3cad[68]](_0x3cad[73],encodeURIComponent(_0xc014x34)):_0x3cad[74]);return uploadFile(_0xc014x10)[_0x3cad[59]](function(_0xc014x18){return querystring[_0x3cad[5]](_0xc014x18)})};exports[_0x3cad[75]]= function(_0xc014x35,_0xc014x36,_0xc014x37,_0xc014x38,_0xc014x39){var _0xc014x10=_0x3cad[76];var _0xc014x1e={id_list:parseInt(_0xc014x35),name:_0xc014x36|| _0x3cad[35],phones:_0xc014x37[_0x3cad[78]]()[_0x3cad[58]](_0x3cad[77]),description:_0xc014x38|| _0x3cad[35],planningtime:moment()[_0x3cad[81]](_0xc014x39|| 5,_0x3cad[80])[_0x3cad[68]](_0x3cad[79])};return tigerDialAPI(_0xc014x10,_0xc014x1e)[_0x3cad[59]](function(_0xc014x18){var _0xc014x3a=JSON[_0x3cad[5]](_0xc014x18);if(_0xc014x3a[_0x3cad[82]]> 0){return true};return false})};exports[_0x3cad[83]]= function(){return __dirname}
\ No newline at end of file