Built motion from commit (unavailable).|2.3.92
[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 _0x856f=['predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','callerid','Interval','voicechannel','length','map','find','channels','uniqueid','filename','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','channel','destinationchannel','%s.%s','stop','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','outbound','campaigns','Event\x20name\x20mandatory','emit','event','faxAccounts','send','checkAfterSend','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','../../../config/environment','../properties','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','username','ami\x20disconnected','join','pick','keys','module','action','Action','message','catch','asterisk','command','Command','then','content','voiceQueues','hasOwnProperty','name','strategy','available','pTalking','sumBillable','sumHoldTime','talking','total','waiting','loggedInDb','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls'];(function(_0xb6f16e,_0x57f3d1){var _0x1cd0e9=function(_0x141d05){while(--_0x141d05){_0xb6f16e['push'](_0xb6f16e['shift']());}};_0x1cd0e9(++_0x57f3d1);}(_0x856f,0x1b7));var _0xf856=function(_0x53dcd7,_0xe89b37){_0x53dcd7=_0x53dcd7-0x0;var _0x2a1bb6=_0x856f[_0x53dcd7];return _0x2a1bb6;};'use strict';var _=require(_0xf856('0x0'));var util=require(_0xf856('0x1'));var jayson=require(_0xf856('0x2'));var schema=require(_0xf856('0x3'));var BPromise=require('bluebird');var moment=require('moment');var config=require(_0xf856('0x4'));var properties=require(_0xf856('0x5'));var ami=require('../ami');exports[_0xf856('0x6')]=function(_0x511557,_0x3c4335,_0x2e0e5a){return new BPromise(function(_0x27fcce,_0x1bf4c9){var _0x111c40={'QueuePause':function(_0x31dfd4){return new Promise(function(_0x3c605a,_0x190a47){var _0x81b206=util[_0xf856('0x7')](_0xf856('0x8'),_0xf856('0x9'),_0x31dfd4['name']);if(_0x511557[_0xf856('0xa')]&&_0x511557[_0xf856('0xa')][_0x81b206]&&_0x511557['timers'][_0x81b206][_0xf856('0xb')]){_0x511557[_0xf856('0xa')][_0x81b206][_0xf856('0xc')]();}if(_0x511557[_0xf856('0xd')][_0x81b206]){_0x511557[_0xf856('0xd')][_0x81b206][_0xf856('0xe')]({'statePause':_0x31dfd4[_0xf856('0xf')]?!![]:![]});}_0x3c605a({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0xa0acf0){var _0x3eb398=this;return new Promise(function(_0x212bc0,_0x1c5820){if(ami[_0xf856('0x10')]()==![]){return _0x1c5820(_0x3eb398[_0xf856('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xf856('0x12')],_0xf856('0x13')][_0xf856('0x14')]('\x20')));}_0xa0acf0=_[_0xf856('0x15')](_0xa0acf0,_[_0xf856('0x16')](properties[_0xf856('0x17')]));_0xa0acf0[_0xf856('0x18')]='Reload';return ami[_0xf856('0x19')](_0xa0acf0)['then'](function(_0x1e3b5b){_0x212bc0({'code':0xc8,'message':_0x1e3b5b[_0xf856('0x1a')]});})[_0xf856('0x1b')](function(_0x53fed4){_0x1c5820(_0x3eb398[_0xf856('0x11')](0x1f5,_0x53fed4[_0xf856('0x1a')]));});});},'Command':function(_0x220d23){var _0x4ef2a3=this;return new Promise(function(_0x43ac96,_0x5d9a21){if(ami['isConnected']()==![]){return _0x5d9a21(_0x4ef2a3[_0xf856('0x11')](0x1f4,[config[_0xf856('0x1c')]['ip'],config[_0xf856('0x1c')][_0xf856('0x12')],_0xf856('0x13')]['join']('\x20')));}_0x220d23=_[_0xf856('0x15')](_0x220d23,_0xf856('0x1d'));_0x220d23[_0xf856('0x18')]=_0xf856('0x1e');return ami[_0xf856('0x19')](_0x220d23)[_0xf856('0x1f')](function(_0x502ebd){_0x43ac96({'code':0xc8,'message':_0x502ebd[_0xf856('0x20')]});})[_0xf856('0x1b')](function(_0xb22b6a){_0x5d9a21(_0x4ef2a3[_0xf856('0x11')](0x1f5,_0xb22b6a[_0xf856('0x1a')]));});});},'VoiceQueues':function(_0x4e88cc){return new Promise(function(_0x58bb8e,_0x187abc){var _0x40d657=[];for(var _0x10f4c9 in _0x511557[_0xf856('0x21')]){if(_0x511557[_0xf856('0x21')][_0xf856('0x22')](_0x10f4c9)){var _0x1fb449=_0x511557[_0xf856('0x21')][_0x10f4c9];var _0x484cb6={'id':_0x1fb449['id'],'name':_0x1fb449[_0xf856('0x23')],'strategy':_0x1fb449[_0xf856('0x24')],'answered':_0x1fb449['answered'],'available':_0x1fb449[_0xf856('0x25')],'loggedIn':_0x1fb449['loggedIn'],'pTalking':_0x1fb449[_0xf856('0x26')],'sumBillable':_0x1fb449[_0xf856('0x27')],'sumDuration':_0x1fb449['sumDuration'],'sumHoldTime':_0x1fb449[_0xf856('0x28')]||0x0,'talking':_0x1fb449[_0xf856('0x29')],'total':_0x1fb449[_0xf856('0x2a')],'type':_0x1fb449['type'],'unmanaged':_0x1fb449['unmanaged'],'abandoned':_0x1fb449['abandoned'],'waiting':_0x1fb449[_0xf856('0x2b')],'loggedInDb':_0x1fb449[_0xf856('0x2c')]};if(_0x1fb449[_0xf856('0x2d')]==='outbound'){_0x484cb6['dialActive']=_0x1fb449[_0xf856('0x2e')];_0x484cb6[_0xf856('0x2f')]=_0x1fb449[_0xf856('0x2f')];_0x484cb6[_0xf856('0x30')]=_0x1fb449['dialOriginateCallerIdName'];_0x484cb6[_0xf856('0x31')]=_0x1fb449['dialOriginateCallerIdNumber'];_0x484cb6[_0xf856('0x32')]=_0x1fb449[_0xf856('0x32')];_0x484cb6[_0xf856('0x33')]=_0x1fb449['dialPrefix'];_0x484cb6[_0xf856('0x34')]=_0x1fb449['outboundAnswerAgiCallsDay'];_0x484cb6['outboundAnswerCallsDay']=_0x1fb449['outboundAnswerCallsDay'];_0x484cb6['outboundBlacklistCallsDay']=_0x1fb449[_0xf856('0x35')];_0x484cb6['outboundBusyCallsDay']=_0x1fb449[_0xf856('0x36')];_0x484cb6['outboundCongestionCallsDay']=_0x1fb449['outboundCongestionCallsDay'];_0x484cb6[_0xf856('0x37')]=_0x1fb449[_0xf856('0x37')];_0x484cb6[_0xf856('0x38')]=_0x1fb449[_0xf856('0x38')];_0x484cb6[_0xf856('0x39')]=_0x1fb449['outboundDropCallsDayTimeout'];_0x484cb6[_0xf856('0x3a')]=_0x1fb449[_0xf856('0x3a')];_0x484cb6[_0xf856('0x3b')]=_0x1fb449[_0xf856('0x3b')];_0x484cb6['outboundOriginateFailureCallsDay']=_0x1fb449['outboundOriginateFailureCallsDay'];_0x484cb6[_0xf856('0x3c')]=_0x1fb449[_0xf856('0x3c')];_0x484cb6[_0xf856('0x3d')]=_0x1fb449['outboundRejectCallsDay'];_0x484cb6[_0xf856('0x3e')]=_0x1fb449[_0xf856('0x3e')];_0x484cb6[_0xf856('0x3f')]=_0x1fb449[_0xf856('0x3f')];_0x484cb6['predictiveIntervalAvgHoldtime']=_0x1fb449[_0xf856('0x40')];_0x484cb6[_0xf856('0x41')]=_0x1fb449[_0xf856('0x41')];_0x484cb6[_0xf856('0x42')]=_0x1fb449['predictiveIntervalDroppedCallsCallersExit'];_0x484cb6[_0xf856('0x43')]=_0x1fb449[_0xf856('0x43')];_0x484cb6['predictiveIntervalErlangCalls']=_0x1fb449[_0xf856('0x44')];_0x484cb6[_0xf856('0x45')]=_0x1fb449['predictiveIntervalErlangCallsDroppedCalls'];_0x484cb6[_0xf856('0x46')]=_0x1fb449[_0xf856('0x46')];_0x484cb6[_0xf856('0x47')]=_0x1fb449[_0xf856('0x47')];_0x484cb6[_0xf856('0x48')]=_0x1fb449[_0xf856('0x48')];_0x484cb6[_0xf856('0x49')]=_0x1fb449[_0xf856('0x49')];_0x484cb6[_0xf856('0x4a')]=_0x1fb449[_0xf856('0x4a')];_0x484cb6['message']=_0x1fb449['message'];_0x484cb6[_0xf856('0x4b')]=_0x1fb449[_0xf856('0x4b')];}if(_0x1fb449['Trunk']){_0x484cb6[_0xf856('0x4c')]={'id':_0x1fb449[_0xf856('0x4c')]['id'],'name':_0x1fb449[_0xf856('0x4c')][_0xf856('0x23')],'active':_0x1fb449[_0xf856('0x4c')][_0xf856('0x4d')],'callerid':_0x1fb449[_0xf856('0x4c')][_0xf856('0x4e')]};}if(_0x1fb449[_0xf856('0x4f')]){_0x484cb6[_0xf856('0x4f')]={'id':_0x1fb449['Interval']['id'],'name':_0x1fb449['Interval'][_0xf856('0x23')]};}_0x40d657['push'](_0x484cb6);}}_0x58bb8e({'count':_0x40d657['length'],'rows':_0x40d657});});},'VoiceChannels':function(_0x230b85){return new Promise(function(_0x57ee83,_0x368e68){var _0x2772c9=_['values'](_0x511557['channels']);_0x57ee83({'count':_0x2772c9['length'],'rows':_0x2772c9});});},'VoiceChannelMixMonitor':function(_0x2ef5c5){var _0x5c3321=this;return new Promise(function(_0x232044,_0x18f57d){if(ami[_0xf856('0x10')]()==![]){return _0x18f57d(_0x5c3321[_0xf856('0x11')](0x1f4,[config[_0xf856('0x1c')]['ip'],config['asterisk'][_0xf856('0x12')],_0xf856('0x13')][_0xf856('0x14')]('\x20')));}var _0x3f595d=schema(properties[_0xf856('0x50')])[_0xf856('0x3')](_0x2ef5c5);if(_0x3f595d[_0xf856('0x51')]>0x0){return _0x18f57d(_0x5c3321[_0xf856('0x11')](0x1f4,_[_0xf856('0x52')](_0x3f595d,_0xf856('0x1a'))[_0xf856('0x14')](',\x20')));}var _0x4b2ce4=_[_0xf856('0x53')](_0x511557[_0xf856('0x54')],{'uniqueid':_0x2ef5c5[_0xf856('0x55')]});if(_0x4b2ce4&&_0x4b2ce4['channel']){var _0x45715e=util['format']('%s.%s',_0x2ef5c5[_0xf856('0x56')]||_0x2ef5c5['uniqueid'],_0x2ef5c5[_0xf856('0x7')]||'wav');return ami[_0xf856('0x19')]({'action':'MixMonitor','channel':_0x4b2ce4['channel'],'file':_0x45715e,'options':_0xf856('0x57')})[_0xf856('0x1f')](function(_0x3e07be){var _0x2c0bc7=_[_0xf856('0x53')](_0x4b2ce4[_0xf856('0x58')],{'filename':_0xf856('0x59')+_0x45715e[_0xf856('0x5a')]()});if(_[_0xf856('0x5b')](_0x2c0bc7)){_0x4b2ce4['monitors'][_0xf856('0x5c')]({'filename':_0xf856('0x59')+_0x45715e[_0xf856('0x5a')](),'createdAt':moment()[_0xf856('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x3e07be[_0xf856('0x5d')],'status':_0xf856('0x5e')});}else{_0x2c0bc7[_0xf856('0x5d')]=_0x3e07be[_0xf856('0x5d')];_0x2c0bc7[_0xf856('0x5f')]=_0xf856('0x5e');}_0x232044({'code':0xc8,'message':[_0x2ef5c5[_0xf856('0x55')],_0xf856('0x60'),_0x3e07be['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x3e07be[_0xf856('0x5d')]});})['catch'](function(_0x42b51f){_0x18f57d(_0x5c3321[_0xf856('0x11')](0x1f5,[_0x2ef5c5[_0xf856('0x55')],_0x42b51f[_0xf856('0x1a')][_0xf856('0x5a')]()][_0xf856('0x14')]('\x20')));});}else{return _0x18f57d(_0x5c3321[_0xf856('0x11')](0x1f5,_0xf856('0x61')));}});},'VoiceChannelStopMixMonitor':function(_0x5a594d){var _0x259c85=this;return new Promise(function(_0x350bb3,_0x29eed7){if(ami['isConnected']()==![]){return _0x29eed7(_0x259c85[_0xf856('0x11')](0x1f4,[config[_0xf856('0x1c')]['ip'],config[_0xf856('0x1c')][_0xf856('0x12')],_0xf856('0x13')][_0xf856('0x14')]('\x20')));}var _0xb57eb4=schema(properties[_0xf856('0x50')])[_0xf856('0x3')](_0x5a594d);if(_0xb57eb4[_0xf856('0x51')]>0x0){return _0x29eed7(_0x259c85[_0xf856('0x11')](0x1f4,_[_0xf856('0x52')](_0xb57eb4,_0xf856('0x1a'))['join'](',\x20')));}var _0x22299e=_[_0xf856('0x53')](_0x511557['channels'],{'uniqueid':_0x5a594d[_0xf856('0x55')]});if(_0x22299e){return BPromise['resolve']()[_0xf856('0x1f')](function(){if(_0x22299e['channel']){return ami[_0xf856('0x19')]({'action':_0xf856('0x62'),'channel':_0x22299e[_0xf856('0x63')],'mixmonitorid':_0x5a594d['mixmonitorid']})[_0xf856('0x1b')](function(_0x189f49){});}})[_0xf856('0x1f')](function(){if(_0x22299e[_0xf856('0x64')]){return ami[_0xf856('0x19')]({'action':'StopMixMonitor','channel':_0x22299e[_0xf856('0x64')],'mixmonitorid':_0x5a594d['mixmonitorid']})['catch'](function(_0x3049de){});}})['then'](function(_0x35edfe){var _0x24bf52=_['find'](_0x22299e[_0xf856('0x58')],{'mixmonitorid':_0x5a594d[_0xf856('0x5d')]});if(_0x24bf52){_0x24bf52[_0xf856('0x5f')]='stop';}})[_0xf856('0x1f')](function(){var _0x24e161=util['format'](_0xf856('0x65'),_0x5a594d[_0xf856('0x56')]||_0x5a594d['uniqueid'],_0x5a594d[_0xf856('0x7')]||'wav');var _0x25949a=_[_0xf856('0x53')](_0x22299e[_0xf856('0x58')],{'filename':'/var/spool/asterisk/monitor/'+_0x24e161[_0xf856('0x5a')]()});if(_0x25949a){_0x25949a[_0xf856('0x5f')]=_0xf856('0x66');}})['then'](function(){_0x350bb3({'code':0xc8,'message':[_0x5a594d[_0xf856('0x55')],'StopMixMonitor\x20Success'][_0xf856('0x14')]('\x20')});})[_0xf856('0x1b')](function(_0x31888c){_0x29eed7(_0x259c85[_0xf856('0x11')](0x1f5,[_0x5a594d[_0xf856('0x55')],_0x31888c[_0xf856('0x1a')]['toLowerCase']()][_0xf856('0x14')]('\x20')));});}else{return _0x29eed7(_0x259c85[_0xf856('0x11')](0x1f5,_0xf856('0x61')));}});},'VoiceQueuesChannels':function(_0x51df0c){return new Promise(function(_0x4a50ea,_0xaa656b){var _0x498c90=_[_0xf856('0x67')](_0x511557[_0xf856('0x68')]);_0x4a50ea({'count':_0x498c90[_0xf856('0x51')],'rows':_0x498c90});});},'VoiceQueuesChannel':function(_0x5d0d4a){var _0x3470d1=this;return new Promise(function(_0x21f940,_0x46886f){var _0x185ad2=schema(properties[_0xf856('0x69')])['validate'](_0x5d0d4a);if(_0x185ad2[_0xf856('0x51')]>0x0){return _0x46886f(_0x3470d1[_0xf856('0x11')](0x1f4,_[_0xf856('0x52')](_0x185ad2,_0xf856('0x1a'))[_0xf856('0x14')](',\x20')));}var _0x2e7da3=_[_0xf856('0x53')](_0x511557['queueChannels'],{'uniqueid':_0x5d0d4a['uniqueid']});if(_0x2e7da3){_0x21f940(_0x2e7da3);}else{return _0x46886f(_0x3470d1['error'](0x1f5,_0xf856('0x61')));}});},'VoiceQueuesChannelHangup':function(_0x3be9aa){var _0x5440c8=this;return new Promise(function(_0x3f6198,_0x2ce3e4){if(ami['isConnected']()==![]){return _0x2ce3e4(_0x5440c8[_0xf856('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xf856('0x1c')]['username'],_0xf856('0x13')][_0xf856('0x14')]('\x20')));}var _0x3782a3=schema(properties[_0xf856('0x6a')])[_0xf856('0x3')](_0x3be9aa);if(_0x3782a3[_0xf856('0x51')]>0x0){return _0x2ce3e4(_0x5440c8[_0xf856('0x11')](0x1f4,_['map'](_0x3782a3,'message')['join'](',\x20')));}var _0xaa43b1=_[_0xf856('0x53')](_0x511557[_0xf856('0x68')],{'uniqueid':_0x3be9aa[_0xf856('0x55')]});if(_0xaa43b1&&_0xaa43b1['channel']){return ami[_0xf856('0x19')]({'action':'Hangup','channel':_0xaa43b1['channel']})['then'](function(_0x137baf){_0x3f6198({'code':0xc8,'message':[_0x3be9aa[_0xf856('0x55')],_0x137baf[_0xf856('0x1a')]['toLowerCase']()]['join']('\x20')});})[_0xf856('0x1b')](function(_0x3f560a){_0x2ce3e4(_0x5440c8[_0xf856('0x11')](0x1f5,[_0x3be9aa[_0xf856('0x55')],_0x3f560a[_0xf856('0x1a')][_0xf856('0x5a')]()]['join']('\x20')));});}else{return _0x2ce3e4(_0x5440c8[_0xf856('0x11')](0x1f5,_0xf856('0x61')));}});},'VoiceQueuesChannelRedirect':function(_0x134bf9){var _0x3917a6=this;return new Promise(function(_0x14da74,_0x161b2b){if(ami[_0xf856('0x10')]()==![]){return _0x161b2b(_0x3917a6[_0xf856('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xf856('0x1c')][_0xf856('0x12')],'ami\x20disconnected'][_0xf856('0x14')]('\x20')));}var _0x5e6871=schema(properties[_0xf856('0x6b')])['validate'](_0x134bf9);if(_0x5e6871['length']>0x0){return _0x161b2b(_0x3917a6[_0xf856('0x11')](0x1f4,_[_0xf856('0x52')](_0x5e6871,_0xf856('0x1a'))[_0xf856('0x14')](',\x20')));}var _0xb0dca2=_['find'](_0x511557[_0xf856('0x68')],{'uniqueid':_0x134bf9[_0xf856('0x55')]});if(_0xb0dca2&&_0xb0dca2[_0xf856('0x63')]){return ami[_0xf856('0x19')]({'action':_0xf856('0x6c'),'channel':_0xb0dca2[_0xf856('0x63')],'exten':_0x134bf9[_0xf856('0x6d')],'context':_0x134bf9[_0xf856('0x6e')]||_0xb0dca2[_0xf856('0x6e')],'priority':0x1})['then'](function(_0x33683e){_0x14da74({'code':0xc8,'message':[_0x134bf9[_0xf856('0x55')],_0x33683e[_0xf856('0x1a')]['toLowerCase']()][_0xf856('0x14')]('\x20')});})[_0xf856('0x1b')](function(_0x5a45e5){_0x161b2b(_0x3917a6[_0xf856('0x11')](0x1f5,[_0x134bf9[_0xf856('0x55')],_0x5a45e5[_0xf856('0x1a')]['toLowerCase']()][_0xf856('0x14')]('\x20')));});}else{return _0x161b2b(_0x3917a6[_0xf856('0x11')](0x1f5,_0xf856('0x61')));}});},'Agents':function(_0x4fae49){return new Promise(function(_0x29b124,_0x2efd62){var _0x45b256=_['values'](_0x511557[_0xf856('0xd')]);_0x29b124({'count':_0x45b256['length'],'rows':_0x45b256});});},'Telephones':function(_0x295c89){return new Promise(function(_0x5b2c8f,_0x373c5f){var _0x24d622=_[_0xf856('0x67')](_0x511557[_0xf856('0x6f')]);_0x5b2c8f({'count':_0x24d622['length'],'rows':_0x24d622});});},'Trunks':function(_0x4b33b4){return new Promise(function(_0x18e6b9,_0xe863ff){var _0x581dfa=_[_0xf856('0x67')](_0x511557[_0xf856('0x70')]);_0x18e6b9({'count':_0x581dfa[_0xf856('0x51')],'rows':_0x581dfa});});},'OutboundChannels':function(_0x338a58){return new Promise(function(_0x52cb2f,_0x134e02){var _0x438749=_[_0xf856('0x67')](_0x511557[_0xf856('0x71')]);_0x52cb2f({'count':_0x438749[_0xf856('0x51')],'rows':_0x438749});});},'Outbound':function(_0x56c0f0){return new Promise(function(_0x5c6d15,_0x4155f1){_0x5c6d15(_0x511557[_0xf856('0x72')]);});},'Campaigns':function(_0x4f8c07){return new Promise(function(_0x2971bc,_0xda0f51){var _0x11de85=_[_0xf856('0x67')](_0x511557[_0xf856('0x73')]);_0x2971bc({'count':_0x11de85[_0xf856('0x51')],'rows':_0x11de85});});},'VoiceQueuesPreview':function(_0x38f80e){var _0x47fed4=this;return new Promise(function(_0x18027e,_0x503a61){_0x3c4335['run'](_0x38f80e['id'])['then'](function(_0x27f1b8){_0x18027e({'code':0xc8,'message':_0x27f1b8[_0xf856('0x1a')]});})[_0xf856('0x1b')](function(_0xb38e6b){_0x503a61(_0x47fed4['error'](0x1f4,_0xb38e6b['message']));});});},'EventManager':function(_0x24763e){var _0x59de88=this;return new Promise(function(_0x1b36b9,_0x20a8c2){if(!_0x24763e['event']){return _0x20a8c2(_0x59de88[_0xf856('0x11')](0x1f4,_0xf856('0x74')));}ami[_0xf856('0x75')]('custom:'+_0x24763e[_0xf856('0x76')],_0x24763e[_0xf856('0x1a')]);_0x1b36b9({'code':0xc8,'message':_0x24763e});});},'FaxAccounts':function(_0x4638ae){return new Promise(function(_0xa57adb,_0x5330ad){var _0x5861e1=_['values'](_0x511557[_0xf856('0x77')]);_0xa57adb({'count':_0x5861e1[_0xf856('0x51')],'rows':_0x5861e1});});},'SendFax':function(_0x49dc40){var _0x550026=this;return new Promise(function(_0x51cc16,_0x7b61fa){_0x2e0e5a[_0xf856('0x78')](_0x49dc40)[_0xf856('0x1f')](function(_0x2b664c){_0x51cc16({'code':0xc8,'message':_0x2b664c[_0xf856('0x1a')]});})[_0xf856('0x1b')](function(_0x1a82e7){_0x7b61fa(_0x550026[_0xf856('0x11')](0x1f4,_0x1a82e7[_0xf856('0x1a')]));});});},'CheckAfterSend':function(_0x1f8d52){var _0x11ccc0=this;return new Promise(function(_0x39a99b,_0x3c9c52){_0x2e0e5a[_0xf856('0x79')](_0x1f8d52)[_0xf856('0x1f')](function(_0xa93ab2){_0x39a99b({'code':0xc8,'message':_0xa93ab2['message']});})[_0xf856('0x1b')](function(_0x4f901f){_0x3c9c52(_0x11ccc0[_0xf856('0x11')](0x1f4,_0x4f901f[_0xf856('0x1a')]));});});}};var _0x791794=jayson[_0xf856('0x7a')](_0x111c40)['http']();_0x791794['on']('error',function(_0x380e47){return _0x1bf4c9(_0x380e47);});_0x791794[_0xf856('0x6')](0x232a,_0xf856('0x7b'),function(){console[_0xf856('0x7c')](_0xf856('0x7d'),0x232a);return _0x27fcce(_0xf856('0x7e')+0x232a);});});};