Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / services / xdr / index.js
1 const a1417_0x414a=['242433VObMdR','XDR\x20DISABLED','[%s][index][agentcomplete]','newchannel','musiconholdstop','425420VCTthD','cdr','[%s][index][devicestatechange]','format','agentringnoanswer','[%s][index][hangup]','31wDUcMr','device','[%s][index][agentconnect]','[%s][index][newexten]','uniqueid','./calls.controller','queuecallerabandon','98015ggpopS','./recordings.controller','asteriskPort','[%s][index][agentcalled]','[%s][index][newstate]','debug','[%s][index][musiconholdstart]','dialend','dialbegin','info','util','../../globals','[%s][index][agentringnoanswer]','origtransfereruniqueid','fullybooted','asterisk-manager','./core.controller','222289UfqhGE','agentcomplete','newexten','[%s][index][queuecallerabandon]','asteriskHost','[%s][index][dialbegin]','asteriskPassword','[%s][index][dialend]','[%s][index][attendedtransfer]','shutdown','asteriskUsername','connect','musiconholdstart','./queues.controller','28169BaqSjC','error','[%s][index][newchannel]','304342bHAWeA','[%s][index][cdr]','xdrDisabled','agentconnect','close','blindtransfer','queuecallerleave','./agents.controller','varset','newstate','./utils','[%s]dialbegin','agentcalled','[%s][index][musiconholdstop]','queuecallerjoin','[%s][index][varset]','198425DLDwrB','attendedtransfer','[%s][index][queuecallerjoin]','hangup','managerevent','devicestatechange','1QpRmMn','[%s][index][queuecallerleave]','./dials.controller'];const a1417_0x5013=function(_0x3f36e4,_0x33df3e){_0x3f36e4=_0x3f36e4-0x14a;let _0x414a93=a1417_0x414a[_0x3f36e4];return _0x414a93;};const a1417_0x5e4a00=a1417_0x5013;(function(_0x3ae48c,_0x1a4b9f){const _0x17eb46=a1417_0x5013;while(!![]){try{const _0x33bb84=parseInt(_0x17eb46(0x155))+-parseInt(_0x17eb46(0x152))*-parseInt(_0x17eb46(0x14c))+-parseInt(_0x17eb46(0x167))+-parseInt(_0x17eb46(0x15a))+-parseInt(_0x17eb46(0x189))+-parseInt(_0x17eb46(0x178))+parseInt(_0x17eb46(0x160))*parseInt(_0x17eb46(0x186));if(_0x33bb84===_0x1a4b9f)break;else _0x3ae48c['push'](_0x3ae48c['shift']());}catch(_0x2bcdd0){_0x3ae48c['push'](_0x3ae48c['shift']());}}}(a1417_0x414a,0x4075f),require(a1417_0x5e4a00(0x172)));const AsteriskManager=require(a1417_0x5e4a00(0x176)),{getConfig}=require('@config/get-config'),config=getConfig(),utils=require(a1417_0x5e4a00(0x193)),util=require(a1417_0x5e4a00(0x171)),ami=new AsteriskManager(config[a1417_0x5e4a00(0x169)],config[a1417_0x5e4a00(0x17c)],config[a1417_0x5e4a00(0x182)],config[a1417_0x5e4a00(0x17e)],!![]);ami['keepConnected']();if(config[a1417_0x5e4a00(0x18b)])utils[a1417_0x5e4a00(0x170)](a1417_0x5e4a00(0x156));else{const agents=require(a1417_0x5e4a00(0x190)),calls=require(a1417_0x5e4a00(0x165)),queues=require(a1417_0x5e4a00(0x185)),recordings=require(a1417_0x5e4a00(0x168)),members=require('./members.controller'),dials=require(a1417_0x5e4a00(0x154)),transfers=require('./transfers.controller'),core=require(a1417_0x5e4a00(0x177));ami['on'](a1417_0x5e4a00(0x183),core['connect']),ami['on'](a1417_0x5e4a00(0x181),core[a1417_0x5e4a00(0x181)]),ami['on'](a1417_0x5e4a00(0x175),core['fullybooted']),ami['on'](a1417_0x5e4a00(0x187),core[a1417_0x5e4a00(0x187)]),ami['on']('close',core[a1417_0x5e4a00(0x18d)]),ami['on'](a1417_0x5e4a00(0x150),core[a1417_0x5e4a00(0x150)]),ami['on']('devicestatechange',function(_0x5c75ec){const _0x162d5d=a1417_0x5e4a00;try{utils[_0x162d5d(0x16c)](util[_0x162d5d(0x15d)](_0x162d5d(0x15c),_0x5c75ec[_0x162d5d(0x161)]),_0x5c75ec),members[_0x162d5d(0x151)](_0x5c75ec);}catch(_0x5b470f){utils[_0x162d5d(0x187)](util['format']('[%s][index][devicestatechange]',_0x5c75ec[_0x162d5d(0x161)]),_0x5b470f);}}),ami['on'](a1417_0x5e4a00(0x195),function(_0x15a905){const _0x17b1b5=a1417_0x5e4a00;try{utils[_0x17b1b5(0x16c)](util[_0x17b1b5(0x15d)](_0x17b1b5(0x16a),_0x15a905[_0x17b1b5(0x164)]),_0x15a905),agents['agentcalled'](_0x15a905);}catch(_0x43abff){utils[_0x17b1b5(0x187)](util[_0x17b1b5(0x15d)](_0x17b1b5(0x16a),_0x15a905[_0x17b1b5(0x164)]),_0x43abff);}}),ami['on'](a1417_0x5e4a00(0x15e),function(_0x165460){const _0x11910a=a1417_0x5e4a00;try{utils['debug'](util['format'](_0x11910a(0x173),_0x165460[_0x11910a(0x164)]),_0x165460),agents[_0x11910a(0x15e)](_0x165460);}catch(_0x1108ac){utils[_0x11910a(0x187)](util[_0x11910a(0x15d)]('[%s][index][agentringnoanswer]',_0x165460[_0x11910a(0x164)]),_0x1108ac);}}),ami['on'](a1417_0x5e4a00(0x18c),function(_0x2e7611){const _0x301c16=a1417_0x5e4a00;try{utils[_0x301c16(0x16c)](util[_0x301c16(0x15d)](_0x301c16(0x162),_0x2e7611[_0x301c16(0x164)]),_0x2e7611),agents['agentconnect'](_0x2e7611),queues['agentconnect'](_0x2e7611);}catch(_0x25bc71){utils[_0x301c16(0x187)](util[_0x301c16(0x15d)](_0x301c16(0x162),_0x2e7611['uniqueid']),_0x25bc71);}}),ami['on'](a1417_0x5e4a00(0x179),function(_0x314e23){const _0x350897=a1417_0x5e4a00;try{utils[_0x350897(0x16c)](util['format'](_0x350897(0x157),_0x314e23[_0x350897(0x164)]),_0x314e23),agents['agentcomplete'](_0x314e23),queues[_0x350897(0x179)](_0x314e23),members[_0x350897(0x179)](_0x314e23);}catch(_0x4939b7){utils[_0x350897(0x187)](util['format'](_0x350897(0x157),_0x314e23[_0x350897(0x164)]),_0x4939b7);}}),ami['on'](a1417_0x5e4a00(0x166),function(_0x3dd0d9){const _0x1adc0f=a1417_0x5e4a00;try{utils['debug'](util[_0x1adc0f(0x15d)](_0x1adc0f(0x17b),_0x3dd0d9['uniqueid']),_0x3dd0d9),agents[_0x1adc0f(0x166)](_0x3dd0d9),queues['queuecallerabandon'](_0x3dd0d9);}catch(_0xe2dc5a){utils[_0x1adc0f(0x187)](util[_0x1adc0f(0x15d)](_0x1adc0f(0x17b),_0x3dd0d9[_0x1adc0f(0x164)]),_0xe2dc5a);}}),ami['on']('queuecallerjoin',function(_0x47bda0){const _0x11a9cd=a1417_0x5e4a00;try{utils['debug'](util[_0x11a9cd(0x15d)](_0x11a9cd(0x14e),_0x47bda0[_0x11a9cd(0x164)]),_0x47bda0),queues[_0x11a9cd(0x14a)](_0x47bda0),recordings['queuecallerjoin'](_0x47bda0);}catch(_0x52399e){utils[_0x11a9cd(0x187)](util[_0x11a9cd(0x15d)](_0x11a9cd(0x14e),_0x47bda0[_0x11a9cd(0x164)]),_0x52399e);}}),ami['on'](a1417_0x5e4a00(0x18f),function(_0x29285d){const _0x5c2d29=a1417_0x5e4a00;try{utils['debug'](util['format']('[%s][index][queuecallerleave]',_0x29285d[_0x5c2d29(0x164)]),_0x29285d),queues[_0x5c2d29(0x18f)](_0x29285d);}catch(_0x281500){utils[_0x5c2d29(0x187)](util[_0x5c2d29(0x15d)](_0x5c2d29(0x153),_0x29285d[_0x5c2d29(0x164)]),_0x281500);}}),ami['on'](a1417_0x5e4a00(0x184),function(_0x4d0c5b){const _0x22ef17=a1417_0x5e4a00;try{utils['debug'](util[_0x22ef17(0x15d)](_0x22ef17(0x16d),_0x4d0c5b['uniqueid']),_0x4d0c5b),queues[_0x22ef17(0x184)](_0x4d0c5b),calls[_0x22ef17(0x184)](_0x4d0c5b);}catch(_0x36264c){utils[_0x22ef17(0x187)](util[_0x22ef17(0x15d)](_0x22ef17(0x16d),_0x4d0c5b[_0x22ef17(0x164)]),_0x36264c);}}),ami['on'](a1417_0x5e4a00(0x159),function(_0x2d4586){const _0x382882=a1417_0x5e4a00;try{utils[_0x382882(0x16c)](util[_0x382882(0x15d)](_0x382882(0x196),_0x2d4586[_0x382882(0x164)]),_0x2d4586),queues[_0x382882(0x159)](_0x2d4586),calls[_0x382882(0x159)](_0x2d4586);}catch(_0xe06821){utils['error'](util[_0x382882(0x15d)](_0x382882(0x196),_0x2d4586[_0x382882(0x164)]),_0xe06821);}}),ami['on'](a1417_0x5e4a00(0x192),function(_0x569dc2){const _0x1f8d5a=a1417_0x5e4a00;try{utils['debug'](util[_0x1f8d5a(0x15d)](_0x1f8d5a(0x16b),_0x569dc2[_0x1f8d5a(0x164)]),_0x569dc2),calls[_0x1f8d5a(0x192)](_0x569dc2),recordings[_0x1f8d5a(0x192)](_0x569dc2);}catch(_0x57e3ab){utils['error'](util[_0x1f8d5a(0x15d)](_0x1f8d5a(0x16b),_0x569dc2[_0x1f8d5a(0x164)]),_0x57e3ab);}}),ami['on'](a1417_0x5e4a00(0x14f),function(_0x21a95a){const _0x452afc=a1417_0x5e4a00;try{utils['debug'](util[_0x452afc(0x15d)](_0x452afc(0x15f),_0x21a95a[_0x452afc(0x164)]),_0x21a95a),calls['hangup'](_0x21a95a),recordings['hangup'](_0x21a95a),dials['hangup'](_0x21a95a),agents[_0x452afc(0x14f)](_0x21a95a),queues[_0x452afc(0x14f)](_0x21a95a);}catch(_0x1ec891){utils[_0x452afc(0x187)](util[_0x452afc(0x15d)](_0x452afc(0x15f),_0x21a95a[_0x452afc(0x164)]),_0x1ec891);}}),ami['on'](a1417_0x5e4a00(0x15b),function(_0x47b53d){const _0x1e511a=a1417_0x5e4a00;try{utils[_0x1e511a(0x16c)](util['format'](_0x1e511a(0x18a),_0x47b53d[_0x1e511a(0x164)]),_0x47b53d),members[_0x1e511a(0x15b)](_0x47b53d);}catch(_0x59d4d6){utils['error'](util['format'](_0x1e511a(0x18a),_0x47b53d['uniqueid']),_0x59d4d6);}}),ami['on'](a1417_0x5e4a00(0x18e),function(_0x3dabde){const _0x51d72f=a1417_0x5e4a00;try{utils[_0x51d72f(0x16c)](util[_0x51d72f(0x15d)]('[%s][index][blindtransfer]',_0x3dabde[_0x51d72f(0x164)]),_0x3dabde),queues[_0x51d72f(0x18e)](_0x3dabde),agents[_0x51d72f(0x18e)](_0x3dabde),transfers[_0x51d72f(0x18e)](_0x3dabde);}catch(_0x269dc1){utils['error'](util[_0x51d72f(0x15d)]('[%s][index][blindtransfer]',_0x3dabde['uniqueid']),_0x269dc1);}}),ami['on']('attendedtransfer',function(_0xda7b21){const _0x317a80=a1417_0x5e4a00;try{utils[_0x317a80(0x16c)](util[_0x317a80(0x15d)](_0x317a80(0x180),_0xda7b21[_0x317a80(0x174)]),_0xda7b21),queues[_0x317a80(0x14d)](_0xda7b21),transfers[_0x317a80(0x14d)](_0xda7b21),agents[_0x317a80(0x14d)](_0xda7b21),calls[_0x317a80(0x14d)](_0xda7b21);}catch(_0x4d0905){utils[_0x317a80(0x187)](util['format'](_0x317a80(0x180),_0xda7b21['origtransfereruniqueid']),_0x4d0905);}}),ami['on']('varset',function(_0x44f92e){const _0x145927=a1417_0x5e4a00;try{utils[_0x145927(0x16c)](util[_0x145927(0x15d)](_0x145927(0x14b),_0x44f92e['uniqueid']),_0x44f92e),queues[_0x145927(0x191)](_0x44f92e),recordings[_0x145927(0x191)](_0x44f92e),calls[_0x145927(0x191)](_0x44f92e),dials[_0x145927(0x191)](_0x44f92e);}catch(_0x213dae){utils[_0x145927(0x187)](util['format'](_0x145927(0x14b),_0x44f92e[_0x145927(0x164)]),_0x213dae);}}),ami['on'](a1417_0x5e4a00(0x17a),function(_0x5f1290){const _0x530f1b=a1417_0x5e4a00;try{utils[_0x530f1b(0x16c)](util[_0x530f1b(0x15d)]('[%s][index][newexten]',_0x5f1290[_0x530f1b(0x164)]),_0x5f1290),calls[_0x530f1b(0x17a)](_0x5f1290),recordings['newexten'](_0x5f1290),dials[_0x530f1b(0x17a)](_0x5f1290);}catch(_0x5f3b45){utils[_0x530f1b(0x187)](util['format'](_0x530f1b(0x163),_0x5f1290[_0x530f1b(0x164)]),_0x5f3b45);}}),ami['on'](a1417_0x5e4a00(0x158),function(_0x1a7dbc){const _0x1100ed=a1417_0x5e4a00;try{utils[_0x1100ed(0x16c)](util[_0x1100ed(0x15d)]('[%s][index][newchannel]',_0x1a7dbc[_0x1100ed(0x164)]),_0x1a7dbc),calls[_0x1100ed(0x158)](_0x1a7dbc),recordings['newchannel'](_0x1a7dbc);}catch(_0x1bbe04){utils['error'](util['format'](_0x1100ed(0x188),_0x1a7dbc[_0x1100ed(0x164)]),_0x1bbe04);}}),ami['on'](a1417_0x5e4a00(0x16f),function(_0xeb1d27){const _0x59428e=a1417_0x5e4a00;try{utils[_0x59428e(0x16c)](util['format'](_0x59428e(0x17d),_0xeb1d27[_0x59428e(0x164)]),_0xeb1d27),dials[_0x59428e(0x16f)](_0xeb1d27);}catch(_0xa0a16f){utils['error'](util[_0x59428e(0x15d)](_0x59428e(0x194),_0xeb1d27[_0x59428e(0x164)]),_0xa0a16f);}}),ami['on'](a1417_0x5e4a00(0x16e),function(_0x3d4200){const _0xf4029e=a1417_0x5e4a00;try{utils[_0xf4029e(0x16c)](util[_0xf4029e(0x15d)](_0xf4029e(0x17f),_0x3d4200[_0xf4029e(0x164)]),_0x3d4200),dials['dialend'](_0x3d4200);}catch(_0x4401c8){utils[_0xf4029e(0x187)](util[_0xf4029e(0x15d)]('[%s][index][dialend]',_0x3d4200[_0xf4029e(0x164)]),_0x4401c8);}});}