Built motion from commit (unavailable).|2.3.4
[motion2.git] / server / services / ami / server / index.js
index bf24495..b1fd231 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecfb=['RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','asterisk','username','ami\x20disconnected','pick','keys','then','message','error','isConnected','join','action','Command','Action','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','type','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','Interval','push','length','values','channels','map','find','channel','format','%s.%s','filename','uniqueid','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','catch','wav','stop','queueChannels','validate','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','event','emit','faxAccounts','checkAfterSend','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!'];(function(_0x51db32,_0x4647fc){var _0x5c779e=function(_0xaf46bb){while(--_0xaf46bb){_0x51db32['push'](_0x51db32['shift']());}};_0x5c779e(++_0x4647fc);}(_0xecfb,0x178));var _0xbecf=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0xecfb[_0x2cc8bb];return _0x140e40;};'use strict';var _=require(_0xbecf('0x0'));var util=require(_0xbecf('0x1'));var jayson=require(_0xbecf('0x2'));var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0xbecf('0x3'));var config=require(_0xbecf('0x4'));var properties=require(_0xbecf('0x5'));var ami=require(_0xbecf('0x6'));exports[_0xbecf('0x7')]=function(_0xf29afc,_0x5b11bf,_0x4a2d20){return new BPromise(function(_0x3f55c3,_0x30b58b){var _0x1633fd={'QueuePause':function(_0x4b8836){return new Promise(function(_0x210360,_0x5c1a0b){var _0x74a90b=util['format'](_0xbecf('0x8'),_0xbecf('0x9'),_0x4b8836[_0xbecf('0xa')]);if(_0xf29afc[_0xbecf('0xb')]&&_0xf29afc['timers'][_0x74a90b]&&_0xf29afc[_0xbecf('0xb')][_0x74a90b][_0xbecf('0xc')]){_0xf29afc[_0xbecf('0xb')][_0x74a90b][_0xbecf('0xd')]();}if(_0xf29afc[_0xbecf('0xe')][_0x74a90b]){_0xf29afc[_0xbecf('0xe')][_0x74a90b][_0xbecf('0xf')]({'statePause':_0x4b8836[_0xbecf('0x10')]?!![]:![]});}_0x210360({'code':0xc8,'message':_0xbecf('0x11')});});},'Reload':function(_0x2c0d28){var _0x52cc71=this;return new Promise(function(_0x5a7181,_0x2450c9){if(ami['isConnected']()==![]){return _0x2450c9(_0x52cc71['error'](0x1f4,[config[_0xbecf('0x12')]['ip'],config[_0xbecf('0x12')][_0xbecf('0x13')],_0xbecf('0x14')]['join']('\x20')));}_0x2c0d28=_[_0xbecf('0x15')](_0x2c0d28,_[_0xbecf('0x16')](properties['module']));_0x2c0d28['action']='Reload';return ami['Action'](_0x2c0d28)[_0xbecf('0x17')](function(_0x40f348){_0x5a7181({'code':0xc8,'message':_0x40f348[_0xbecf('0x18')]});})['catch'](function(_0x123df4){_0x2450c9(_0x52cc71[_0xbecf('0x19')](0x1f5,_0x123df4[_0xbecf('0x18')]));});});},'Command':function(_0x35f7a9){var _0x10aac2=this;return new Promise(function(_0xf162a7,_0xef7c4a){if(ami[_0xbecf('0x1a')]()==![]){return _0xef7c4a(_0x10aac2[_0xbecf('0x19')](0x1f4,[config['asterisk']['ip'],config[_0xbecf('0x12')]['username'],_0xbecf('0x14')][_0xbecf('0x1b')]('\x20')));}_0x35f7a9=_[_0xbecf('0x15')](_0x35f7a9,'command');_0x35f7a9[_0xbecf('0x1c')]=_0xbecf('0x1d');return ami[_0xbecf('0x1e')](_0x35f7a9)[_0xbecf('0x17')](function(_0x263760){_0xf162a7({'code':0xc8,'message':_0x263760[_0xbecf('0x1f')]});})['catch'](function(_0x52eba5){_0xef7c4a(_0x10aac2[_0xbecf('0x19')](0x1f5,_0x52eba5[_0xbecf('0x18')]));});});},'VoiceQueues':function(_0x17b2dd){return new Promise(function(_0x20d0bd,_0x44e9b4){var _0x2e7ead=[];for(var _0x4cbb23 in _0xf29afc[_0xbecf('0x20')]){if(_0xf29afc[_0xbecf('0x20')][_0xbecf('0x21')](_0x4cbb23)){var _0x214edb=_0xf29afc['voiceQueues'][_0x4cbb23];var _0x22173a={'id':_0x214edb['id'],'name':_0x214edb[_0xbecf('0xa')],'strategy':_0x214edb[_0xbecf('0x22')],'answered':_0x214edb[_0xbecf('0x23')],'available':_0x214edb[_0xbecf('0x24')],'loggedIn':_0x214edb[_0xbecf('0x25')],'pTalking':_0x214edb[_0xbecf('0x26')],'sumBillable':_0x214edb[_0xbecf('0x27')],'sumDuration':_0x214edb[_0xbecf('0x28')],'sumHoldTime':_0x214edb['sumHoldTime']||0x0,'talking':_0x214edb[_0xbecf('0x29')],'total':_0x214edb['total'],'type':_0x214edb[_0xbecf('0x2a')],'unmanaged':_0x214edb['unmanaged'],'abandoned':_0x214edb[_0xbecf('0x2b')],'waiting':_0x214edb['waiting'],'loggedInDb':_0x214edb[_0xbecf('0x2c')]};if(_0x214edb[_0xbecf('0x2a')]===_0xbecf('0x2d')){_0x22173a['dialActive']=_0x214edb[_0xbecf('0x2e')];_0x22173a[_0xbecf('0x2f')]=_0x214edb[_0xbecf('0x2f')];_0x22173a[_0xbecf('0x30')]=_0x214edb[_0xbecf('0x30')];_0x22173a[_0xbecf('0x31')]=_0x214edb[_0xbecf('0x31')];_0x22173a['dialOriginateTimeout']=_0x214edb[_0xbecf('0x32')];_0x22173a['dialPrefix']=_0x214edb[_0xbecf('0x33')];_0x22173a['outboundAnswerAgiCallsDay']=_0x214edb[_0xbecf('0x34')];_0x22173a[_0xbecf('0x35')]=_0x214edb[_0xbecf('0x35')];_0x22173a['outboundBlacklistCallsDay']=_0x214edb[_0xbecf('0x36')];_0x22173a[_0xbecf('0x37')]=_0x214edb['outboundBusyCallsDay'];_0x22173a[_0xbecf('0x38')]=_0x214edb[_0xbecf('0x38')];_0x22173a[_0xbecf('0x39')]=_0x214edb['outboundDropCallsDayACS'];_0x22173a[_0xbecf('0x3a')]=_0x214edb[_0xbecf('0x3a')];_0x22173a['outboundDropCallsDayTimeout']=_0x214edb['outboundDropCallsDayTimeout'];_0x22173a[_0xbecf('0x3b')]=_0x214edb[_0xbecf('0x3b')];_0x22173a[_0xbecf('0x3c')]=_0x214edb[_0xbecf('0x3c')];_0x22173a['outboundOriginateFailureCallsDay']=_0x214edb['outboundOriginateFailureCallsDay'];_0x22173a[_0xbecf('0x3d')]=_0x214edb['outboundReCallsDay'];_0x22173a['outboundRejectCallsDay']=_0x214edb[_0xbecf('0x3e')];_0x22173a[_0xbecf('0x3f')]=_0x214edb[_0xbecf('0x3f')];_0x22173a[_0xbecf('0x40')]=_0x214edb['predictiveIntervalAnsweredCalls'];_0x22173a[_0xbecf('0x41')]=_0x214edb['predictiveIntervalAvgHoldtime'];_0x22173a[_0xbecf('0x42')]=_0x214edb[_0xbecf('0x42')];_0x22173a[_0xbecf('0x43')]=_0x214edb['predictiveIntervalDroppedCallsCallersExit'];_0x22173a['predictiveIntervalDroppedCallsTimeout']=_0x214edb[_0xbecf('0x44')];_0x22173a['predictiveIntervalErlangCalls']=_0x214edb[_0xbecf('0x45')];_0x22173a[_0xbecf('0x46')]=_0x214edb[_0xbecf('0x46')];_0x22173a[_0xbecf('0x47')]=_0x214edb[_0xbecf('0x47')];_0x22173a[_0xbecf('0x48')]=_0x214edb[_0xbecf('0x48')];_0x22173a[_0xbecf('0x49')]=_0x214edb[_0xbecf('0x49')];_0x22173a[_0xbecf('0x4a')]=_0x214edb[_0xbecf('0x4a')];_0x22173a[_0xbecf('0x4b')]=_0x214edb[_0xbecf('0x4b')];_0x22173a[_0xbecf('0x18')]=_0x214edb[_0xbecf('0x18')];_0x22173a[_0xbecf('0x4c')]=_0x214edb[_0xbecf('0x4c')];}if(_0x214edb[_0xbecf('0x4d')]){_0x22173a[_0xbecf('0x4d')]={'id':_0x214edb['Trunk']['id'],'name':_0x214edb[_0xbecf('0x4d')][_0xbecf('0xa')],'active':_0x214edb[_0xbecf('0x4d')][_0xbecf('0x4e')],'callerid':_0x214edb[_0xbecf('0x4d')]['callerid']};}if(_0x214edb['Interval']){_0x22173a['Interval']={'id':_0x214edb[_0xbecf('0x4f')]['id'],'name':_0x214edb[_0xbecf('0x4f')][_0xbecf('0xa')]};}_0x2e7ead[_0xbecf('0x50')](_0x22173a);}}_0x20d0bd({'count':_0x2e7ead[_0xbecf('0x51')],'rows':_0x2e7ead});});},'VoiceChannels':function(_0x4b70b4){return new Promise(function(_0x5ad850,_0x4bb473){var _0x193a9b=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x53')]);_0x5ad850({'count':_0x193a9b[_0xbecf('0x51')],'rows':_0x193a9b});});},'VoiceChannelMixMonitor':function(_0xf08b9e){var _0x3a7261=this;return new Promise(function(_0x4d902e,_0x13a06f){if(ami[_0xbecf('0x1a')]()==![]){return _0x13a06f(_0x3a7261[_0xbecf('0x19')](0x1f4,[config[_0xbecf('0x12')]['ip'],config[_0xbecf('0x12')][_0xbecf('0x13')],_0xbecf('0x14')][_0xbecf('0x1b')]('\x20')));}var _0x2cb44=schema(properties['voicechannel'])['validate'](_0xf08b9e);if(_0x2cb44['length']>0x0){return _0x13a06f(_0x3a7261[_0xbecf('0x19')](0x1f4,_[_0xbecf('0x54')](_0x2cb44,'message')[_0xbecf('0x1b')](',\x20')));}var _0x44481e=_[_0xbecf('0x55')](_0xf29afc[_0xbecf('0x53')],{'uniqueid':_0xf08b9e['uniqueid']});if(_0x44481e&&_0x44481e[_0xbecf('0x56')]){var _0x52bfce=util[_0xbecf('0x57')](_0xbecf('0x58'),_0xf08b9e[_0xbecf('0x59')]||_0xf08b9e[_0xbecf('0x5a')],_0xf08b9e[_0xbecf('0x57')]||'wav');return ami['Action']({'action':_0xbecf('0x5b'),'channel':_0x44481e[_0xbecf('0x56')],'file':_0x52bfce,'options':_0xbecf('0x5c')})[_0xbecf('0x17')](function(_0x45b316){var _0x1dc756=_[_0xbecf('0x55')](_0x44481e[_0xbecf('0x5d')],{'filename':'/var/spool/asterisk/monitor/'+_0x52bfce[_0xbecf('0x5e')]()});if(_[_0xbecf('0x5f')](_0x1dc756)){_0x44481e[_0xbecf('0x5d')][_0xbecf('0x50')]({'filename':_0xbecf('0x60')+_0x52bfce['toLowerCase'](),'createdAt':moment()[_0xbecf('0x57')](_0xbecf('0x61')),'mixmonitorid':_0x45b316[_0xbecf('0x62')],'status':'rec'});}else{_0x1dc756['mixmonitorid']=_0x45b316['mixmonitorid'];_0x1dc756[_0xbecf('0x63')]='rec';}_0x4d902e({'code':0xc8,'message':[_0xf08b9e[_0xbecf('0x5a')],'MixMonitor\x20Success',_0x45b316[_0xbecf('0x62')]][_0xbecf('0x1b')]('\x20'),'mixmonitorid':_0x45b316[_0xbecf('0x62')]});})['catch'](function(_0x2318bc){_0x13a06f(_0x3a7261[_0xbecf('0x19')](0x1f5,[_0xf08b9e[_0xbecf('0x5a')],_0x2318bc[_0xbecf('0x18')]['toLowerCase']()][_0xbecf('0x1b')]('\x20')));});}else{return _0x13a06f(_0x3a7261['error'](0x1f5,_0xbecf('0x64')));}});},'VoiceChannelStopMixMonitor':function(_0x5d3cf4){var _0x3d1c3f=this;return new Promise(function(_0x4235b3,_0x2c24ea){if(ami['isConnected']()==![]){return _0x2c24ea(_0x3d1c3f['error'](0x1f4,[config['asterisk']['ip'],config[_0xbecf('0x12')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x319f39=schema(properties['voicechannel'])['validate'](_0x5d3cf4);if(_0x319f39[_0xbecf('0x51')]>0x0){return _0x2c24ea(_0x3d1c3f[_0xbecf('0x19')](0x1f4,_[_0xbecf('0x54')](_0x319f39,_0xbecf('0x18'))[_0xbecf('0x1b')](',\x20')));}var _0x137bcc=_['find'](_0xf29afc[_0xbecf('0x53')],{'uniqueid':_0x5d3cf4['uniqueid']});if(_0x137bcc){return BPromise['resolve']()[_0xbecf('0x17')](function(){if(_0x137bcc[_0xbecf('0x56')]){return ami[_0xbecf('0x1e')]({'action':_0xbecf('0x65'),'channel':_0x137bcc['channel'],'mixmonitorid':_0x5d3cf4[_0xbecf('0x62')]})['catch'](function(_0x485f39){});}})[_0xbecf('0x17')](function(){if(_0x137bcc[_0xbecf('0x66')]){return ami[_0xbecf('0x1e')]({'action':_0xbecf('0x65'),'channel':_0x137bcc[_0xbecf('0x66')],'mixmonitorid':_0x5d3cf4[_0xbecf('0x62')]})[_0xbecf('0x67')](function(_0x2ebc3b){});}})['then'](function(_0x5628e7){var _0x38792d=_[_0xbecf('0x55')](_0x137bcc[_0xbecf('0x5d')],{'mixmonitorid':_0x5d3cf4[_0xbecf('0x62')]});if(_0x38792d){_0x38792d['status']='stop';}})[_0xbecf('0x17')](function(){var _0x1e6035=util[_0xbecf('0x57')]('%s.%s',_0x5d3cf4[_0xbecf('0x59')]||_0x5d3cf4[_0xbecf('0x5a')],_0x5d3cf4['format']||_0xbecf('0x68'));var _0x43503f=_[_0xbecf('0x55')](_0x137bcc[_0xbecf('0x5d')],{'filename':_0xbecf('0x60')+_0x1e6035[_0xbecf('0x5e')]()});if(_0x43503f){_0x43503f[_0xbecf('0x63')]=_0xbecf('0x69');}})['then'](function(){_0x4235b3({'code':0xc8,'message':[_0x5d3cf4[_0xbecf('0x5a')],'StopMixMonitor\x20Success'][_0xbecf('0x1b')]('\x20')});})['catch'](function(_0x6a63da){_0x2c24ea(_0x3d1c3f[_0xbecf('0x19')](0x1f5,[_0x5d3cf4[_0xbecf('0x5a')],_0x6a63da['message']['toLowerCase']()][_0xbecf('0x1b')]('\x20')));});}else{return _0x2c24ea(_0x3d1c3f[_0xbecf('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x57fc0c){return new Promise(function(_0x4a0ebb,_0x5cd894){var _0x45e97f=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x6a')]);_0x4a0ebb({'count':_0x45e97f[_0xbecf('0x51')],'rows':_0x45e97f});});},'VoiceQueuesChannel':function(_0x29c803){var _0x55e32b=this;return new Promise(function(_0x454faf,_0xa739e7){var _0x245dfe=schema(properties['voicequeuechannel'])[_0xbecf('0x6b')](_0x29c803);if(_0x245dfe['length']>0x0){return _0xa739e7(_0x55e32b[_0xbecf('0x19')](0x1f4,_['map'](_0x245dfe,_0xbecf('0x18'))[_0xbecf('0x1b')](',\x20')));}var _0x33d5fa=_[_0xbecf('0x55')](_0xf29afc[_0xbecf('0x6a')],{'uniqueid':_0x29c803[_0xbecf('0x5a')]});if(_0x33d5fa){_0x454faf(_0x33d5fa);}else{return _0xa739e7(_0x55e32b[_0xbecf('0x19')](0x1f5,_0xbecf('0x64')));}});},'VoiceQueuesChannelHangup':function(_0x239317){var _0x18bd64=this;return new Promise(function(_0x43f576,_0x2143c3){if(ami['isConnected']()==![]){return _0x2143c3(_0x18bd64['error'](0x1f4,[config[_0xbecf('0x12')]['ip'],config['asterisk'][_0xbecf('0x13')],_0xbecf('0x14')][_0xbecf('0x1b')]('\x20')));}var _0x4d4e68=schema(properties[_0xbecf('0x6c')])[_0xbecf('0x6b')](_0x239317);if(_0x4d4e68[_0xbecf('0x51')]>0x0){return _0x2143c3(_0x18bd64['error'](0x1f4,_[_0xbecf('0x54')](_0x4d4e68,'message')[_0xbecf('0x1b')](',\x20')));}var _0x44a457=_['find'](_0xf29afc['queueChannels'],{'uniqueid':_0x239317['uniqueid']});if(_0x44a457&&_0x44a457[_0xbecf('0x56')]){return ami[_0xbecf('0x1e')]({'action':_0xbecf('0x6d'),'channel':_0x44a457[_0xbecf('0x56')]})[_0xbecf('0x17')](function(_0x2a29bd){_0x43f576({'code':0xc8,'message':[_0x239317[_0xbecf('0x5a')],_0x2a29bd[_0xbecf('0x18')][_0xbecf('0x5e')]()][_0xbecf('0x1b')]('\x20')});})['catch'](function(_0x3526d6){_0x2143c3(_0x18bd64[_0xbecf('0x19')](0x1f5,[_0x239317[_0xbecf('0x5a')],_0x3526d6[_0xbecf('0x18')][_0xbecf('0x5e')]()]['join']('\x20')));});}else{return _0x2143c3(_0x18bd64[_0xbecf('0x19')](0x1f5,_0xbecf('0x64')));}});},'VoiceQueuesChannelRedirect':function(_0x9c1f04){var _0x485a7c=this;return new Promise(function(_0x5d887e,_0x5f2fb3){if(ami[_0xbecf('0x1a')]()==![]){return _0x5f2fb3(_0x485a7c[_0xbecf('0x19')](0x1f4,[config[_0xbecf('0x12')]['ip'],config[_0xbecf('0x12')][_0xbecf('0x13')],_0xbecf('0x14')][_0xbecf('0x1b')]('\x20')));}var _0x34ca0c=schema(properties['voicequeuechannelredirect'])[_0xbecf('0x6b')](_0x9c1f04);if(_0x34ca0c['length']>0x0){return _0x5f2fb3(_0x485a7c[_0xbecf('0x19')](0x1f4,_[_0xbecf('0x54')](_0x34ca0c,_0xbecf('0x18'))[_0xbecf('0x1b')](',\x20')));}var _0x53dfd6=_[_0xbecf('0x55')](_0xf29afc[_0xbecf('0x6a')],{'uniqueid':_0x9c1f04[_0xbecf('0x5a')]});if(_0x53dfd6&&_0x53dfd6['channel']){return ami[_0xbecf('0x1e')]({'action':_0xbecf('0x6e'),'channel':_0x53dfd6[_0xbecf('0x56')],'exten':_0x9c1f04[_0xbecf('0x6f')],'context':_0x9c1f04[_0xbecf('0x70')]||_0x53dfd6['context'],'priority':0x1})[_0xbecf('0x17')](function(_0x51fc44){_0x5d887e({'code':0xc8,'message':[_0x9c1f04['uniqueid'],_0x51fc44[_0xbecf('0x18')][_0xbecf('0x5e')]()][_0xbecf('0x1b')]('\x20')});})['catch'](function(_0x14829e){_0x5f2fb3(_0x485a7c[_0xbecf('0x19')](0x1f5,[_0x9c1f04['uniqueid'],_0x14829e[_0xbecf('0x18')][_0xbecf('0x5e')]()][_0xbecf('0x1b')]('\x20')));});}else{return _0x5f2fb3(_0x485a7c['error'](0x1f5,_0xbecf('0x64')));}});},'Agents':function(_0x5f0e92){return new Promise(function(_0x2b9d8d,_0x59353a){var _0xb6814b=_['values'](_0xf29afc[_0xbecf('0xe')]);_0x2b9d8d({'count':_0xb6814b['length'],'rows':_0xb6814b});});},'Telephones':function(_0xe7a716){return new Promise(function(_0x56201b,_0x20cd07){var _0x4755cb=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x71')]);_0x56201b({'count':_0x4755cb[_0xbecf('0x51')],'rows':_0x4755cb});});},'Trunks':function(_0x2d9014){return new Promise(function(_0x19f29a,_0xe2ffc3){var _0x4bf11d=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x72')]);_0x19f29a({'count':_0x4bf11d[_0xbecf('0x51')],'rows':_0x4bf11d});});},'OutboundChannels':function(_0x1a3f7c){return new Promise(function(_0x573403,_0x431224){var _0x652713=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x73')]);_0x573403({'count':_0x652713['length'],'rows':_0x652713});});},'Outbound':function(_0x37db3a){return new Promise(function(_0x49b2de,_0x35cc1d){_0x49b2de(_0xf29afc['outbound']);});},'Campaigns':function(_0x58d684){return new Promise(function(_0x202e49,_0x2e77e7){var _0x11a557=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x74')]);_0x202e49({'count':_0x11a557['length'],'rows':_0x11a557});});},'VoiceQueuesPreview':function(_0xf29fee){var _0x1af7ab=this;return new Promise(function(_0x5c72ec,_0x28d637){_0x5b11bf['run'](_0xf29fee['id'])['then'](function(_0x20de3f){_0x5c72ec({'code':0xc8,'message':_0x20de3f['message']});})['catch'](function(_0x280059){_0x28d637(_0x1af7ab[_0xbecf('0x19')](0x1f4,_0x280059[_0xbecf('0x18')]));});});},'EventManager':function(_0x3fc73d){var _0x529654=this;return new Promise(function(_0x5b7461,_0x304a47){if(!_0x3fc73d[_0xbecf('0x75')]){return _0x304a47(_0x529654[_0xbecf('0x19')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xbecf('0x76')]('custom:'+_0x3fc73d[_0xbecf('0x75')],_0x3fc73d[_0xbecf('0x18')]);_0x5b7461({'code':0xc8,'message':_0x3fc73d});});},'FaxAccounts':function(_0x50a110){return new Promise(function(_0x348c54,_0x1379ea){var _0x4675b5=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x77')]);_0x348c54({'count':_0x4675b5[_0xbecf('0x51')],'rows':_0x4675b5});});},'SendFax':function(_0x2e49a2){var _0x46711f=this;return new Promise(function(_0x589b8e,_0x4ecd31){_0x4a2d20['send'](_0x2e49a2)[_0xbecf('0x17')](function(_0x147aab){_0x589b8e({'code':0xc8,'message':_0x147aab[_0xbecf('0x18')]});})[_0xbecf('0x67')](function(_0x1c5fcc){_0x4ecd31(_0x46711f['error'](0x1f4,_0x1c5fcc[_0xbecf('0x18')]));});});},'CheckAfterSend':function(_0xa45a16){var _0x43a15a=this;return new Promise(function(_0xa20419,_0x4ff9a8){_0x4a2d20[_0xbecf('0x78')](_0xa45a16)['then'](function(_0x2aa839){_0xa20419({'code':0xc8,'message':_0x2aa839['message']});})['catch'](function(_0x1e2971){_0x4ff9a8(_0x43a15a['error'](0x1f4,_0x1e2971[_0xbecf('0x18')]));});});}};var _0x3b42be=jayson['server'](_0x1633fd)[_0xbecf('0x79')]();_0x3b42be['on'](_0xbecf('0x19'),function(_0x58b7ce){return _0x30b58b(_0x58b7ce);});_0x3b42be[_0xbecf('0x7')](0x232a,'127.0.0.1',function(){console[_0xbecf('0x7a')](_0xbecf('0x7b'),0x232a);return _0x3f55c3(_0xbecf('0x7c')+0x232a);});});};
\ No newline at end of file
+var _0x4c9f=['error','asterisk','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumBillable','talking','total','abandoned','waiting','loggedInDb','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','Interval','length','values','channels','voicechannel','map','find','channel','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','push','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','%s.%s','stop','StopMixMonitor\x20Success','voicequeuechannel','voicequeuechannelhangup','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','outbound','campaigns','run','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','username','ami\x20disconnected','join','pick','keys','module','Reload','Action','then','message','catch'];(function(_0xfd1e64,_0x15dccb){var _0x1d9568=function(_0x1f4ba6){while(--_0x1f4ba6){_0xfd1e64['push'](_0xfd1e64['shift']());}};_0x1d9568(++_0x15dccb);}(_0x4c9f,0x1f4));var _0xf4c9=function(_0x27c205,_0x57413c){_0x27c205=_0x27c205-0x0;var _0x31c8e3=_0x4c9f[_0x27c205];return _0x31c8e3;};'use strict';var _=require(_0xf4c9('0x0'));var util=require(_0xf4c9('0x1'));var jayson=require(_0xf4c9('0x2'));var schema=require(_0xf4c9('0x3'));var BPromise=require(_0xf4c9('0x4'));var moment=require(_0xf4c9('0x5'));var config=require(_0xf4c9('0x6'));var properties=require(_0xf4c9('0x7'));var ami=require(_0xf4c9('0x8'));exports[_0xf4c9('0x9')]=function(_0x1f180a,_0x485e5a,_0x25e276){return new BPromise(function(_0x240f61,_0x533587){var _0x424aed={'QueuePause':function(_0x2d3682){return new Promise(function(_0x16aed0,_0x3c14c6){var _0x360edb=util[_0xf4c9('0xa')](_0xf4c9('0xb'),_0xf4c9('0xc'),_0x2d3682[_0xf4c9('0xd')]);if(_0x1f180a[_0xf4c9('0xe')]&&_0x1f180a[_0xf4c9('0xe')][_0x360edb]&&_0x1f180a[_0xf4c9('0xe')][_0x360edb][_0xf4c9('0xf')]){_0x1f180a[_0xf4c9('0xe')][_0x360edb]['updateAcw']();}if(_0x1f180a['agents'][_0x360edb]){_0x1f180a[_0xf4c9('0x10')][_0x360edb][_0xf4c9('0x11')]({'statePause':_0x2d3682[_0xf4c9('0x12')]?!![]:![]});}_0x16aed0({'code':0xc8,'message':_0xf4c9('0x13')});});},'Reload':function(_0x4f112f){var _0x445817=this;return new Promise(function(_0x5f1613,_0x5ee32d){if(ami[_0xf4c9('0x14')]()==![]){return _0x5ee32d(_0x445817['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xf4c9('0x15')],_0xf4c9('0x16')][_0xf4c9('0x17')]('\x20')));}_0x4f112f=_[_0xf4c9('0x18')](_0x4f112f,_[_0xf4c9('0x19')](properties[_0xf4c9('0x1a')]));_0x4f112f['action']=_0xf4c9('0x1b');return ami[_0xf4c9('0x1c')](_0x4f112f)[_0xf4c9('0x1d')](function(_0x3f3024){_0x5f1613({'code':0xc8,'message':_0x3f3024[_0xf4c9('0x1e')]});})[_0xf4c9('0x1f')](function(_0x2bf12c){_0x5ee32d(_0x445817['error'](0x1f5,_0x2bf12c[_0xf4c9('0x1e')]));});});},'Command':function(_0x5a4af5){var _0x5e2e8f=this;return new Promise(function(_0x3e5fdd,_0x2af0ac){if(ami['isConnected']()==![]){return _0x2af0ac(_0x5e2e8f[_0xf4c9('0x20')](0x1f4,[config[_0xf4c9('0x21')]['ip'],config['asterisk']['username'],_0xf4c9('0x16')][_0xf4c9('0x17')]('\x20')));}_0x5a4af5=_[_0xf4c9('0x18')](_0x5a4af5,_0xf4c9('0x22'));_0x5a4af5['action']=_0xf4c9('0x23');return ami['Action'](_0x5a4af5)[_0xf4c9('0x1d')](function(_0x1ba056){_0x3e5fdd({'code':0xc8,'message':_0x1ba056[_0xf4c9('0x24')]});})['catch'](function(_0x111465){_0x2af0ac(_0x5e2e8f['error'](0x1f5,_0x111465[_0xf4c9('0x1e')]));});});},'VoiceQueues':function(_0xdb020d){return new Promise(function(_0x33934d,_0x15c58f){var _0x1ecbaa=[];for(var _0x6b80d7 in _0x1f180a[_0xf4c9('0x25')]){if(_0x1f180a['voiceQueues'][_0xf4c9('0x26')](_0x6b80d7)){var _0x1ae536=_0x1f180a[_0xf4c9('0x25')][_0x6b80d7];var _0x10269c={'id':_0x1ae536['id'],'name':_0x1ae536['name'],'strategy':_0x1ae536[_0xf4c9('0x27')],'answered':_0x1ae536[_0xf4c9('0x28')],'available':_0x1ae536['available'],'loggedIn':_0x1ae536[_0xf4c9('0x29')],'pTalking':_0x1ae536[_0xf4c9('0x2a')],'sumBillable':_0x1ae536[_0xf4c9('0x2b')],'sumDuration':_0x1ae536['sumDuration'],'sumHoldTime':_0x1ae536['sumHoldTime']||0x0,'talking':_0x1ae536[_0xf4c9('0x2c')],'total':_0x1ae536[_0xf4c9('0x2d')],'type':_0x1ae536['type'],'unmanaged':_0x1ae536['unmanaged'],'abandoned':_0x1ae536[_0xf4c9('0x2e')],'waiting':_0x1ae536[_0xf4c9('0x2f')],'loggedInDb':_0x1ae536[_0xf4c9('0x30')]};if(_0x1ae536[_0xf4c9('0x31')]==='outbound'){_0x10269c[_0xf4c9('0x32')]=_0x1ae536['dialActive'];_0x10269c[_0xf4c9('0x33')]=_0x1ae536[_0xf4c9('0x33')];_0x10269c[_0xf4c9('0x34')]=_0x1ae536[_0xf4c9('0x34')];_0x10269c[_0xf4c9('0x35')]=_0x1ae536[_0xf4c9('0x35')];_0x10269c[_0xf4c9('0x36')]=_0x1ae536[_0xf4c9('0x36')];_0x10269c[_0xf4c9('0x37')]=_0x1ae536[_0xf4c9('0x37')];_0x10269c[_0xf4c9('0x38')]=_0x1ae536[_0xf4c9('0x38')];_0x10269c[_0xf4c9('0x39')]=_0x1ae536['outboundAnswerCallsDay'];_0x10269c[_0xf4c9('0x3a')]=_0x1ae536[_0xf4c9('0x3a')];_0x10269c[_0xf4c9('0x3b')]=_0x1ae536[_0xf4c9('0x3b')];_0x10269c['outboundCongestionCallsDay']=_0x1ae536[_0xf4c9('0x3c')];_0x10269c[_0xf4c9('0x3d')]=_0x1ae536[_0xf4c9('0x3d')];_0x10269c[_0xf4c9('0x3e')]=_0x1ae536[_0xf4c9('0x3e')];_0x10269c['outboundDropCallsDayTimeout']=_0x1ae536[_0xf4c9('0x3f')];_0x10269c[_0xf4c9('0x40')]=_0x1ae536[_0xf4c9('0x40')];_0x10269c['outboundNoSuchCallsDay']=_0x1ae536['outboundNoSuchCallsDay'];_0x10269c[_0xf4c9('0x41')]=_0x1ae536[_0xf4c9('0x41')];_0x10269c['outboundReCallsDay']=_0x1ae536[_0xf4c9('0x42')];_0x10269c['outboundRejectCallsDay']=_0x1ae536[_0xf4c9('0x43')];_0x10269c[_0xf4c9('0x44')]=_0x1ae536[_0xf4c9('0x44')];_0x10269c[_0xf4c9('0x45')]=_0x1ae536[_0xf4c9('0x45')];_0x10269c['predictiveIntervalAvgHoldtime']=_0x1ae536[_0xf4c9('0x46')];_0x10269c['predictiveIntervalAvgTalktime']=_0x1ae536[_0xf4c9('0x47')];_0x10269c[_0xf4c9('0x48')]=_0x1ae536['predictiveIntervalDroppedCallsCallersExit'];_0x10269c['predictiveIntervalDroppedCallsTimeout']=_0x1ae536[_0xf4c9('0x49')];_0x10269c['predictiveIntervalErlangCalls']=_0x1ae536[_0xf4c9('0x4a')];_0x10269c[_0xf4c9('0x4b')]=_0x1ae536[_0xf4c9('0x4b')];_0x10269c[_0xf4c9('0x4c')]=_0x1ae536[_0xf4c9('0x4c')];_0x10269c[_0xf4c9('0x4d')]=_0x1ae536['predictiveIntervalLowerLimit'];_0x10269c[_0xf4c9('0x4e')]=_0x1ae536[_0xf4c9('0x4e')];_0x10269c[_0xf4c9('0x4f')]=_0x1ae536[_0xf4c9('0x4f')];_0x10269c['predictiveIntervalTotalCalls']=_0x1ae536[_0xf4c9('0x50')];_0x10269c[_0xf4c9('0x1e')]=_0x1ae536[_0xf4c9('0x1e')];_0x10269c[_0xf4c9('0x51')]=_0x1ae536[_0xf4c9('0x51')];}if(_0x1ae536[_0xf4c9('0x52')]){_0x10269c[_0xf4c9('0x52')]={'id':_0x1ae536[_0xf4c9('0x52')]['id'],'name':_0x1ae536[_0xf4c9('0x52')]['name'],'active':_0x1ae536[_0xf4c9('0x52')][_0xf4c9('0x53')],'callerid':_0x1ae536[_0xf4c9('0x52')]['callerid']};}if(_0x1ae536[_0xf4c9('0x54')]){_0x10269c['Interval']={'id':_0x1ae536[_0xf4c9('0x54')]['id'],'name':_0x1ae536[_0xf4c9('0x54')][_0xf4c9('0xd')]};}_0x1ecbaa['push'](_0x10269c);}}_0x33934d({'count':_0x1ecbaa[_0xf4c9('0x55')],'rows':_0x1ecbaa});});},'VoiceChannels':function(_0x1f4654){return new Promise(function(_0x214c62,_0x3095e3){var _0x57b419=_[_0xf4c9('0x56')](_0x1f180a[_0xf4c9('0x57')]);_0x214c62({'count':_0x57b419[_0xf4c9('0x55')],'rows':_0x57b419});});},'VoiceChannelMixMonitor':function(_0x4e7742){var _0x749a41=this;return new Promise(function(_0x523eeb,_0x37f4fd){if(ami[_0xf4c9('0x14')]()==![]){return _0x37f4fd(_0x749a41[_0xf4c9('0x20')](0x1f4,[config['asterisk']['ip'],config[_0xf4c9('0x21')][_0xf4c9('0x15')],_0xf4c9('0x16')][_0xf4c9('0x17')]('\x20')));}var _0x3d2a9e=schema(properties[_0xf4c9('0x58')])['validate'](_0x4e7742);if(_0x3d2a9e[_0xf4c9('0x55')]>0x0){return _0x37f4fd(_0x749a41['error'](0x1f4,_[_0xf4c9('0x59')](_0x3d2a9e,'message')[_0xf4c9('0x17')](',\x20')));}var _0x3d8013=_[_0xf4c9('0x5a')](_0x1f180a['channels'],{'uniqueid':_0x4e7742['uniqueid']});if(_0x3d8013&&_0x3d8013[_0xf4c9('0x5b')]){var _0x200356=util[_0xf4c9('0xa')]('%s.%s',_0x4e7742[_0xf4c9('0x5c')]||_0x4e7742[_0xf4c9('0x5d')],_0x4e7742[_0xf4c9('0xa')]||_0xf4c9('0x5e'));return ami[_0xf4c9('0x1c')]({'action':_0xf4c9('0x5f'),'channel':_0x3d8013[_0xf4c9('0x5b')],'file':_0x200356,'options':_0xf4c9('0x60')})[_0xf4c9('0x1d')](function(_0x5e185e){var _0x5ed47c=_[_0xf4c9('0x5a')](_0x3d8013['monitors'],{'filename':_0xf4c9('0x61')+_0x200356[_0xf4c9('0x62')]()});if(_[_0xf4c9('0x63')](_0x5ed47c)){_0x3d8013[_0xf4c9('0x64')][_0xf4c9('0x65')]({'filename':_0xf4c9('0x61')+_0x200356[_0xf4c9('0x62')](),'createdAt':moment()[_0xf4c9('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5e185e[_0xf4c9('0x66')],'status':_0xf4c9('0x67')});}else{_0x5ed47c['mixmonitorid']=_0x5e185e[_0xf4c9('0x66')];_0x5ed47c[_0xf4c9('0x68')]='rec';}_0x523eeb({'code':0xc8,'message':[_0x4e7742[_0xf4c9('0x5d')],'MixMonitor\x20Success',_0x5e185e['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x5e185e[_0xf4c9('0x66')]});})['catch'](function(_0x1eeeb2){_0x37f4fd(_0x749a41['error'](0x1f5,[_0x4e7742[_0xf4c9('0x5d')],_0x1eeeb2['message'][_0xf4c9('0x62')]()][_0xf4c9('0x17')]('\x20')));});}else{return _0x37f4fd(_0x749a41[_0xf4c9('0x20')](0x1f5,_0xf4c9('0x69')));}});},'VoiceChannelStopMixMonitor':function(_0x1e629c){var _0x34636c=this;return new Promise(function(_0x313456,_0x3c277b){if(ami[_0xf4c9('0x14')]()==![]){return _0x3c277b(_0x34636c[_0xf4c9('0x20')](0x1f4,[config['asterisk']['ip'],config[_0xf4c9('0x21')][_0xf4c9('0x15')],_0xf4c9('0x16')][_0xf4c9('0x17')]('\x20')));}var _0x147ccf=schema(properties[_0xf4c9('0x58')])['validate'](_0x1e629c);if(_0x147ccf[_0xf4c9('0x55')]>0x0){return _0x3c277b(_0x34636c['error'](0x1f4,_[_0xf4c9('0x59')](_0x147ccf,_0xf4c9('0x1e'))[_0xf4c9('0x17')](',\x20')));}var _0x561ff6=_[_0xf4c9('0x5a')](_0x1f180a[_0xf4c9('0x57')],{'uniqueid':_0x1e629c[_0xf4c9('0x5d')]});if(_0x561ff6){return BPromise[_0xf4c9('0x6a')]()[_0xf4c9('0x1d')](function(){if(_0x561ff6[_0xf4c9('0x5b')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x561ff6[_0xf4c9('0x5b')],'mixmonitorid':_0x1e629c[_0xf4c9('0x66')]})[_0xf4c9('0x1f')](function(_0x2f110e){});}})[_0xf4c9('0x1d')](function(){if(_0x561ff6[_0xf4c9('0x6b')]){return ami[_0xf4c9('0x1c')]({'action':'StopMixMonitor','channel':_0x561ff6['destinationchannel'],'mixmonitorid':_0x1e629c['mixmonitorid']})[_0xf4c9('0x1f')](function(_0x52a7d0){});}})[_0xf4c9('0x1d')](function(_0x31ebda){var _0x237f46=_[_0xf4c9('0x5a')](_0x561ff6['monitors'],{'mixmonitorid':_0x1e629c[_0xf4c9('0x66')]});if(_0x237f46){_0x237f46[_0xf4c9('0x68')]='stop';}})[_0xf4c9('0x1d')](function(){var _0x53b9c2=util[_0xf4c9('0xa')](_0xf4c9('0x6c'),_0x1e629c['filename']||_0x1e629c[_0xf4c9('0x5d')],_0x1e629c[_0xf4c9('0xa')]||_0xf4c9('0x5e'));var _0xec4a99=_[_0xf4c9('0x5a')](_0x561ff6[_0xf4c9('0x64')],{'filename':_0xf4c9('0x61')+_0x53b9c2[_0xf4c9('0x62')]()});if(_0xec4a99){_0xec4a99[_0xf4c9('0x68')]=_0xf4c9('0x6d');}})[_0xf4c9('0x1d')](function(){_0x313456({'code':0xc8,'message':[_0x1e629c[_0xf4c9('0x5d')],_0xf4c9('0x6e')]['join']('\x20')});})[_0xf4c9('0x1f')](function(_0x2c7a71){_0x3c277b(_0x34636c[_0xf4c9('0x20')](0x1f5,[_0x1e629c[_0xf4c9('0x5d')],_0x2c7a71[_0xf4c9('0x1e')][_0xf4c9('0x62')]()][_0xf4c9('0x17')]('\x20')));});}else{return _0x3c277b(_0x34636c[_0xf4c9('0x20')](0x1f5,_0xf4c9('0x69')));}});},'VoiceQueuesChannels':function(_0x5b5673){return new Promise(function(_0x20889d,_0x304203){var _0x1629d7=_[_0xf4c9('0x56')](_0x1f180a['queueChannels']);_0x20889d({'count':_0x1629d7[_0xf4c9('0x55')],'rows':_0x1629d7});});},'VoiceQueuesChannel':function(_0x1fa6b9){var _0x248f2a=this;return new Promise(function(_0x1d2a1c,_0x3d8385){var _0x52d01a=schema(properties[_0xf4c9('0x6f')])[_0xf4c9('0x3')](_0x1fa6b9);if(_0x52d01a[_0xf4c9('0x55')]>0x0){return _0x3d8385(_0x248f2a[_0xf4c9('0x20')](0x1f4,_[_0xf4c9('0x59')](_0x52d01a,_0xf4c9('0x1e'))[_0xf4c9('0x17')](',\x20')));}var _0x4be5da=_[_0xf4c9('0x5a')](_0x1f180a['queueChannels'],{'uniqueid':_0x1fa6b9['uniqueid']});if(_0x4be5da){_0x1d2a1c(_0x4be5da);}else{return _0x3d8385(_0x248f2a[_0xf4c9('0x20')](0x1f5,_0xf4c9('0x69')));}});},'VoiceQueuesChannelHangup':function(_0x41777e){var _0x195be2=this;return new Promise(function(_0x4c0f1b,_0x1268b5){if(ami[_0xf4c9('0x14')]()==![]){return _0x1268b5(_0x195be2[_0xf4c9('0x20')](0x1f4,[config[_0xf4c9('0x21')]['ip'],config[_0xf4c9('0x21')]['username'],_0xf4c9('0x16')][_0xf4c9('0x17')]('\x20')));}var _0xeee2f9=schema(properties[_0xf4c9('0x70')])[_0xf4c9('0x3')](_0x41777e);if(_0xeee2f9[_0xf4c9('0x55')]>0x0){return _0x1268b5(_0x195be2['error'](0x1f4,_[_0xf4c9('0x59')](_0xeee2f9,_0xf4c9('0x1e'))['join'](',\x20')));}var _0x239d95=_[_0xf4c9('0x5a')](_0x1f180a[_0xf4c9('0x71')],{'uniqueid':_0x41777e[_0xf4c9('0x5d')]});if(_0x239d95&&_0x239d95['channel']){return ami[_0xf4c9('0x1c')]({'action':_0xf4c9('0x72'),'channel':_0x239d95['channel']})[_0xf4c9('0x1d')](function(_0x18bf34){_0x4c0f1b({'code':0xc8,'message':[_0x41777e['uniqueid'],_0x18bf34[_0xf4c9('0x1e')]['toLowerCase']()][_0xf4c9('0x17')]('\x20')});})[_0xf4c9('0x1f')](function(_0x2afc43){_0x1268b5(_0x195be2[_0xf4c9('0x20')](0x1f5,[_0x41777e['uniqueid'],_0x2afc43['message']['toLowerCase']()][_0xf4c9('0x17')]('\x20')));});}else{return _0x1268b5(_0x195be2[_0xf4c9('0x20')](0x1f5,_0xf4c9('0x69')));}});},'VoiceQueuesChannelRedirect':function(_0x30a4cb){var _0x20cb2a=this;return new Promise(function(_0x384eb5,_0x291a6e){if(ami[_0xf4c9('0x14')]()==![]){return _0x291a6e(_0x20cb2a['error'](0x1f4,[config[_0xf4c9('0x21')]['ip'],config['asterisk'][_0xf4c9('0x15')],_0xf4c9('0x16')]['join']('\x20')));}var _0x1f38a3=schema(properties[_0xf4c9('0x73')])[_0xf4c9('0x3')](_0x30a4cb);if(_0x1f38a3[_0xf4c9('0x55')]>0x0){return _0x291a6e(_0x20cb2a[_0xf4c9('0x20')](0x1f4,_[_0xf4c9('0x59')](_0x1f38a3,_0xf4c9('0x1e'))[_0xf4c9('0x17')](',\x20')));}var _0x20da17=_[_0xf4c9('0x5a')](_0x1f180a[_0xf4c9('0x71')],{'uniqueid':_0x30a4cb[_0xf4c9('0x5d')]});if(_0x20da17&&_0x20da17[_0xf4c9('0x5b')]){return ami[_0xf4c9('0x1c')]({'action':_0xf4c9('0x74'),'channel':_0x20da17['channel'],'exten':_0x30a4cb[_0xf4c9('0x75')],'context':_0x30a4cb[_0xf4c9('0x76')]||_0x20da17[_0xf4c9('0x76')],'priority':0x1})['then'](function(_0x1caf6c){_0x384eb5({'code':0xc8,'message':[_0x30a4cb[_0xf4c9('0x5d')],_0x1caf6c[_0xf4c9('0x1e')][_0xf4c9('0x62')]()][_0xf4c9('0x17')]('\x20')});})[_0xf4c9('0x1f')](function(_0x2841c4){_0x291a6e(_0x20cb2a[_0xf4c9('0x20')](0x1f5,[_0x30a4cb[_0xf4c9('0x5d')],_0x2841c4[_0xf4c9('0x1e')]['toLowerCase']()]['join']('\x20')));});}else{return _0x291a6e(_0x20cb2a[_0xf4c9('0x20')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x15607c){return new Promise(function(_0x426f82,_0x231518){var _0x37c19e=_[_0xf4c9('0x56')](_0x1f180a[_0xf4c9('0x10')]);_0x426f82({'count':_0x37c19e[_0xf4c9('0x55')],'rows':_0x37c19e});});},'Telephones':function(_0x58654d){return new Promise(function(_0x3bac49,_0x250735){var _0x32a735=_['values'](_0x1f180a['telephones']);_0x3bac49({'count':_0x32a735[_0xf4c9('0x55')],'rows':_0x32a735});});},'Trunks':function(_0x52f457){return new Promise(function(_0xc4ae42,_0x23aa81){var _0x418791=_[_0xf4c9('0x56')](_0x1f180a[_0xf4c9('0x77')]);_0xc4ae42({'count':_0x418791[_0xf4c9('0x55')],'rows':_0x418791});});},'OutboundChannels':function(_0x3da3ae){return new Promise(function(_0x17622f,_0x121403){var _0x297be1=_[_0xf4c9('0x56')](_0x1f180a[_0xf4c9('0x78')]);_0x17622f({'count':_0x297be1['length'],'rows':_0x297be1});});},'Outbound':function(_0x3cbd59){return new Promise(function(_0x5ebc37,_0x2bf56a){_0x5ebc37(_0x1f180a[_0xf4c9('0x79')]);});},'Campaigns':function(_0x32e12a){return new Promise(function(_0x5a4afb,_0x123809){var _0x56f9c1=_[_0xf4c9('0x56')](_0x1f180a[_0xf4c9('0x7a')]);_0x5a4afb({'count':_0x56f9c1['length'],'rows':_0x56f9c1});});},'VoiceQueuesPreview':function(_0x27acb2){var _0x574cf2=this;return new Promise(function(_0x39dc0e,_0x37cf11){_0x485e5a[_0xf4c9('0x7b')](_0x27acb2['id'])[_0xf4c9('0x1d')](function(_0x361443){_0x39dc0e({'code':0xc8,'message':_0x361443[_0xf4c9('0x1e')]});})[_0xf4c9('0x1f')](function(_0x16fbef){_0x37cf11(_0x574cf2[_0xf4c9('0x20')](0x1f4,_0x16fbef['message']));});});},'EventManager':function(_0x4b7cd2){var _0x305223=this;return new Promise(function(_0x5a9805,_0x1a3089){if(!_0x4b7cd2['event']){return _0x1a3089(_0x305223[_0xf4c9('0x20')](0x1f4,_0xf4c9('0x7c')));}ami['emit'](_0xf4c9('0x7d')+_0x4b7cd2['event'],_0x4b7cd2[_0xf4c9('0x1e')]);_0x5a9805({'code':0xc8,'message':_0x4b7cd2});});},'FaxAccounts':function(_0x419236){return new Promise(function(_0x13fdb9,_0x540965){var _0x58e551=_[_0xf4c9('0x56')](_0x1f180a[_0xf4c9('0x7e')]);_0x13fdb9({'count':_0x58e551['length'],'rows':_0x58e551});});},'SendFax':function(_0x2b4eb1){var _0x2dee88=this;return new Promise(function(_0x218072,_0x46bb50){_0x25e276[_0xf4c9('0x7f')](_0x2b4eb1)['then'](function(_0x1bdefe){_0x218072({'code':0xc8,'message':_0x1bdefe['message']});})[_0xf4c9('0x1f')](function(_0x2bf462){_0x46bb50(_0x2dee88[_0xf4c9('0x20')](0x1f4,_0x2bf462[_0xf4c9('0x1e')]));});});},'CheckAfterSend':function(_0x16e3a3){var _0x4dacad=this;return new Promise(function(_0x29dd31,_0x4f4924){_0x25e276[_0xf4c9('0x80')](_0x16e3a3)['then'](function(_0x312dfe){_0x29dd31({'code':0xc8,'message':_0x312dfe[_0xf4c9('0x1e')]});})[_0xf4c9('0x1f')](function(_0x13d34f){_0x4f4924(_0x4dacad[_0xf4c9('0x20')](0x1f4,_0x13d34f[_0xf4c9('0x1e')]));});});}};var _0x2babf3=jayson[_0xf4c9('0x81')](_0x424aed)[_0xf4c9('0x82')]();_0x2babf3['on'](_0xf4c9('0x20'),function(_0x238309){return _0x533587(_0x238309);});_0x2babf3[_0xf4c9('0x9')](0x232a,'127.0.0.1',function(){console[_0xf4c9('0x83')](_0xf4c9('0x84'),0x232a);return _0x240f61('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file