Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / services / ami / server / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x7788=['pick','command','Action','content','voiceQueues','hasOwnProperty','answered','available','loggedIn','sumBillable','sumHoldTime','talking','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','find','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','values','voicequeuechannel','voicequeuechannelhangup','queueChannels','Hangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','custom:','faxAccounts','server','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','ami\x20disconnected','join','keys','module','action','Reload','then','message','catch','error','username'];(function(_0x49e489,_0x2fda2c){var _0x471e69=function(_0x2d64b2){while(--_0x2d64b2){_0x49e489['push'](_0x49e489['shift']());}};_0x471e69(++_0x2fda2c);}(_0x7788,0x17e));var _0x8778=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0x7788[_0x2bc3f4];return _0x14ac53;};'use strict';var _=require(_0x8778('0x0'));var util=require(_0x8778('0x1'));var jayson=require('jayson/promise');var schema=require(_0x8778('0x2'));var BPromise=require(_0x8778('0x3'));var moment=require(_0x8778('0x4'));var config=require(_0x8778('0x5'));var properties=require(_0x8778('0x6'));var ami=require(_0x8778('0x7'));exports[_0x8778('0x8')]=function(_0x5efed1,_0x39e7bd,_0x588f62){return new BPromise(function(_0x2a58c2,_0x19d1c5){var _0x6796d7={'QueuePause':function(_0x35b27e){return new Promise(function(_0x5c660c,_0x5a5d8d){var _0x1566a1=util[_0x8778('0x9')](_0x8778('0xa'),'SIP',_0x35b27e[_0x8778('0xb')]);if(_0x5efed1[_0x8778('0xc')]&&_0x5efed1[_0x8778('0xc')][_0x1566a1]&&_0x5efed1['timers'][_0x1566a1][_0x8778('0xd')]){_0x5efed1[_0x8778('0xc')][_0x1566a1][_0x8778('0xe')]();}if(_0x5efed1[_0x8778('0xf')][_0x1566a1]){_0x5efed1[_0x8778('0xf')][_0x1566a1][_0x8778('0x10')]({'statePause':_0x35b27e[_0x8778('0x11')]?!![]:![]});}_0x5c660c({'code':0xc8,'message':_0x8778('0x12')});});},'Reload':function(_0x197a0b){var _0x4cd38c=this;return new Promise(function(_0x513dbd,_0x2bfae6){if(ami[_0x8778('0x13')]()==![]){return _0x2bfae6(_0x4cd38c['error'](0x1f4,[config[_0x8778('0x14')]['ip'],config[_0x8778('0x14')]['username'],_0x8778('0x15')][_0x8778('0x16')]('\x20')));}_0x197a0b=_['pick'](_0x197a0b,_[_0x8778('0x17')](properties[_0x8778('0x18')]));_0x197a0b[_0x8778('0x19')]=_0x8778('0x1a');return ami['Action'](_0x197a0b)[_0x8778('0x1b')](function(_0x5cf399){_0x513dbd({'code':0xc8,'message':_0x5cf399[_0x8778('0x1c')]});})[_0x8778('0x1d')](function(_0x112989){_0x2bfae6(_0x4cd38c[_0x8778('0x1e')](0x1f5,_0x112989[_0x8778('0x1c')]));});});},'Command':function(_0x7eb9d0){var _0x4c78ba=this;return new Promise(function(_0xb7e79e,_0x381417){if(ami[_0x8778('0x13')]()==![]){return _0x381417(_0x4c78ba[_0x8778('0x1e')](0x1f4,[config[_0x8778('0x14')]['ip'],config['asterisk'][_0x8778('0x1f')],_0x8778('0x15')][_0x8778('0x16')]('\x20')));}_0x7eb9d0=_[_0x8778('0x20')](_0x7eb9d0,_0x8778('0x21'));_0x7eb9d0[_0x8778('0x19')]='Command';return ami[_0x8778('0x22')](_0x7eb9d0)[_0x8778('0x1b')](function(_0x1259aa){_0xb7e79e({'code':0xc8,'message':_0x1259aa[_0x8778('0x23')]});})[_0x8778('0x1d')](function(_0x2c3dca){_0x381417(_0x4c78ba[_0x8778('0x1e')](0x1f5,_0x2c3dca['message']));});});},'VoiceQueues':function(_0x4ed8ad){return new Promise(function(_0x16b793,_0x461fa6){var _0x5214f3=[];for(var _0x5841ff in _0x5efed1[_0x8778('0x24')]){if(_0x5efed1[_0x8778('0x24')][_0x8778('0x25')](_0x5841ff)){var _0x19cbc4=_0x5efed1[_0x8778('0x24')][_0x5841ff];var _0x4d68e6={'id':_0x19cbc4['id'],'name':_0x19cbc4[_0x8778('0xb')],'strategy':_0x19cbc4['strategy'],'answered':_0x19cbc4[_0x8778('0x26')],'available':_0x19cbc4[_0x8778('0x27')],'loggedIn':_0x19cbc4[_0x8778('0x28')],'pTalking':_0x19cbc4['pTalking'],'sumBillable':_0x19cbc4[_0x8778('0x29')],'sumDuration':_0x19cbc4['sumDuration'],'sumHoldTime':_0x19cbc4[_0x8778('0x2a')]||0x0,'talking':_0x19cbc4[_0x8778('0x2b')],'total':_0x19cbc4['total'],'type':_0x19cbc4[_0x8778('0x2c')],'unmanaged':_0x19cbc4[_0x8778('0x2d')],'abandoned':_0x19cbc4['abandoned'],'waiting':_0x19cbc4[_0x8778('0x2e')],'loggedInDb':_0x19cbc4[_0x8778('0x2f')]};if(_0x19cbc4[_0x8778('0x2c')]===_0x8778('0x30')){_0x4d68e6['dialActive']=_0x19cbc4[_0x8778('0x31')];_0x4d68e6[_0x8778('0x32')]=_0x19cbc4[_0x8778('0x32')];_0x4d68e6[_0x8778('0x33')]=_0x19cbc4['dialOriginateCallerIdName'];_0x4d68e6[_0x8778('0x34')]=_0x19cbc4[_0x8778('0x34')];_0x4d68e6['dialOriginateTimeout']=_0x19cbc4[_0x8778('0x35')];_0x4d68e6[_0x8778('0x36')]=_0x19cbc4[_0x8778('0x36')];_0x4d68e6['outboundAnswerAgiCallsDay']=_0x19cbc4[_0x8778('0x37')];_0x4d68e6[_0x8778('0x38')]=_0x19cbc4[_0x8778('0x38')];_0x4d68e6[_0x8778('0x39')]=_0x19cbc4[_0x8778('0x39')];_0x4d68e6[_0x8778('0x3a')]=_0x19cbc4['outboundBusyCallsDay'];_0x4d68e6[_0x8778('0x3b')]=_0x19cbc4[_0x8778('0x3b')];_0x4d68e6['outboundDropCallsDayACS']=_0x19cbc4[_0x8778('0x3c')];_0x4d68e6[_0x8778('0x3d')]=_0x19cbc4[_0x8778('0x3d')];_0x4d68e6['outboundDropCallsDayTimeout']=_0x19cbc4[_0x8778('0x3e')];_0x4d68e6[_0x8778('0x3f')]=_0x19cbc4[_0x8778('0x3f')];_0x4d68e6[_0x8778('0x40')]=_0x19cbc4[_0x8778('0x40')];_0x4d68e6[_0x8778('0x41')]=_0x19cbc4[_0x8778('0x41')];_0x4d68e6[_0x8778('0x42')]=_0x19cbc4[_0x8778('0x42')];_0x4d68e6[_0x8778('0x43')]=_0x19cbc4[_0x8778('0x43')];_0x4d68e6[_0x8778('0x44')]=_0x19cbc4[_0x8778('0x44')];_0x4d68e6[_0x8778('0x45')]=_0x19cbc4[_0x8778('0x45')];_0x4d68e6[_0x8778('0x46')]=_0x19cbc4[_0x8778('0x46')];_0x4d68e6[_0x8778('0x47')]=_0x19cbc4[_0x8778('0x47')];_0x4d68e6['predictiveIntervalDroppedCallsCallersExit']=_0x19cbc4[_0x8778('0x48')];_0x4d68e6[_0x8778('0x49')]=_0x19cbc4[_0x8778('0x49')];_0x4d68e6[_0x8778('0x4a')]=_0x19cbc4['predictiveIntervalErlangCalls'];_0x4d68e6[_0x8778('0x4b')]=_0x19cbc4[_0x8778('0x4b')];_0x4d68e6[_0x8778('0x4c')]=_0x19cbc4[_0x8778('0x4c')];_0x4d68e6[_0x8778('0x4d')]=_0x19cbc4[_0x8778('0x4d')];_0x4d68e6[_0x8778('0x4e')]=_0x19cbc4['predictiveIntervalPauses'];_0x4d68e6[_0x8778('0x4f')]=_0x19cbc4[_0x8778('0x4f')];_0x4d68e6[_0x8778('0x50')]=_0x19cbc4[_0x8778('0x50')];_0x4d68e6[_0x8778('0x1c')]=_0x19cbc4[_0x8778('0x1c')];_0x4d68e6['originated']=_0x19cbc4['originated'];_0x4d68e6[_0x8778('0x51')]=_0x19cbc4[_0x8778('0x51')];_0x4d68e6[_0x8778('0x52')]=_0x19cbc4[_0x8778('0x52')];_0x4d68e6[_0x8778('0x53')]=_0x19cbc4[_0x8778('0x53')];_0x4d68e6[_0x8778('0x54')]=_0x19cbc4[_0x8778('0x54')];_0x4d68e6[_0x8778('0x55')]=_0x19cbc4[_0x8778('0x55')];_0x4d68e6[_0x8778('0x56')]=_0x19cbc4['startProgressive'];}if(_0x19cbc4[_0x8778('0x57')]){_0x4d68e6[_0x8778('0x57')]={'id':_0x19cbc4[_0x8778('0x57')]['id'],'name':_0x19cbc4[_0x8778('0x57')][_0x8778('0xb')],'active':_0x19cbc4[_0x8778('0x57')][_0x8778('0x58')],'callerid':_0x19cbc4[_0x8778('0x57')][_0x8778('0x59')]};}if(_0x19cbc4['Interval']){_0x4d68e6[_0x8778('0x5a')]={'id':_0x19cbc4[_0x8778('0x5a')]['id'],'name':_0x19cbc4[_0x8778('0x5a')][_0x8778('0xb')]};}_0x5214f3[_0x8778('0x5b')](_0x4d68e6);}}_0x16b793({'count':_0x5214f3[_0x8778('0x5c')],'rows':_0x5214f3});});},'VoiceChannels':function(_0x255c5b){return new Promise(function(_0x52c329,_0x4a3ef5){var _0x4e2d93=_['values'](_0x5efed1[_0x8778('0x5d')]);_0x52c329({'count':_0x4e2d93[_0x8778('0x5c')],'rows':_0x4e2d93});});},'VoiceChannelMixMonitor':function(_0x308312){var _0x5a8698=this;return new Promise(function(_0x5619d6,_0x46df3d){if(ami['isConnected']()==![]){return _0x46df3d(_0x5a8698[_0x8778('0x1e')](0x1f4,[config[_0x8778('0x14')]['ip'],config[_0x8778('0x14')][_0x8778('0x1f')],_0x8778('0x15')]['join']('\x20')));}var _0x4aff5e=schema(properties[_0x8778('0x5e')])[_0x8778('0x2')](_0x308312);if(_0x4aff5e['length']>0x0){return _0x46df3d(_0x5a8698[_0x8778('0x1e')](0x1f4,_[_0x8778('0x5f')](_0x4aff5e,_0x8778('0x1c'))[_0x8778('0x16')](',\x20')));}var _0x503c17=_['find'](_0x5efed1['channels'],{'uniqueid':_0x308312[_0x8778('0x60')]});if(_0x503c17&&_0x503c17[_0x8778('0x61')]){var _0x2c9c5a=util['format'](_0x8778('0x62'),_0x308312[_0x8778('0x63')]||_0x308312[_0x8778('0x60')],_0x308312[_0x8778('0x9')]||_0x8778('0x64'));return ami[_0x8778('0x22')]({'action':_0x8778('0x65'),'channel':_0x503c17[_0x8778('0x61')],'file':_0x2c9c5a,'options':_0x8778('0x66')})[_0x8778('0x1b')](function(_0x3fa5fa){var _0x31242c=_['find'](_0x503c17[_0x8778('0x67')],{'filename':_0x8778('0x68')+_0x2c9c5a[_0x8778('0x69')]()});if(_[_0x8778('0x6a')](_0x31242c)){_0x503c17[_0x8778('0x67')][_0x8778('0x5b')]({'filename':_0x8778('0x68')+_0x2c9c5a[_0x8778('0x69')](),'createdAt':moment()[_0x8778('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x3fa5fa[_0x8778('0x6b')],'status':_0x8778('0x6c')});}else{_0x31242c['mixmonitorid']=_0x3fa5fa['mixmonitorid'];_0x31242c[_0x8778('0x6d')]=_0x8778('0x6c');}_0x5619d6({'code':0xc8,'message':[_0x308312[_0x8778('0x60')],_0x8778('0x6e'),_0x3fa5fa[_0x8778('0x6b')]][_0x8778('0x16')]('\x20'),'mixmonitorid':_0x3fa5fa[_0x8778('0x6b')]});})['catch'](function(_0x13ccc2){_0x46df3d(_0x5a8698[_0x8778('0x1e')](0x1f5,[_0x308312['uniqueid'],_0x13ccc2[_0x8778('0x1c')][_0x8778('0x69')]()][_0x8778('0x16')]('\x20')));});}else{return _0x46df3d(_0x5a8698[_0x8778('0x1e')](0x1f5,_0x8778('0x6f')));}});},'VoiceChannelStopMixMonitor':function(_0x530f45){var _0x2189cd=this;return new Promise(function(_0x189fd4,_0x485ba2){if(ami[_0x8778('0x13')]()==![]){return _0x485ba2(_0x2189cd[_0x8778('0x1e')](0x1f4,[config['asterisk']['ip'],config[_0x8778('0x14')]['username'],_0x8778('0x15')][_0x8778('0x16')]('\x20')));}var _0x111024=schema(properties[_0x8778('0x5e')])[_0x8778('0x2')](_0x530f45);if(_0x111024[_0x8778('0x5c')]>0x0){return _0x485ba2(_0x2189cd[_0x8778('0x1e')](0x1f4,_[_0x8778('0x5f')](_0x111024,'message')[_0x8778('0x16')](',\x20')));}var _0x3d009e=_[_0x8778('0x70')](_0x5efed1[_0x8778('0x5d')],{'uniqueid':_0x530f45[_0x8778('0x60')]});if(_0x3d009e){return BPromise[_0x8778('0x71')]()[_0x8778('0x1b')](function(){if(_0x3d009e[_0x8778('0x61')]){return ami[_0x8778('0x22')]({'action':_0x8778('0x72'),'channel':_0x3d009e[_0x8778('0x61')],'mixmonitorid':_0x530f45[_0x8778('0x6b')]})['catch'](function(_0x415456){});}})['then'](function(){if(_0x3d009e[_0x8778('0x73')]){return ami['Action']({'action':_0x8778('0x72'),'channel':_0x3d009e[_0x8778('0x73')],'mixmonitorid':_0x530f45[_0x8778('0x6b')]})['catch'](function(_0x3f3c77){});}})['then'](function(_0x681eed){var _0x3cce7f=_[_0x8778('0x70')](_0x3d009e[_0x8778('0x67')],{'mixmonitorid':_0x530f45[_0x8778('0x6b')]});if(_0x3cce7f){_0x3cce7f['status']=_0x8778('0x74');}})['then'](function(){var _0x119bbf=util[_0x8778('0x9')]('%s.%s',_0x530f45[_0x8778('0x63')]||_0x530f45['uniqueid'],_0x530f45['format']||_0x8778('0x64'));var _0x123d52=_['find'](_0x3d009e[_0x8778('0x67')],{'filename':_0x8778('0x68')+_0x119bbf['toLowerCase']()});if(_0x123d52){_0x123d52[_0x8778('0x6d')]=_0x8778('0x74');}})[_0x8778('0x1b')](function(){_0x189fd4({'code':0xc8,'message':[_0x530f45['uniqueid'],_0x8778('0x75')]['join']('\x20')});})[_0x8778('0x1d')](function(_0x4a3788){_0x485ba2(_0x2189cd['error'](0x1f5,[_0x530f45[_0x8778('0x60')],_0x4a3788[_0x8778('0x1c')][_0x8778('0x69')]()]['join']('\x20')));});}else{return _0x485ba2(_0x2189cd[_0x8778('0x1e')](0x1f5,_0x8778('0x6f')));}});},'VoiceQueuesChannels':function(_0x15ebce){return new Promise(function(_0x45fbd2,_0x50b19c){var _0x2d92c6=_[_0x8778('0x76')](_0x5efed1['queueChannels']);_0x45fbd2({'count':_0x2d92c6[_0x8778('0x5c')],'rows':_0x2d92c6});});},'VoiceQueuesChannel':function(_0x4866d5){var _0x6e241b=this;return new Promise(function(_0x585d66,_0x3cda32){var _0x35f7d0=schema(properties[_0x8778('0x77')])['validate'](_0x4866d5);if(_0x35f7d0[_0x8778('0x5c')]>0x0){return _0x3cda32(_0x6e241b[_0x8778('0x1e')](0x1f4,_[_0x8778('0x5f')](_0x35f7d0,_0x8778('0x1c'))[_0x8778('0x16')](',\x20')));}var _0x41c610=_[_0x8778('0x70')](_0x5efed1['queueChannels'],{'uniqueid':_0x4866d5[_0x8778('0x60')]});if(_0x41c610){_0x585d66(_0x41c610);}else{return _0x3cda32(_0x6e241b[_0x8778('0x1e')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x675b4f){var _0x310e34=this;return new Promise(function(_0x45e200,_0x536ee9){if(ami['isConnected']()==![]){return _0x536ee9(_0x310e34[_0x8778('0x1e')](0x1f4,[config[_0x8778('0x14')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x8778('0x16')]('\x20')));}var _0x1e3da2=schema(properties[_0x8778('0x78')])[_0x8778('0x2')](_0x675b4f);if(_0x1e3da2[_0x8778('0x5c')]>0x0){return _0x536ee9(_0x310e34[_0x8778('0x1e')](0x1f4,_[_0x8778('0x5f')](_0x1e3da2,_0x8778('0x1c'))['join'](',\x20')));}var _0x1acc21=_[_0x8778('0x70')](_0x5efed1[_0x8778('0x79')],{'uniqueid':_0x675b4f['uniqueid']});if(_0x1acc21&&_0x1acc21[_0x8778('0x61')]){return ami[_0x8778('0x22')]({'action':_0x8778('0x7a'),'channel':_0x1acc21[_0x8778('0x61')]})['then'](function(_0x4fdb09){_0x45e200({'code':0xc8,'message':[_0x675b4f[_0x8778('0x60')],_0x4fdb09[_0x8778('0x1c')][_0x8778('0x69')]()][_0x8778('0x16')]('\x20')});})[_0x8778('0x1d')](function(_0x568cce){_0x536ee9(_0x310e34[_0x8778('0x1e')](0x1f5,[_0x675b4f['uniqueid'],_0x568cce[_0x8778('0x1c')][_0x8778('0x69')]()]['join']('\x20')));});}else{return _0x536ee9(_0x310e34[_0x8778('0x1e')](0x1f5,_0x8778('0x6f')));}});},'VoiceQueuesChannelRedirect':function(_0xa17b3){var _0x22062f=this;return new Promise(function(_0x483a17,_0x2ad0f3){if(ami[_0x8778('0x13')]()==![]){return _0x2ad0f3(_0x22062f['error'](0x1f4,[config[_0x8778('0x14')]['ip'],config[_0x8778('0x14')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x43cd23=schema(properties[_0x8778('0x7b')])['validate'](_0xa17b3);if(_0x43cd23['length']>0x0){return _0x2ad0f3(_0x22062f['error'](0x1f4,_['map'](_0x43cd23,_0x8778('0x1c'))[_0x8778('0x16')](',\x20')));}var _0x1f5e63=_['find'](_0x5efed1['queueChannels'],{'uniqueid':_0xa17b3['uniqueid']});if(_0x1f5e63&&_0x1f5e63[_0x8778('0x61')]){return ami['Action']({'action':_0x8778('0x7c'),'channel':_0x1f5e63[_0x8778('0x61')],'exten':_0xa17b3['exten'],'context':_0xa17b3[_0x8778('0x7d')]||_0x1f5e63[_0x8778('0x7d')],'priority':0x1})[_0x8778('0x1b')](function(_0x5b76e2){_0x483a17({'code':0xc8,'message':[_0xa17b3[_0x8778('0x60')],_0x5b76e2['message'][_0x8778('0x69')]()][_0x8778('0x16')]('\x20')});})[_0x8778('0x1d')](function(_0x1236a3){_0x2ad0f3(_0x22062f[_0x8778('0x1e')](0x1f5,[_0xa17b3[_0x8778('0x60')],_0x1236a3[_0x8778('0x1c')]['toLowerCase']()][_0x8778('0x16')]('\x20')));});}else{return _0x2ad0f3(_0x22062f['error'](0x1f5,_0x8778('0x6f')));}});},'Agents':function(_0x27b446){return new Promise(function(_0x3b2fa0,_0x4819a1){var _0x4a7d6d=_[_0x8778('0x76')](_0x5efed1[_0x8778('0xf')]);_0x3b2fa0({'count':_0x4a7d6d[_0x8778('0x5c')],'rows':_0x4a7d6d});});},'Telephones':function(_0x2a8c6d){return new Promise(function(_0x28f0f8,_0x4dbb53){var _0x974346=_[_0x8778('0x76')](_0x5efed1[_0x8778('0x7e')]);_0x28f0f8({'count':_0x974346[_0x8778('0x5c')],'rows':_0x974346});});},'Trunks':function(_0x4673d3){return new Promise(function(_0x32a8be,_0x5a81aa){var _0x469780=_[_0x8778('0x76')](_0x5efed1[_0x8778('0x7f')]);_0x32a8be({'count':_0x469780[_0x8778('0x5c')],'rows':_0x469780});});},'OutboundChannels':function(_0x543f0b){return new Promise(function(_0x560e53,_0x533668){var _0x385166=_[_0x8778('0x76')](_0x5efed1[_0x8778('0x80')]);_0x560e53({'count':_0x385166[_0x8778('0x5c')],'rows':_0x385166});});},'Outbound':function(_0x3e3eb7){return new Promise(function(_0x1399e3,_0x58e7c6){_0x1399e3(_0x5efed1[_0x8778('0x30')]);});},'Campaigns':function(_0xab8287){return new Promise(function(_0x48c095,_0x1f1641){var _0x28b7c7=_[_0x8778('0x76')](_0x5efed1[_0x8778('0x81')]);_0x48c095({'count':_0x28b7c7['length'],'rows':_0x28b7c7});});},'VoiceQueuesPreview':function(_0x241151){var _0x2047c6=this;return new Promise(function(_0x704db,_0x5b9e3a){_0x39e7bd['run'](_0x241151['id'])['then'](function(_0x26a74e){_0x704db({'code':0xc8,'message':_0x26a74e[_0x8778('0x1c')]});})[_0x8778('0x1d')](function(_0x2c1ca9){_0x5b9e3a(_0x2047c6[_0x8778('0x1e')](0x1f4,_0x2c1ca9[_0x8778('0x1c')]));});});},'EventManager':function(_0x210c65){var _0x3a2080=this;return new Promise(function(_0x5e536b,_0x329e5d){if(!_0x210c65[_0x8778('0x82')]){return _0x329e5d(_0x3a2080['error'](0x1f4,_0x8778('0x83')));}ami['emit'](_0x8778('0x84')+_0x210c65['event'],_0x210c65[_0x8778('0x1c')]);_0x5e536b({'code':0xc8,'message':_0x210c65});});},'FaxAccounts':function(_0x3b101a){return new Promise(function(_0x3e7d36,_0x6edb4c){var _0x3edbbe=_[_0x8778('0x76')](_0x5efed1[_0x8778('0x85')]);_0x3e7d36({'count':_0x3edbbe[_0x8778('0x5c')],'rows':_0x3edbbe});});},'SendFax':function(_0x9fad15){var _0xc84293=this;return new Promise(function(_0x142b86,_0xdb02d){_0x588f62['send'](_0x9fad15)[_0x8778('0x1b')](function(_0x2a860c){_0x142b86({'code':0xc8,'message':_0x2a860c[_0x8778('0x1c')]});})[_0x8778('0x1d')](function(_0xc54ff3){_0xdb02d(_0xc84293[_0x8778('0x1e')](0x1f4,_0xc54ff3[_0x8778('0x1c')]));});});},'CheckAfterSend':function(_0x5815a0){var _0x51da65=this;return new Promise(function(_0x59c604,_0xda370e){_0x588f62['checkAfterSend'](_0x5815a0)[_0x8778('0x1b')](function(_0x4fd5e3){_0x59c604({'code':0xc8,'message':_0x4fd5e3['message']});})['catch'](function(_0x40937e){_0xda370e(_0x51da65['error'](0x1f4,_0x40937e['message']));});});}};var _0x41556c=jayson[_0x8778('0x86')](_0x6796d7)['http']();_0x41556c['on'](_0x8778('0x1e'),function(_0x1d6db7){return _0x19d1c5(_0x1d6db7);});_0x41556c[_0x8778('0x8')](0x232a,_0x8778('0x87'),function(){console['log'](_0x8778('0x88'),0x232a);return _0x2a58c2(_0x8778('0x89')+0x232a);});});};