Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / migrations / 2.0.39.js
index 9658394..2fde968 100644 (file)
@@ -1 +1 @@
-const a918_0x262c=['files/templates/context.ejs','exports','contact','lead','final','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x273\x27,\x20\x27Wait\x27,\x20\x276\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x278\x27,\x20\x27Set\x27,\x20\x27FAXOPT(minrate)=${XMF-MINRATE}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','ENUM','readFileSync','asterisk\x20-rx\x20\x22reload\x20chan_sip.so\x22','ls\x20-la\x20/var/opt/motion2/server/files','dropTable','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x277\x27,\x20\x27Set\x27,\x20\x27FAXOPT(maxrate)=${XMF-MAXRATE}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','query\x20%s','nothing','changeColumn','removeColumn','Removed\x20column\x20%s\x20from\x20%s','import','default\x20entry\x20context\x20(DO\x20NOT\x20DELETE)','writeFileSync','moduleSearch','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x276\x27,\x20\x27Set\x27,\x20\x27FAXOPT(localstationid)=${XMF-LOCALSTATIONID}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x272\x27,\x20\x27Set\x27,\x20\x27CDR(type)=outbound-fax\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','join','defaultPageTitle','render','sequelize','table\x20dropped\x20%s','addColumn','util','tail','addIndex','info','contact_lead','findOrCreate','ejs','pageTitle','utf8','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x275\x27,\x20\x27Set\x27,\x20\x27FAXOPT(headerinfo)=${XMF-HEADERINFO}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','root','int_salesforce_configurations','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x2710\x27,\x20\x27Set\x27,\x20\x27FAXOPT(t38timeout)=${XMF-T38TIMEOUT}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','/etc/asterisk/extensions_xcally_contexts.conf','sequence','prototype','then','Ls\x20:','moduleCreate','\x20Error\x20:','stringify','enqueue','queryInterface','Changed\x20column\x20%s\x20in\x20table\x20%s','Exec\x20chmod','checkVoiceContexts','child_process','settings','catch','query','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x2711\x27,\x20\x27SendFax\x27,\x20\x27${XMF-PATH},d\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','api/voiceContext/voiceContext.model','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x279\x27,\x20\x27Set\x27,\x20\x27FAXOPT(modem)=${XMF-MODEM}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','DATE','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x271\x27,\x20\x27NoOp\x27,\x20\x27\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());'];(function(_0xe8330,_0x262ccd){const _0x54169b=function(_0x412567){while(--_0x412567){_0xe8330['push'](_0xe8330['shift']());}};_0x54169b(++_0x262ccd);}(a918_0x262c,0x15c));const a918_0x5416=function(_0xe8330,_0x262ccd){_0xe8330=_0xe8330-0x0;let _0x54169b=a918_0x262c[_0xe8330];return _0x54169b;};const _0x3dfa35=a918_0x5416;'use strict';const logger=require('../config/logger')('migration'),util=require(_0x3dfa35('0x7')),ejs=require(_0x3dfa35('0xd')),fs=require('fs'),path=require('path'),exec=require(_0x3dfa35('0x21'))['exec'],config=require('../config/environment'),Sequence=function(){};Sequence[_0x3dfa35('0x16')][_0x3dfa35('0x1c')]=function(_0x412567){const _0x5a7f39=_0x3dfa35;this[_0x5a7f39('0x8')]=this[_0x5a7f39('0x8')]?this['tail']['finally'](_0x412567):_0x412567();};const Migration=function(_0x3b90e3){const _0x3454c7=_0x3dfa35;this['queryInterface']=_0x3b90e3,this[_0x3454c7('0x15')]=new Sequence();};Migration[_0x3dfa35('0x16')][_0x3dfa35('0x39')]=function(_0x37f32b,_0x40e08f,_0x38c7d9){const _0x25a351=_0x3dfa35,_0x11e842=this;this[_0x25a351('0x15')][_0x25a351('0x1c')](function(){const _0x2a308=_0x25a351;return _0x11e842[_0x2a308('0x1d')]['changeColumn'](_0x37f32b,_0x40e08f,_0x38c7d9)[_0x2a308('0x17')](function(){const _0x2dc03b=_0x2a308;logger['info'](_0x2dc03b('0x1e'),_0x40e08f,_0x37f32b);})['catch'](function(_0x365cba){const _0xc54d17=_0x2a308;logger[_0xc54d17('0xa')](JSON[_0xc54d17('0x1b')](_0x365cba));});});},Migration[_0x3dfa35('0x16')][_0x3dfa35('0x6')]=function(_0x3332c4,_0x57553f,_0x4cc6af){const _0x4968fb=_0x3dfa35,_0x1138bf=this;this['sequence'][_0x4968fb('0x1c')](function(){const _0x49cb1e=_0x4968fb;return _0x1138bf[_0x49cb1e('0x1d')][_0x49cb1e('0x6')](_0x3332c4,_0x57553f,_0x4cc6af)[_0x49cb1e('0x17')](function(){logger['info']('Added\x20column\x20%s\x20to\x20%s',_0x57553f,_0x3332c4);})['catch'](function(_0x9681c8){const _0x142f5e=_0x49cb1e;logger['info'](JSON[_0x142f5e('0x1b')](_0x9681c8));});});},Migration[_0x3dfa35('0x16')]['dropTable']=function(_0x21f331){const _0x551498=_0x3dfa35,_0x3672b6=this;this[_0x551498('0x15')][_0x551498('0x1c')](function(){const _0x33797a=_0x551498;return _0x3672b6[_0x33797a('0x1d')][_0x33797a('0x35')](_0x21f331,{'force':!![]})[_0x33797a('0x17')](function(){const _0x35878a=_0x33797a;logger[_0x35878a('0xa')](_0x35878a('0x5'),_0x21f331);})['catch'](function(_0xc0467f){const _0x3cd5e7=_0x33797a;logger[_0x3cd5e7('0xa')](JSON[_0x3cd5e7('0x1b')](_0xc0467f));});});},Migration[_0x3dfa35('0x16')][_0x3dfa35('0x9')]=function(_0x1371a5,_0xc5dfa0,_0xb8166c){const _0x39faa6=_0x3dfa35,_0x2a5b17=this;this[_0x39faa6('0x15')][_0x39faa6('0x1c')](function(){const _0x15bec8=_0x39faa6;return _0x2a5b17['queryInterface'][_0x15bec8('0x9')](_0x1371a5,_0xc5dfa0,{'indexName':_0xb8166c})[_0x15bec8('0x17')](function(){const _0x4c1a96=_0x15bec8;logger[_0x4c1a96('0xa')]('addIndex\x20%s\x20%s\x20%s',_0x1371a5,_0xc5dfa0[_0x4c1a96('0x1')](','),_0xb8166c);})['catch'](function(_0x2a9b52){const _0x4d50ce=_0x15bec8;logger['info'](JSON[_0x4d50ce('0x1b')](_0x2a9b52));});});},Migration['prototype'][_0x3dfa35('0x24')]=function(_0x5165da){const _0x2095b5=_0x3dfa35,_0xd713cd=this;this['sequence'][_0x2095b5('0x1c')](function(){const _0x524847=_0x2095b5;return _0xd713cd[_0x524847('0x1d')][_0x524847('0x4')]['query'](_0x5165da)[_0x524847('0x17')](function(){const _0x3667c1=_0x524847;logger[_0x3667c1('0xa')](_0x3667c1('0x37'),_0x5165da);})['catch'](function(_0x31fc49){const _0x5c0f11=_0x524847;logger['info'](JSON[_0x5c0f11('0x1b')](_0x31fc49));});});},Migration[_0x3dfa35('0x16')][_0x3dfa35('0x3a')]=function(_0x1eb7dd,_0x105ffa){const _0x2b70d9=_0x3dfa35,_0x2db4c3=this;this['sequence'][_0x2b70d9('0x1c')](function(){const _0x4fcaf9=_0x2b70d9;return _0x2db4c3[_0x4fcaf9('0x1d')][_0x4fcaf9('0x3a')](_0x1eb7dd,_0x105ffa)['then'](function(){const _0x3e74b5=_0x4fcaf9;logger[_0x3e74b5('0xa')](_0x3e74b5('0x3b'),_0x105ffa,_0x1eb7dd);})[_0x4fcaf9('0x23')](function(_0x19d193){const _0x496f94=_0x4fcaf9;logger[_0x496f94('0xa')](util['inspect'](_0x19d193,{'showHidden':![],'depth':null}));});});},Migration[_0x3dfa35('0x16')]['checkVoiceContexts']=function(){const _0x2654a5=_0x3dfa35,_0x521354=this,_0x2b970a=_0x521354['queryInterface']['sequelize'][_0x2654a5('0x3c')](path[_0x2654a5('0x1')](config[_0x2654a5('0x11')],_0x2654a5('0x26')));this['sequence'][_0x2654a5('0x1c')](function(){const _0x11a4a3=_0x2654a5;return _0x2b970a[_0x11a4a3('0xc')]({'where':{'name':'xcally-mixmonitor-context'},'defaults':{'name':'xcally-mixmonitor-context','description':_0x11a4a3('0x3d'),'defaultEntry':!![]}})['spread'](function(){return _0x2b970a['findAll']({'raw':!![]});})[_0x11a4a3('0x17')](function(_0x36a9c8){const _0x8a8e0f=_0x11a4a3,_0x4003c0=fs[_0x8a8e0f('0x32')](path[_0x8a8e0f('0x1')](config[_0x8a8e0f('0x11')],_0x8a8e0f('0x2a')),_0x8a8e0f('0xf')),_0x4b6282=ejs[_0x8a8e0f('0x3')](_0x4003c0,{'contexts':_0x36a9c8||[]});fs[_0x8a8e0f('0x3e')](_0x8a8e0f('0x14'),_0x4b6282),exec(_0x8a8e0f('0x33'),function(_0x24c33a,_0x13274c,_0x56bdce){const _0x18dcc2=_0x8a8e0f;logger[_0x18dcc2('0xa')](_0x18dcc2('0x1f'),_0x18dcc2('0x1a'),JSON[_0x18dcc2('0x1b')](_0x24c33a),_0x13274c,_0x56bdce);});})['catch'](function(_0x1014ac){const _0x176bc6=_0x11a4a3;logger['info'](JSON[_0x176bc6('0x1b')](_0x1014ac));});});},Migration[_0x3dfa35('0x16')][_0x3dfa35('0x2e')]=function(_0x295593){const _0x23bc28=_0x3dfa35;this['sequence'][_0x23bc28('0x1c')](function(){return _0x295593();});},module[_0x3dfa35('0x2b')]={'up':function(_0x429729,_0x756e54){return new Promise(function(_0x4492b9){const _0x1cf1d6=a918_0x5416,_0x3baedb=new Migration(_0x429729);_0x3baedb[_0x1cf1d6('0x6')](_0x1cf1d6('0x22'),_0x1cf1d6('0x2'),{'type':_0x756e54['BOOLEAN'],'defaultValue':!![]}),_0x3baedb['addColumn'](_0x1cf1d6('0x22'),_0x1cf1d6('0xe'),{'type':_0x756e54['STRING']}),_0x3baedb[_0x1cf1d6('0x20')](),_0x3baedb[_0x1cf1d6('0x6')](_0x1cf1d6('0x12'),_0x1cf1d6('0x3f'),{'type':_0x756e54[_0x1cf1d6('0x31')](_0x1cf1d6('0xb'),_0x1cf1d6('0x2c'),_0x1cf1d6('0x2d')),'defaultValue':'contact_lead'}),_0x3baedb[_0x1cf1d6('0x6')](_0x1cf1d6('0x12'),_0x1cf1d6('0x19'),{'type':_0x756e54['ENUM'](_0x1cf1d6('0x38'),_0x1cf1d6('0x2c'),_0x1cf1d6('0x2d')),'defaultValue':_0x1cf1d6('0x2d')}),_0x3baedb[_0x1cf1d6('0x24')](_0x1cf1d6('0x29')),_0x3baedb[_0x1cf1d6('0x24')](_0x1cf1d6('0x0')),_0x3baedb[_0x1cf1d6('0x24')](_0x1cf1d6('0x2f')),_0x3baedb[_0x1cf1d6('0x24')]('INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x274\x27,\x20\x27Set\x27,\x20\x27FAXOPT(ecm)=${XMF-ECM}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());'),_0x3baedb[_0x1cf1d6('0x24')](_0x1cf1d6('0x10')),_0x3baedb[_0x1cf1d6('0x24')](_0x1cf1d6('0x40')),_0x3baedb['query'](_0x1cf1d6('0x36')),_0x3baedb['query'](_0x1cf1d6('0x30')),_0x3baedb[_0x1cf1d6('0x24')](_0x1cf1d6('0x27')),_0x3baedb[_0x1cf1d6('0x24')](_0x1cf1d6('0x13')),_0x3baedb[_0x1cf1d6('0x24')](_0x1cf1d6('0x25')),exec('chmod\x20775\x20/var/opt/motion2/server/files/attachments',function(_0x386417,_0x4276dc,_0x14e22a){const _0xdacda0=_0x1cf1d6;logger[_0xdacda0('0xa')](_0xdacda0('0x1f'),_0xdacda0('0x1a'),JSON[_0xdacda0('0x1b')](_0x386417),_0x4276dc,_0x14e22a),exec(_0xdacda0('0x34'),function(_0x4ebd10,_0x8f541c,_0x333609){const _0x45c6fe=_0xdacda0;logger[_0x45c6fe('0xa')](_0x45c6fe('0x18'),'\x20Error\x20:',JSON[_0x45c6fe('0x1b')](_0x4ebd10),_0x8f541c,_0x333609);});}),_0x3baedb[_0x1cf1d6('0x6')]('cm_contacts','deletedAt',{'type':_0x756e54[_0x1cf1d6('0x28')],'defaultValue':null}),_0x3baedb[_0x1cf1d6('0x2e')](_0x4492b9);});},'down':function(){}};
\ No newline at end of file
+const a918_0x43e6=['final','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x2710\x27,\x20\x27Set\x27,\x20\x27FAXOPT(t38timeout)=${XMF-T38TIMEOUT}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','addIndex\x20%s\x20%s\x20%s','contact','addColumn','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x275\x27,\x20\x27Set\x27,\x20\x27FAXOPT(headerinfo)=${XMF-HEADERINFO}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','removeColumn','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x274\x27,\x20\x27Set\x27,\x20\x27FAXOPT(ecm)=${XMF-ECM}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','../config/logger','changeColumn','addIndex','tail','lead','exec','enqueue','exports','int_salesforce_configurations','ls\x20-la\x20/var/opt/motion2/server/files','readFileSync','nothing','chmod\x20775\x20/var/opt/motion2/server/files/attachments','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x276\x27,\x20\x27Set\x27,\x20\x27FAXOPT(localstationid)=${XMF-LOCALSTATIONID}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','query','default\x20entry\x20context\x20(DO\x20NOT\x20DELETE)','BOOLEAN','catch','moduleSearch','Removed\x20column\x20%s\x20from\x20%s','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x271\x27,\x20\x27NoOp\x27,\x20\x27\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','finally','import','root','Exec\x20chmod','sequelize','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x2711\x27,\x20\x27SendFax\x27,\x20\x27${XMF-PATH},d\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','../config/environment','asterisk\x20-rx\x20\x22reload\x20chan_sip.so\x22','xcally-mixmonitor-context','prototype','DATE','moduleCreate','contact_lead','path','then','cm_contacts','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x278\x27,\x20\x27Set\x27,\x20\x27FAXOPT(minrate)=${XMF-MINRATE}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','utf8','files/templates/context.ejs','table\x20dropped\x20%s','defaultPageTitle','api/voiceContext/voiceContext.model','render','sequence','queryInterface','Changed\x20column\x20%s\x20in\x20table\x20%s','settings','inspect','dropTable','deletedAt','stringify','info','query\x20%s','join','INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x272\x27,\x20\x27Set\x27,\x20\x27CDR(type)=outbound-fax\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());','child_process','\x20Error\x20:','ejs'];(function(_0x927853,_0x43e65d){const _0x434c95=function(_0x57d62d){while(--_0x57d62d){_0x927853['push'](_0x927853['shift']());}};_0x434c95(++_0x43e65d);}(a918_0x43e6,0x1a6));const a918_0x434c=function(_0x927853,_0x43e65d){_0x927853=_0x927853-0x0;let _0x434c95=a918_0x43e6[_0x927853];return _0x434c95;};const _0x2c294b=a918_0x434c;'use strict';const logger=require(_0x2c294b('0x37'))('migration'),util=require('util'),ejs=require(_0x2c294b('0x2e')),fs=require('fs'),path=require(_0x2c294b('0x16')),exec=require(_0x2c294b('0x2c'))[_0x2c294b('0x3c')],config=require(_0x2c294b('0xf')),Sequence=function(){};Sequence[_0x2c294b('0x12')][_0x2c294b('0x3d')]=function(_0x57d62d){const _0x51be36=_0x2c294b;this[_0x51be36('0x3a')]=this[_0x51be36('0x3a')]?this[_0x51be36('0x3a')][_0x51be36('0x9')](_0x57d62d):_0x57d62d();};const Migration=function(_0x4ab8d7){const _0x412f8b=_0x2c294b;this[_0x412f8b('0x21')]=_0x4ab8d7,this[_0x412f8b('0x20')]=new Sequence();};Migration[_0x2c294b('0x12')][_0x2c294b('0x38')]=function(_0x5b345a,_0x158150,_0x5d6e60){const _0x5a1b4a=_0x2c294b,_0x200bfc=this;this[_0x5a1b4a('0x20')][_0x5a1b4a('0x3d')](function(){const _0xf737b9=_0x5a1b4a;return _0x200bfc[_0xf737b9('0x21')]['changeColumn'](_0x5b345a,_0x158150,_0x5d6e60)['then'](function(){const _0x1b7f8a=_0xf737b9;logger[_0x1b7f8a('0x28')](_0x1b7f8a('0x22'),_0x158150,_0x5b345a);})['catch'](function(_0x417809){const _0x2d80bd=_0xf737b9;logger[_0x2d80bd('0x28')](JSON[_0x2d80bd('0x27')](_0x417809));});});},Migration[_0x2c294b('0x12')]['addColumn']=function(_0x581ddc,_0x4110c9,_0x4baa3c){const _0x1bf00f=_0x2c294b,_0x46f7fb=this;this[_0x1bf00f('0x20')][_0x1bf00f('0x3d')](function(){const _0x4079dc=_0x1bf00f;return _0x46f7fb[_0x4079dc('0x21')]['addColumn'](_0x581ddc,_0x4110c9,_0x4baa3c)[_0x4079dc('0x17')](function(){const _0x324cbd=_0x4079dc;logger[_0x324cbd('0x28')]('Added\x20column\x20%s\x20to\x20%s',_0x4110c9,_0x581ddc);})[_0x4079dc('0x5')](function(_0x47862b){const _0x20470b=_0x4079dc;logger[_0x20470b('0x28')](JSON[_0x20470b('0x27')](_0x47862b));});});},Migration[_0x2c294b('0x12')]['dropTable']=function(_0x15a73d){const _0x3a85a1=_0x2c294b,_0x4c1ddd=this;this[_0x3a85a1('0x20')][_0x3a85a1('0x3d')](function(){const _0x47d71f=_0x3a85a1;return _0x4c1ddd[_0x47d71f('0x21')][_0x47d71f('0x25')](_0x15a73d,{'force':!![]})[_0x47d71f('0x17')](function(){const _0x84ee9d=_0x47d71f;logger[_0x84ee9d('0x28')](_0x84ee9d('0x1c'),_0x15a73d);})['catch'](function(_0x2dfd75){const _0x247281=_0x47d71f;logger[_0x247281('0x28')](JSON[_0x247281('0x27')](_0x2dfd75));});});},Migration[_0x2c294b('0x12')][_0x2c294b('0x39')]=function(_0x28f333,_0x118b6b,_0x25d261){const _0x2dde8a=_0x2c294b,_0x539cb2=this;this[_0x2dde8a('0x20')][_0x2dde8a('0x3d')](function(){const _0x27fe37=_0x2dde8a;return _0x539cb2['queryInterface']['addIndex'](_0x28f333,_0x118b6b,{'indexName':_0x25d261})['then'](function(){const _0x1c4290=a918_0x434c;logger[_0x1c4290('0x28')](_0x1c4290('0x31'),_0x28f333,_0x118b6b['join'](','),_0x25d261);})[_0x27fe37('0x5')](function(_0x438843){const _0x6ed63e=_0x27fe37;logger[_0x6ed63e('0x28')](JSON[_0x6ed63e('0x27')](_0x438843));});});},Migration[_0x2c294b('0x12')]['query']=function(_0x5498e4){const _0x2e4da0=this;this['sequence']['enqueue'](function(){const _0xf919dc=a918_0x434c;return _0x2e4da0[_0xf919dc('0x21')][_0xf919dc('0xd')]['query'](_0x5498e4)[_0xf919dc('0x17')](function(){const _0x5f218d=_0xf919dc;logger[_0x5f218d('0x28')](_0x5f218d('0x29'),_0x5498e4);})['catch'](function(_0x3a64c8){logger['info'](JSON['stringify'](_0x3a64c8));});});},Migration[_0x2c294b('0x12')]['removeColumn']=function(_0x327a85,_0x1f924a){const _0x4ec3ea=_0x2c294b,_0x507e77=this;this[_0x4ec3ea('0x20')]['enqueue'](function(){const _0x17a402=_0x4ec3ea;return _0x507e77[_0x17a402('0x21')][_0x17a402('0x35')](_0x327a85,_0x1f924a)[_0x17a402('0x17')](function(){const _0x2e134f=_0x17a402;logger[_0x2e134f('0x28')](_0x2e134f('0x7'),_0x1f924a,_0x327a85);})[_0x17a402('0x5')](function(_0x1bff2b){const _0x15730b=_0x17a402;logger[_0x15730b('0x28')](util[_0x15730b('0x24')](_0x1bff2b,{'showHidden':![],'depth':null}));});});},Migration[_0x2c294b('0x12')]['checkVoiceContexts']=function(){const _0xc55646=_0x2c294b,_0x3f418c=this,_0x4e0749=_0x3f418c[_0xc55646('0x21')][_0xc55646('0xd')][_0xc55646('0xa')](path[_0xc55646('0x2a')](config[_0xc55646('0xb')],_0xc55646('0x1e')));this['sequence']['enqueue'](function(){const _0xf9492c=_0xc55646;return _0x4e0749['findOrCreate']({'where':{'name':_0xf9492c('0x11')},'defaults':{'name':_0xf9492c('0x11'),'description':_0xf9492c('0x3'),'defaultEntry':!![]}})['spread'](function(){return _0x4e0749['findAll']({'raw':!![]});})[_0xf9492c('0x17')](function(_0x7119b){const _0x1a5151=_0xf9492c,_0x1cd170=fs[_0x1a5151('0x41')](path[_0x1a5151('0x2a')](config[_0x1a5151('0xb')],_0x1a5151('0x1b')),_0x1a5151('0x1a')),_0x3493f2=ejs[_0x1a5151('0x1f')](_0x1cd170,{'contexts':_0x7119b||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x3493f2),exec(_0x1a5151('0x10'),function(_0x585e3b,_0x59d475,_0x53555e){const _0x1bcd0f=_0x1a5151;logger[_0x1bcd0f('0x28')](_0x1bcd0f('0xc'),_0x1bcd0f('0x2d'),JSON[_0x1bcd0f('0x27')](_0x585e3b),_0x59d475,_0x53555e);});})[_0xf9492c('0x5')](function(_0x58fc8d){logger['info'](JSON['stringify'](_0x58fc8d));});});},Migration[_0x2c294b('0x12')][_0x2c294b('0x2f')]=function(_0x14ddeb){const _0x110263=_0x2c294b;this[_0x110263('0x20')]['enqueue'](function(){return _0x14ddeb();});},module[_0x2c294b('0x3e')]={'up':function(_0x4533aa,_0x14c117){return new Promise(function(_0x1ebcd8){const _0x39e51c=a918_0x434c,_0x3b964e=new Migration(_0x4533aa);_0x3b964e['addColumn'](_0x39e51c('0x23'),_0x39e51c('0x1d'),{'type':_0x14c117[_0x39e51c('0x4')],'defaultValue':!![]}),_0x3b964e[_0x39e51c('0x33')](_0x39e51c('0x23'),'pageTitle',{'type':_0x14c117['STRING']}),_0x3b964e['checkVoiceContexts'](),_0x3b964e[_0x39e51c('0x33')](_0x39e51c('0x3f'),_0x39e51c('0x6'),{'type':_0x14c117['ENUM'](_0x39e51c('0x15'),_0x39e51c('0x32'),_0x39e51c('0x3b')),'defaultValue':_0x39e51c('0x15')}),_0x3b964e[_0x39e51c('0x33')](_0x39e51c('0x3f'),_0x39e51c('0x14'),{'type':_0x14c117['ENUM'](_0x39e51c('0x42'),_0x39e51c('0x32'),_0x39e51c('0x3b')),'defaultValue':_0x39e51c('0x3b')}),_0x3b964e[_0x39e51c('0x2')](_0x39e51c('0x8')),_0x3b964e[_0x39e51c('0x2')](_0x39e51c('0x2b')),_0x3b964e[_0x39e51c('0x2')]('INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x273\x27,\x20\x27Wait\x27,\x20\x276\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());'),_0x3b964e[_0x39e51c('0x2')](_0x39e51c('0x36')),_0x3b964e[_0x39e51c('0x2')](_0x39e51c('0x34')),_0x3b964e[_0x39e51c('0x2')](_0x39e51c('0x1')),_0x3b964e[_0x39e51c('0x2')]('INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x277\x27,\x20\x27Set\x27,\x20\x27FAXOPT(maxrate)=${XMF-MAXRATE}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());'),_0x3b964e[_0x39e51c('0x2')](_0x39e51c('0x19')),_0x3b964e[_0x39e51c('0x2')]('INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-fax\x27,\x20\x279\x27,\x20\x27Set\x27,\x20\x27FAXOPT(modem)=${XMF-MODEM}\x27,\x20\x27system\x27,\x20\x27Fax\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());'),_0x3b964e['query'](_0x39e51c('0x30')),_0x3b964e[_0x39e51c('0x2')](_0x39e51c('0xe')),exec(_0x39e51c('0x0'),function(_0x36feed,_0x314fc5,_0x8b7711){const _0x5abe0b=_0x39e51c;logger[_0x5abe0b('0x28')](_0x5abe0b('0xc'),'\x20Error\x20:',JSON[_0x5abe0b('0x27')](_0x36feed),_0x314fc5,_0x8b7711),exec(_0x5abe0b('0x40'),function(_0x33f72a,_0x528b9a,_0x3eaef8){const _0x735cbf=_0x5abe0b;logger[_0x735cbf('0x28')]('Ls\x20:','\x20Error\x20:',JSON[_0x735cbf('0x27')](_0x33f72a),_0x528b9a,_0x3eaef8);});}),_0x3b964e[_0x39e51c('0x33')](_0x39e51c('0x18'),_0x39e51c('0x26'),{'type':_0x14c117[_0x39e51c('0x13')],'defaultValue':null}),_0x3b964e[_0x39e51c('0x2f')](_0x1ebcd8);});},'down':function(){}};
\ No newline at end of file