90f14bb2934e7756a6868b4339b4826f4e97c6e0
[motion-next.git] / server / services / ami / server / index.js
1 const a1301_0x2955=['StopMixMonitor\x20Success','pTalking','predictiveIntervalAvgHoldtime','custom:','predictiveIntervalMultiplicativeFactor','map','erlangAbandonmentRate','SIP','predictiveIntervalErlangCallsDroppedCalls','ai(mixmonitorid)','erlangCallToSecond','127.0.0.1','dialMethod','outboundBlacklistCallsDay','util','asterisk','voicechannel','error','status','outboundNoAnswerCallsDay','Channel\x20doesn\x27t\x20exist','resolve','isNil','context','MixMonitor\x20Success','dialOriginateCallerIdNumber','StopMixMonitor','toLowerCase','callerid','length','predictiveIntervalAvailable','dialPrefix','queueChannels','dialActive','http','predictiveIntervalAnsweredCalls','timer','catch','total','../properties','channel','Action','sumBillable','lodash','voiceQueues','predictiveIntervalDroppedCallsTimeout','../../../config/environment','Interval','name','exten','then','message','outboundAnswerCallsDay','outboundChannels','push','action','answered','available','emit','server','loggedInDb','predictiveIntervalErlangCalls','validate','sumHoldTime','ami\x20disconnected','outbound','outboundDropCallsDayTimeout','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','outboundDropCallsDayACS','updateStatusRealtime','campaigns','isConnected','jayson/promise','predictiveIntervalTotalCalls','startPredictive','Reload','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','monitors','MixMonitor','wav','outboundUnknownCallsDay','type','find','%s.%s','outboundAnswerAgiCallsDay','Event\x20name\x20mandatory','predictiveIntervalHitRate','agents','outboundBusyCallsDay','values','RPC\x20listening\x20on\x20port:','outboundRejectCallsDay','voicequeuechannel','dialOriginateTimeout','event','outboundReCallsDay','outboundNoSuchCallsDay','format','Trunk','pick','outboundOriginateFailureCallsDay','destinationchannel','Hangup','unmanaged','timers','username','strategy','predictiveIntervalPauses','content','outboundDropCallsDayCallersExit','trunks','command','mixmonitorid','erlangCalls','startProgressive','voicequeuechannelhangup','waiting','originated','uniqueid','rec','QueuePause','channels','join','module','send','undefined','stop'];(function(_0x28938a,_0x278d70){const _0x295575=function(_0x23db2e){while(--_0x23db2e){_0x28938a['push'](_0x28938a['shift']());}};_0x295575(++_0x278d70);}(a1301_0x2955,0x14a));const a1301_0x23db=function(_0x28938a,_0x278d70){_0x28938a=_0x28938a-0x8b;let _0x295575=a1301_0x2955[_0x28938a];return _0x295575;};const a1301_0x3b49bd=a1301_0x23db;'use strict';const _=require(a1301_0x3b49bd(0xec)),util=require(a1301_0x3b49bd(0xcf)),jayson=require(a1301_0x3b49bd(0x109)),schema=require(a1301_0x3b49bd(0xff)),moment=require('moment'),config=require(a1301_0x3b49bd(0xef)),properties=require(a1301_0x3b49bd(0xe8)),ami=require('../ami');exports['listen']=function(_0x2b01b4,_0xa83ab,_0x551a6d){return new Promise(function(_0x3087b5,_0x16a711){const _0x3dfb41=a1301_0x23db,_0x5da8b8={'QueuePause':function(_0x196e6f){return new Promise(function(_0x4fae48){const _0x2256b7=a1301_0x23db,_0x4c29ce=util[_0x2256b7(0xa3)]('%s/%s',_0x2256b7(0xc8),_0x196e6f[_0x2256b7(0xf1)]);_0x2b01b4[_0x2256b7(0xaa)]&&_0x2b01b4[_0x2256b7(0xaa)][_0x4c29ce]&&_0x2b01b4['timers'][_0x4c29ce][_0x2256b7(0xe5)]&&_0x2b01b4['timers'][_0x4c29ce]['updateAcw'](),_0x2b01b4[_0x2256b7(0x99)][_0x4c29ce]&&_0x2b01b4[_0x2256b7(0x99)][_0x4c29ce][_0x2256b7(0x106)]({'statePause':_0x196e6f['pause']?!![]:![]}),_0x4fae48({'code':0xc8,'message':_0x2256b7(0xba)});});},'Reload':function(_0x1cebf5){const _0x5e1218=this;return new Promise(function(_0x45e248,_0x3e26b1){const _0x4b07dc=a1301_0x23db;if(ami[_0x4b07dc(0x108)]()==![])return _0x3e26b1(_0x5e1218[_0x4b07dc(0xd2)](0x1f4,[config[_0x4b07dc(0xd0)]['ip'],config[_0x4b07dc(0xd0)]['username'],_0x4b07dc(0x101)]['join']('\x20')));return _0x1cebf5=_['pick'](_0x1cebf5,_['keys'](properties[_0x4b07dc(0xbd)])),_0x1cebf5['action']=_0x4b07dc(0x8c),ami['Action'](_0x1cebf5)[_0x4b07dc(0xf3)](function(_0x56a418){_0x45e248({'code':0xc8,'message':_0x56a418['message']});})[_0x4b07dc(0xe6)](function(_0xbdd3ab){const _0xfc011e=_0x4b07dc;_0x3e26b1(_0x5e1218['error'](0x1f5,_0xbdd3ab[_0xfc011e(0xf4)]));});});},'Command':function(_0x35cb0f){const _0x2e3c29=this;return new Promise(function(_0x2d040e,_0x5a61c2){const _0x53806c=a1301_0x23db;if(ami[_0x53806c(0x108)]()==![])return _0x5a61c2(_0x2e3c29[_0x53806c(0xd2)](0x1f4,[config[_0x53806c(0xd0)]['ip'],config[_0x53806c(0xd0)]['username'],_0x53806c(0x101)]['join']('\x20')));return _0x35cb0f=_[_0x53806c(0xa5)](_0x35cb0f,_0x53806c(0xb1)),_0x35cb0f[_0x53806c(0xf8)]='Command',ami[_0x53806c(0xea)](_0x35cb0f)['then'](function(_0x154e0c){const _0xe30175=_0x53806c;_0x2d040e({'code':0xc8,'message':_0x154e0c[_0xe30175(0xae)]});})[_0x53806c(0xe6)](function(_0x461df3){const _0x366dd2=_0x53806c;_0x5a61c2(_0x2e3c29[_0x366dd2(0xd2)](0x1f5,_0x461df3['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x398dc8){const _0x4cb0d7=a1301_0x23db,_0x429b41=[];for(const _0x3bfe87 in _0x2b01b4[_0x4cb0d7(0xed)]){if(typeof _0x2b01b4['voiceQueues'][_0x3bfe87]!==_0x4cb0d7(0xbf)){const _0x494459=_0x2b01b4['voiceQueues'][_0x3bfe87],_0x4accae={'id':_0x494459['id'],'name':_0x494459['name'],'strategy':_0x494459[_0x4cb0d7(0xac)],'answered':_0x494459[_0x4cb0d7(0xf9)],'available':_0x494459[_0x4cb0d7(0xfa)],'loggedIn':_0x494459['loggedIn'],'pTalking':_0x494459[_0x4cb0d7(0xc2)],'sumBillable':_0x494459[_0x4cb0d7(0xeb)],'sumDuration':_0x494459['sumDuration'],'sumHoldTime':_0x494459[_0x4cb0d7(0x100)]||0x0,'talking':_0x494459['talking'],'total':_0x494459[_0x4cb0d7(0xe7)],'type':_0x494459[_0x4cb0d7(0x93)],'unmanaged':_0x494459[_0x4cb0d7(0xa9)],'abandoned':_0x494459['abandoned'],'waiting':_0x494459[_0x4cb0d7(0xb6)],'loggedInDb':_0x494459[_0x4cb0d7(0xfd)]};_0x494459[_0x4cb0d7(0x93)]===_0x4cb0d7(0x102)&&(_0x4accae[_0x4cb0d7(0xe2)]=_0x494459['dialActive'],_0x4accae[_0x4cb0d7(0xcd)]=_0x494459['dialMethod'],_0x4accae['dialOriginateCallerIdName']=_0x494459['dialOriginateCallerIdName'],_0x4accae[_0x4cb0d7(0xda)]=_0x494459['dialOriginateCallerIdNumber'],_0x4accae[_0x4cb0d7(0x9f)]=_0x494459[_0x4cb0d7(0x9f)],_0x4accae[_0x4cb0d7(0xe0)]=_0x494459['dialPrefix'],_0x4accae[_0x4cb0d7(0x96)]=_0x494459[_0x4cb0d7(0x96)],_0x4accae['outboundAnswerCallsDay']=_0x494459[_0x4cb0d7(0xf5)],_0x4accae['outboundBlacklistCallsDay']=_0x494459[_0x4cb0d7(0xce)],_0x4accae[_0x4cb0d7(0x9a)]=_0x494459[_0x4cb0d7(0x9a)],_0x4accae['outboundCongestionCallsDay']=_0x494459['outboundCongestionCallsDay'],_0x4accae[_0x4cb0d7(0x105)]=_0x494459['outboundDropCallsDayACS'],_0x4accae[_0x4cb0d7(0xaf)]=_0x494459[_0x4cb0d7(0xaf)],_0x4accae[_0x4cb0d7(0x103)]=_0x494459[_0x4cb0d7(0x103)],_0x4accae[_0x4cb0d7(0xd4)]=_0x494459[_0x4cb0d7(0xd4)],_0x4accae['outboundNoSuchCallsDay']=_0x494459[_0x4cb0d7(0xa2)],_0x4accae[_0x4cb0d7(0xa6)]=_0x494459[_0x4cb0d7(0xa6)],_0x4accae[_0x4cb0d7(0xa1)]=_0x494459['outboundReCallsDay'],_0x4accae[_0x4cb0d7(0x9d)]=_0x494459[_0x4cb0d7(0x9d)],_0x4accae[_0x4cb0d7(0x92)]=_0x494459[_0x4cb0d7(0x92)],_0x4accae['predictiveIntervalAnsweredCalls']=_0x494459[_0x4cb0d7(0xe4)],_0x4accae[_0x4cb0d7(0xc3)]=_0x494459[_0x4cb0d7(0xc3)],_0x4accae['predictiveIntervalAvgTalktime']=_0x494459['predictiveIntervalAvgTalktime'],_0x4accae['predictiveIntervalDroppedCallsCallersExit']=_0x494459['predictiveIntervalDroppedCallsCallersExit'],_0x4accae[_0x4cb0d7(0xee)]=_0x494459[_0x4cb0d7(0xee)],_0x4accae[_0x4cb0d7(0xfe)]=_0x494459['predictiveIntervalErlangCalls'],_0x4accae[_0x4cb0d7(0xc9)]=_0x494459[_0x4cb0d7(0xc9)],_0x4accae[_0x4cb0d7(0x98)]=_0x494459[_0x4cb0d7(0x98)],_0x4accae['predictiveIntervalMultiplicativeFactor']=_0x494459[_0x4cb0d7(0xc5)],_0x4accae[_0x4cb0d7(0xad)]=_0x494459[_0x4cb0d7(0xad)],_0x4accae[_0x4cb0d7(0xdf)]=_0x494459[_0x4cb0d7(0xdf)],_0x4accae[_0x4cb0d7(0x10a)]=_0x494459['predictiveIntervalTotalCalls'],_0x4accae['message']=_0x494459['message'],_0x4accae[_0x4cb0d7(0xb7)]=_0x494459['originated'],_0x4accae[_0x4cb0d7(0xb3)]=_0x494459[_0x4cb0d7(0xb3)],_0x4accae['erlangCallToSecond']=_0x494459[_0x4cb0d7(0xcb)],_0x4accae[_0x4cb0d7(0xc7)]=_0x494459['erlangAbandonmentRate'],_0x4accae['erlangBusyFactor']=_0x494459['erlangBusyFactor'],_0x4accae[_0x4cb0d7(0x8b)]=_0x494459[_0x4cb0d7(0x8b)],_0x4accae[_0x4cb0d7(0xb4)]=_0x494459[_0x4cb0d7(0xb4)]),_0x494459[_0x4cb0d7(0xa4)]&&(_0x4accae['Trunk']={'id':_0x494459[_0x4cb0d7(0xa4)]['id'],'name':_0x494459[_0x4cb0d7(0xa4)][_0x4cb0d7(0xf1)],'active':_0x494459[_0x4cb0d7(0xa4)]['active'],'callerid':_0x494459[_0x4cb0d7(0xa4)][_0x4cb0d7(0xdd)]}),_0x494459[_0x4cb0d7(0xf0)]&&(_0x4accae[_0x4cb0d7(0xf0)]={'id':_0x494459[_0x4cb0d7(0xf0)]['id'],'name':_0x494459[_0x4cb0d7(0xf0)][_0x4cb0d7(0xf1)]}),_0x429b41[_0x4cb0d7(0xf7)](_0x4accae);}}_0x398dc8({'count':_0x429b41[_0x4cb0d7(0xde)],'rows':_0x429b41});});},'VoiceChannels':function(){return new Promise(function(_0x2c070b){const _0x548e41=a1301_0x23db,_0x2d5c96=_[_0x548e41(0x9b)](_0x2b01b4['channels']);_0x2c070b({'count':_0x2d5c96[_0x548e41(0xde)],'rows':_0x2d5c96});});},'VoiceChannelMixMonitor':function(_0x42dfa0){const _0x2d0c08=this;return new Promise(function(_0x20ab4d,_0x3c932a){const _0x57ec71=a1301_0x23db;if(ami[_0x57ec71(0x108)]()==![])return _0x3c932a(_0x2d0c08[_0x57ec71(0xd2)](0x1f4,[config['asterisk']['ip'],config[_0x57ec71(0xd0)][_0x57ec71(0xab)],_0x57ec71(0x101)][_0x57ec71(0xbc)]('\x20')));const _0x5211de=schema(properties[_0x57ec71(0xd1)])[_0x57ec71(0xff)](_0x42dfa0);if(_0x5211de[_0x57ec71(0xde)]>0x0)return _0x3c932a(_0x2d0c08['error'](0x1f4,_[_0x57ec71(0xc6)](_0x5211de,'message')[_0x57ec71(0xbc)](',\x20')));const _0x42f9eb=_[_0x57ec71(0x94)](_0x2b01b4[_0x57ec71(0xbb)],{'uniqueid':_0x42dfa0[_0x57ec71(0xb8)]});if(_0x42f9eb&&_0x42f9eb[_0x57ec71(0xe9)]){const _0x3c85f8=util['format'](_0x57ec71(0x95),_0x42dfa0['filename']||_0x42dfa0['uniqueid'],_0x42dfa0[_0x57ec71(0xa3)]||_0x57ec71(0x91));return ami[_0x57ec71(0xea)]({'action':_0x57ec71(0x90),'channel':_0x42f9eb[_0x57ec71(0xe9)],'file':_0x3c85f8,'options':_0x57ec71(0xca)})['then'](function(_0x52a43d){const _0xc19919=_0x57ec71,_0x50ea86=_['find'](_0x42f9eb['monitors'],{'filename':_0xc19919(0x8d)+_0x3c85f8[_0xc19919(0xdc)]()});_[_0xc19919(0xd7)](_0x50ea86)?_0x42f9eb[_0xc19919(0x8f)]['push']({'filename':_0xc19919(0x8d)+_0x3c85f8[_0xc19919(0xdc)](),'createdAt':moment()[_0xc19919(0xa3)](_0xc19919(0x8e)),'mixmonitorid':_0x52a43d[_0xc19919(0xb2)],'status':'rec'}):(_0x50ea86[_0xc19919(0xb2)]=_0x52a43d[_0xc19919(0xb2)],_0x50ea86[_0xc19919(0xd3)]=_0xc19919(0xb9)),_0x20ab4d({'code':0xc8,'message':[_0x42dfa0[_0xc19919(0xb8)],_0xc19919(0xd9),_0x52a43d[_0xc19919(0xb2)]][_0xc19919(0xbc)]('\x20'),'mixmonitorid':_0x52a43d[_0xc19919(0xb2)]});})['catch'](function(_0x55f1e8){const _0x5e1dd3=_0x57ec71;_0x3c932a(_0x2d0c08[_0x5e1dd3(0xd2)](0x1f5,[_0x42dfa0['uniqueid'],_0x55f1e8['message'][_0x5e1dd3(0xdc)]()][_0x5e1dd3(0xbc)]('\x20')));});}else return _0x3c932a(_0x2d0c08[_0x57ec71(0xd2)](0x1f5,'Channel\x20doesn\x27t\x20exist'));});},'VoiceChannelStopMixMonitor':function(_0x412820){const _0x47a9a4=this;return new Promise(function(_0x54c053,_0x4977fc){const _0x594f65=a1301_0x23db;if(ami[_0x594f65(0x108)]()==![])return _0x4977fc(_0x47a9a4['error'](0x1f4,[config[_0x594f65(0xd0)]['ip'],config[_0x594f65(0xd0)][_0x594f65(0xab)],_0x594f65(0x101)][_0x594f65(0xbc)]('\x20')));const _0x54ad34=schema(properties[_0x594f65(0xd1)])[_0x594f65(0xff)](_0x412820);if(_0x54ad34[_0x594f65(0xde)]>0x0)return _0x4977fc(_0x47a9a4['error'](0x1f4,_[_0x594f65(0xc6)](_0x54ad34,_0x594f65(0xf4))[_0x594f65(0xbc)](',\x20')));const _0x354829=_['find'](_0x2b01b4[_0x594f65(0xbb)],{'uniqueid':_0x412820[_0x594f65(0xb8)]});return _0x354829?Promise[_0x594f65(0xd6)]()[_0x594f65(0xf3)](function(){const _0x9e8f4=_0x594f65;if(_0x354829[_0x9e8f4(0xe9)])return ami[_0x9e8f4(0xea)]({'action':'StopMixMonitor','channel':_0x354829[_0x9e8f4(0xe9)],'mixmonitorid':_0x412820[_0x9e8f4(0xb2)]})[_0x9e8f4(0xe6)](function(){});})['then'](function(){const _0x599a12=_0x594f65;if(_0x354829[_0x599a12(0xa7)])return ami[_0x599a12(0xea)]({'action':_0x599a12(0xdb),'channel':_0x354829[_0x599a12(0xa7)],'mixmonitorid':_0x412820[_0x599a12(0xb2)]})[_0x599a12(0xe6)](function(){});})[_0x594f65(0xf3)](function(){const _0x150759=_0x594f65,_0x302653=_[_0x150759(0x94)](_0x354829['monitors'],{'mixmonitorid':_0x412820['mixmonitorid']});_0x302653&&(_0x302653[_0x150759(0xd3)]=_0x150759(0xc0));})[_0x594f65(0xf3)](function(){const _0x222a25=_0x594f65,_0x55c49b=util[_0x222a25(0xa3)](_0x222a25(0x95),_0x412820['filename']||_0x412820[_0x222a25(0xb8)],_0x412820['format']||_0x222a25(0x91)),_0x35dfaf=_[_0x222a25(0x94)](_0x354829['monitors'],{'filename':_0x222a25(0x8d)+_0x55c49b[_0x222a25(0xdc)]()});_0x35dfaf&&(_0x35dfaf['status']=_0x222a25(0xc0));})['then'](function(){const _0x32daed=_0x594f65;_0x54c053({'code':0xc8,'message':[_0x412820[_0x32daed(0xb8)],_0x32daed(0xc1)][_0x32daed(0xbc)]('\x20')});})[_0x594f65(0xe6)](function(_0x1ecf56){const _0x1291fc=_0x594f65;_0x4977fc(_0x47a9a4['error'](0x1f5,[_0x412820[_0x1291fc(0xb8)],_0x1ecf56[_0x1291fc(0xf4)][_0x1291fc(0xdc)]()]['join']('\x20')));}):_0x4977fc(_0x47a9a4['error'](0x1f5,_0x594f65(0xd5)));});},'VoiceQueuesChannels':function(){return new Promise(function(_0x15c17c){const _0xb0a42a=a1301_0x23db,_0x970172=_[_0xb0a42a(0x9b)](_0x2b01b4['queueChannels']);_0x15c17c({'count':_0x970172[_0xb0a42a(0xde)],'rows':_0x970172});});},'VoiceQueuesChannel':function(_0x1e0f0a){const _0x4cea01=this;return new Promise(function(_0x3430be,_0x1ee449){const _0x1cd363=a1301_0x23db,_0x4f4702=schema(properties[_0x1cd363(0x9e)])['validate'](_0x1e0f0a);if(_0x4f4702[_0x1cd363(0xde)]>0x0)return _0x1ee449(_0x4cea01[_0x1cd363(0xd2)](0x1f4,_[_0x1cd363(0xc6)](_0x4f4702,_0x1cd363(0xf4))[_0x1cd363(0xbc)](',\x20')));const _0x44042b=_[_0x1cd363(0x94)](_0x2b01b4[_0x1cd363(0xe1)],{'uniqueid':_0x1e0f0a['uniqueid']});if(_0x44042b)_0x3430be(_0x44042b);else return _0x1ee449(_0x4cea01[_0x1cd363(0xd2)](0x1f5,'Channel\x20doesn\x27t\x20exist'));});},'VoiceQueuesChannelHangup':function(_0x5668f7){const _0x44fc42=this;return new Promise(function(_0x55c5e7,_0x3dbff2){const _0x481579=a1301_0x23db;if(ami[_0x481579(0x108)]()==![])return _0x3dbff2(_0x44fc42['error'](0x1f4,[config['asterisk']['ip'],config[_0x481579(0xd0)][_0x481579(0xab)],'ami\x20disconnected'][_0x481579(0xbc)]('\x20')));const _0x1d7611=schema(properties[_0x481579(0xb5)])[_0x481579(0xff)](_0x5668f7);if(_0x1d7611[_0x481579(0xde)]>0x0)return _0x3dbff2(_0x44fc42['error'](0x1f4,_[_0x481579(0xc6)](_0x1d7611,_0x481579(0xf4))['join'](',\x20')));const _0x53c5d0=_[_0x481579(0x94)](_0x2b01b4[_0x481579(0xe1)],{'uniqueid':_0x5668f7[_0x481579(0xb8)]});return _0x53c5d0&&_0x53c5d0[_0x481579(0xe9)]?ami[_0x481579(0xea)]({'action':_0x481579(0xa8),'channel':_0x53c5d0[_0x481579(0xe9)]})[_0x481579(0xf3)](function(_0x2c3eca){const _0x2aeb9c=_0x481579;_0x55c5e7({'code':0xc8,'message':[_0x5668f7[_0x2aeb9c(0xb8)],_0x2c3eca[_0x2aeb9c(0xf4)][_0x2aeb9c(0xdc)]()]['join']('\x20')});})[_0x481579(0xe6)](function(_0x3ef581){const _0x4d6776=_0x481579;_0x3dbff2(_0x44fc42[_0x4d6776(0xd2)](0x1f5,[_0x5668f7['uniqueid'],_0x3ef581[_0x4d6776(0xf4)][_0x4d6776(0xdc)]()][_0x4d6776(0xbc)]('\x20')));}):_0x3dbff2(_0x44fc42[_0x481579(0xd2)](0x1f5,'Channel\x20doesn\x27t\x20exist'));});},'VoiceQueuesChannelRedirect':function(_0x263600){const _0xeef51c=this;return new Promise(function(_0x3a183e,_0x39f048){const _0x4a33d6=a1301_0x23db;if(ami['isConnected']()==![])return _0x39f048(_0xeef51c[_0x4a33d6(0xd2)](0x1f4,[config[_0x4a33d6(0xd0)]['ip'],config['asterisk']['username'],_0x4a33d6(0x101)]['join']('\x20')));const _0x422c7e=schema(properties['voicequeuechannelredirect'])[_0x4a33d6(0xff)](_0x263600);if(_0x422c7e[_0x4a33d6(0xde)]>0x0)return _0x39f048(_0xeef51c[_0x4a33d6(0xd2)](0x1f4,_[_0x4a33d6(0xc6)](_0x422c7e,'message')['join'](',\x20')));const _0x1ecf1f=_[_0x4a33d6(0x94)](_0x2b01b4[_0x4a33d6(0xe1)],{'uniqueid':_0x263600[_0x4a33d6(0xb8)]});return _0x1ecf1f&&_0x1ecf1f[_0x4a33d6(0xe9)]?ami[_0x4a33d6(0xea)]({'action':'Redirect','channel':_0x1ecf1f[_0x4a33d6(0xe9)],'exten':_0x263600[_0x4a33d6(0xf2)],'context':_0x263600['context']||_0x1ecf1f[_0x4a33d6(0xd8)],'priority':0x1})[_0x4a33d6(0xf3)](function(_0x6ffddb){const _0x4b337e=_0x4a33d6;_0x3a183e({'code':0xc8,'message':[_0x263600[_0x4b337e(0xb8)],_0x6ffddb[_0x4b337e(0xf4)][_0x4b337e(0xdc)]()][_0x4b337e(0xbc)]('\x20')});})[_0x4a33d6(0xe6)](function(_0x40376a){const _0x21642a=_0x4a33d6;_0x39f048(_0xeef51c['error'](0x1f5,[_0x263600['uniqueid'],_0x40376a[_0x21642a(0xf4)]['toLowerCase']()]['join']('\x20')));}):_0x39f048(_0xeef51c[_0x4a33d6(0xd2)](0x1f5,'Channel\x20doesn\x27t\x20exist'));});},'Agents':function(){return new Promise(function(_0x50b374){const _0x3a6893=a1301_0x23db,_0x34de83=_[_0x3a6893(0x9b)](_0x2b01b4[_0x3a6893(0x99)]);_0x50b374({'count':_0x34de83[_0x3a6893(0xde)],'rows':_0x34de83});});},'Telephones':function(){return new Promise(function(_0x33b31c){const _0x27162a=_['values'](_0x2b01b4['telephones']);_0x33b31c({'count':_0x27162a['length'],'rows':_0x27162a});});},'Trunks':function(){return new Promise(function(_0x40e403){const _0x51b2a1=a1301_0x23db,_0x524387=_[_0x51b2a1(0x9b)](_0x2b01b4[_0x51b2a1(0xb0)]);_0x40e403({'count':_0x524387['length'],'rows':_0x524387});});},'OutboundChannels':function(){return new Promise(function(_0x1d0cec){const _0x1dc9b9=a1301_0x23db,_0x53bdf6=_[_0x1dc9b9(0x9b)](_0x2b01b4[_0x1dc9b9(0xf6)]);_0x1d0cec({'count':_0x53bdf6[_0x1dc9b9(0xde)],'rows':_0x53bdf6});});},'Outbound':function(){return new Promise(function(_0x2a3aab){const _0x190d50=a1301_0x23db;_0x2a3aab(_0x2b01b4[_0x190d50(0x102)]);});},'Campaigns':function(){return new Promise(function(_0x375284){const _0xc718e5=a1301_0x23db,_0x37c4e3=_[_0xc718e5(0x9b)](_0x2b01b4[_0xc718e5(0x107)]);_0x375284({'count':_0x37c4e3['length'],'rows':_0x37c4e3});});},'VoiceQueuesPreview':function(_0x292d7b){const _0x214fb4=this;return new Promise(function(_0x6b2434,_0x5653e8){const _0x154eef=a1301_0x23db;_0xa83ab['run'](_0x292d7b['id'])[_0x154eef(0xf3)](function(_0x1448dd){const _0x4a3a47=_0x154eef;_0x6b2434({'code':0xc8,'message':_0x1448dd[_0x4a3a47(0xf4)]});})['catch'](function(_0x5a085a){const _0x31a40c=_0x154eef;_0x5653e8(_0x214fb4[_0x31a40c(0xd2)](0x1f4,_0x5a085a['message']));});});},'EventManager':function(_0x322b77){const _0xc07c82=this;return new Promise(function(_0x179f07,_0x4a96c6){const _0x1b8c8c=a1301_0x23db;if(!_0x322b77[_0x1b8c8c(0xa0)])return _0x4a96c6(_0xc07c82[_0x1b8c8c(0xd2)](0x1f4,_0x1b8c8c(0x97)));ami[_0x1b8c8c(0xfb)](_0x1b8c8c(0xc4)+_0x322b77[_0x1b8c8c(0xa0)],_0x322b77[_0x1b8c8c(0xf4)]),_0x179f07({'code':0xc8,'message':_0x322b77});});},'FaxAccounts':function(){return new Promise(function(_0x527090){const _0x964d70=_['values'](_0x2b01b4['faxAccounts']);_0x527090({'count':_0x964d70['length'],'rows':_0x964d70});});},'SendFax':function(_0x370b97){const _0x11fa25=this;return new Promise(function(_0x208f6d,_0x274d52){const _0x56e84f=a1301_0x23db;_0x551a6d[_0x56e84f(0xbe)](_0x370b97)[_0x56e84f(0xf3)](function(_0x30093e){const _0x1500f7=_0x56e84f;_0x208f6d({'code':0xc8,'message':_0x30093e[_0x1500f7(0xf4)]});})['catch'](function(_0x21f96f){const _0x2fc71c=_0x56e84f;_0x274d52(_0x11fa25[_0x2fc71c(0xd2)](0x1f4,_0x21f96f[_0x2fc71c(0xf4)]));});});},'CheckAfterSend':function(_0x138927){const _0x12c4d0=this;return new Promise(function(_0x26a73b,_0x4122b0){const _0x55651a=a1301_0x23db;_0x551a6d['checkAfterSend'](_0x138927)[_0x55651a(0xf3)](function(_0xa33c9d){const _0x5494f6=_0x55651a;_0x26a73b({'code':0xc8,'message':_0xa33c9d[_0x5494f6(0xf4)]});})[_0x55651a(0xe6)](function(_0x432403){const _0x4b0029=_0x55651a;_0x4122b0(_0x12c4d0[_0x4b0029(0xd2)](0x1f4,_0x432403[_0x4b0029(0xf4)]));});});}},_0x18750b=jayson[_0x3dfb41(0xfc)](_0x5da8b8)[_0x3dfb41(0xe3)]();_0x18750b['on'](_0x3dfb41(0xd2),function(_0x288d28){return _0x16a711(_0x288d28);}),_0x18750b['listen'](0x232a,_0x3dfb41(0xcc),function(){const _0x1f65a4=_0x3dfb41;return console['log'](_0x1f65a4(0x104),0x232a),_0x3087b5(_0x1f65a4(0x9c)+0x232a);});});};