Built motion from commit (unavailable).|2.2.0
[motion2.git] / server / api / rpc / rpc.controller.js
index 14c9756..46e063c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7936=['voiceQueues','VoiceQueues','showVoiceQueues','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','outboundChannels','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','updateAttributes','findOrCreate','interface','SIP/%s','format','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','SmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','SmsQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','MessageId','agentTransferTimeout','bluebird','moment','../../mysqldb','../../config/logger','api','jayson/promise','client','http','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','VoiceChannels','query','then','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge'];(function(_0x4959fd,_0x186515){var _0x97de01=function(_0x29e1d0){while(--_0x29e1d0){_0x4959fd['push'](_0x4959fd['shift']());}};_0x97de01(++_0x186515);}(_0x7936,0x12f));var _0x6793=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7936[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x6793('0x0'));var moment=require(_0x6793('0x1'));var _=require('lodash');var util=require('util');var db=require(_0x6793('0x2'))['db'];var logger=require(_0x6793('0x3'))(_0x6793('0x4'));var jayson=require(_0x6793('0x5'));var amiClient=jayson[_0x6793('0x6')][_0x6793('0x7')]({'port':0x232a});var mailClient=jayson[_0x6793('0x6')][_0x6793('0x7')]({'port':0x232b});var routingClient=jayson[_0x6793('0x6')][_0x6793('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x207759,_0x221859,_0x13d661){return new BPromise(function(_0x39ccfd,_0x33407c){var _0x422148=_0x13d661?_0x13d661:amiClient;return _0x422148['request'](_0x207759,_0x221859)['then'](function(_0x47a13d){if(_0x47a13d['error']){if(_0x47a13d[_0x6793('0x8')][_0x6793('0x9')]===0x1f4){return _0x33407c(_0x47a13d[_0x6793('0x8')][_0x6793('0xa')]);}return _0x39ccfd(_0x47a13d[_0x6793('0x8')][_0x6793('0xa')]);}else{_0x39ccfd(_0x47a13d[_0x6793('0xb')]);}})[_0x6793('0xc')](function(_0x2677b0){_0x33407c(_0x2677b0);});});}function respondWithResult(_0x164ba0,_0x3cb757){_0x3cb757=_0x3cb757||0xc8;return function(_0x27863e){if(_0x27863e){return _0x164ba0[_0x6793('0xd')](_0x3cb757)[_0x6793('0xe')](_0x27863e);}return _0x164ba0[_0x6793('0xf')](0x194);};}function handleError(_0x1a8c4f,_0x389d51){_0x389d51=_0x389d51||0x1f4;return function(_0x3bb68f){logger[_0x6793('0x8')](_0x3bb68f[_0x6793('0x10')]);if(_0x3bb68f[_0x6793('0x11')]){delete _0x3bb68f['name'];}_0x1a8c4f[_0x6793('0xd')](_0x389d51)[_0x6793('0x12')](_0x3bb68f);};}function findById(_0x73c170){return function(_0x45badb){if(!_[_0x6793('0x13')](_0x73c170)&&!_[_0x6793('0x13')](_0x45badb)&&!_['isNil'](_0x45badb['rows'])){return _['find'](_0x45badb['rows'],function(_0x589faf){return _0x589faf['id']==_0x73c170;});}return null;};}exports['voiceChannels']=function(_0x32a7a2,_0x3a9f56){return respondWithRpcPromise(_0x6793('0x14'),_0x32a7a2[_0x6793('0x15')])[_0x6793('0x16')](respondWithResult(_0x3a9f56,null))[_0x6793('0xc')](handleError(_0x3a9f56,null));};exports['voiceChannelMixMonitor']=function(_0x2cae10,_0x5a1090){return respondWithRpcPromise(_0x6793('0x17'),_['merge'](_0x2cae10[_0x6793('0x15')],_0x2cae10[_0x6793('0x18')]))['then'](respondWithResult(_0x5a1090,null))[_0x6793('0xc')](handleError(_0x5a1090,null));};exports['voiceChannelStopMixMonitor']=function(_0x4d5993,_0x473534){return respondWithRpcPromise(_0x6793('0x19'),_[_0x6793('0x1a')](_0x4d5993[_0x6793('0x15')],_0x4d5993[_0x6793('0x18')]))[_0x6793('0x16')](respondWithResult(_0x473534,null))[_0x6793('0xc')](handleError(_0x473534,null));};exports[_0x6793('0x1b')]=function(_0x21b9fa,_0x179fc6){return respondWithRpcPromise(_0x6793('0x1c'),_0x21b9fa['query'])['then'](respondWithResult(_0x179fc6,null))[_0x6793('0xc')](handleError(_0x179fc6,null));};exports[_0x6793('0x1d')]=function(_0xfc6243,_0x2b6672){return respondWithRpcPromise(_0x6793('0x1c'),_0xfc6243[_0x6793('0x15')])[_0x6793('0x16')](findById(_0xfc6243['params']['id']))[_0x6793('0x16')](respondWithResult(_0x2b6672,null))[_0x6793('0xc')](handleError(_0x2b6672,null));};exports['voiceQueuesPreview']=function(_0x436c2d,_0x4031c1){return respondWithRpcPromise(_0x6793('0x1e'),_['merge'](_0x436c2d[_0x6793('0x15')],_0x436c2d[_0x6793('0x18')]))[_0x6793('0x16')](respondWithResult(_0x4031c1,null))[_0x6793('0xc')](handleError(_0x4031c1,null));};exports[_0x6793('0x1f')]=function(_0x4aa53f,_0x2a7e82){return respondWithRpcPromise(_0x6793('0x20'),_0x4aa53f[_0x6793('0x15')])['then'](respondWithResult(_0x2a7e82,null))['catch'](handleError(_0x2a7e82,null));};exports[_0x6793('0x21')]=function(_0x1b2a05,_0xfb6773){return respondWithRpcPromise(_0x6793('0x22'),_['merge'](_0x1b2a05[_0x6793('0x15')],_0x1b2a05[_0x6793('0x18')]))['then'](respondWithResult(_0xfb6773,null))[_0x6793('0xc')](handleError(_0xfb6773,null));};exports[_0x6793('0x23')]=function(_0x21c654,_0x9f5bf5){return respondWithRpcPromise(_0x6793('0x24'),_[_0x6793('0x1a')](_0x21c654[_0x6793('0x15')],_0x21c654[_0x6793('0x18')]))[_0x6793('0x16')](respondWithResult(_0x9f5bf5,null))[_0x6793('0xc')](handleError(_0x9f5bf5,null));};exports['voiceQueuesChannelRedirect']=function(_0x4c4ab9,_0x1ca01d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_['merge'](_0x4c4ab9[_0x6793('0x15')],_0x4c4ab9['params']))[_0x6793('0x16')](respondWithResult(_0x1ca01d,null))[_0x6793('0xc')](handleError(_0x1ca01d,null));};exports['outbound']=function(_0x22798d,_0x247cff){return respondWithRpcPromise('Outbound',_0x22798d['query'])[_0x6793('0x16')](respondWithResult(_0x247cff,null))['catch'](handleError(_0x247cff,null));};exports[_0x6793('0x25')]=function(_0x218cab,_0x928f07){return respondWithRpcPromise('OutboundChannels',_0x218cab[_0x6793('0x15')])[_0x6793('0x16')](respondWithResult(_0x928f07,null))[_0x6793('0xc')](handleError(_0x928f07,null));};exports['agents']=function(_0x5e9198,_0x2b7c83){var _0x1ad274;return respondWithRpcPromise(_0x6793('0x26'),_0x5e9198[_0x6793('0x15')])[_0x6793('0x16')](function(_0x4547a4){_0x1ad274=_0x4547a4;return respondWithRpcPromise('Agents',_0x5e9198[_0x6793('0x15')],routingClient);})[_0x6793('0x16')](function(_0x45e5a3){return _['merge']({},_0x45e5a3,_0x1ad274);})['then'](respondWithResult(_0x2b7c83,null))[_0x6793('0xc')](handleError(_0x2b7c83,null));};exports[_0x6793('0x27')]=function(_0x14efda,_0x5d24d9){if(_0x14efda[_0x6793('0x28')]&&_0x14efda[_0x6793('0x28')][_0x6793('0x29')]&&_0x14efda[_0x6793('0x2a')]&&_0x14efda[_0x6793('0x2a')][_0x6793('0x11')]){for(var _0x11bfb1 in _0x14efda[_0x6793('0x28')][_0x6793('0x29')]){if(_0x14efda[_0x6793('0x28')]['interaction'][_0x6793('0x2b')](_0x11bfb1)){db[_0x6793('0x2c')][_0x6793('0x2d')]({'where':{'channel':_0x11bfb1,'membername':_0x14efda['user'][_0x6793('0x11')],'type':_0x6793('0x2e'),'exitAt':null,'uniqueid':_0x14efda['body']['interaction'][_0x11bfb1]&&_0x14efda[_0x6793('0x28')][_0x6793('0x29')][_0x11bfb1][_0x6793('0x2f')]?{'$notIn':_0x14efda['body'][_0x6793('0x29')][_0x11bfb1]}:{'$ne':null}}})['then'](function(_0x18c111){var _0x8abdbf=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x382bbc=0x0,_0x569de4=_0x18c111[_0x6793('0x2f')];_0x382bbc<_0x569de4;_0x382bbc+=0x1){_0x18c111[_0x382bbc][_0x6793('0x30')]({'exitAt':_0x8abdbf});}});for(var _0x3b5236=0x0;_0x3b5236<_0x14efda['body'][_0x6793('0x29')][_0x11bfb1]['length'];_0x3b5236+=0x1){db[_0x6793('0x2c')][_0x6793('0x31')]({'where':{'channel':_0x11bfb1,'membername':_0x14efda[_0x6793('0x2a')][_0x6793('0x11')],'type':_0x6793('0x2e'),'uniqueid':_0x14efda[_0x6793('0x28')][_0x6793('0x29')][_0x11bfb1][_0x3b5236],'exitAt':null},'defaults':{'channel':_0x11bfb1,'membername':_0x14efda[_0x6793('0x2a')]['name'],'interface':_[_0x6793('0x13')](_0x14efda[_0x6793('0x2a')][_0x6793('0x32')])?util['format'](_0x6793('0x33'),_0x14efda[_0x6793('0x2a')][_0x6793('0x11')]):_0x14efda['user'][_0x6793('0x32')],'type':_0x6793('0x2e'),'enterAt':moment()[_0x6793('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x6793('0x35'),'internal':_0x14efda[_0x6793('0x2a')]['internal'],'uniqueid':_0x14efda[_0x6793('0x28')][_0x6793('0x29')][_0x11bfb1][_0x3b5236]}});}}}}return respondWithRpcPromise(_0x6793('0x36'),{'id':_0x14efda[_0x6793('0x18')]['id'],'capacity':_0x14efda['body'][_0x6793('0x37')]},routingClient)[_0x6793('0x16')](respondWithResult(_0x5d24d9,null))[_0x6793('0xc')](handleError(_0x5d24d9,null));};exports[_0x6793('0x38')]=function(_0x56f060,_0x15b2c1){return respondWithRpcPromise(_0x6793('0x39'),_0x56f060[_0x6793('0x15')])[_0x6793('0x16')](respondWithResult(_0x15b2c1,null))[_0x6793('0xc')](handleError(_0x15b2c1,null));};exports[_0x6793('0x3a')]=function(_0xcc5512,_0x7ee70d){return respondWithRpcPromise(_0x6793('0x3b'),_0xcc5512[_0x6793('0x15')])[_0x6793('0x16')](respondWithResult(_0x7ee70d,null))[_0x6793('0xc')](handleError(_0x7ee70d,null));};exports[_0x6793('0x3c')]=function(_0x4a570a,_0x6addf9){return respondWithRpcPromise(_0x6793('0x3d'),_0x4a570a[_0x6793('0x15')])[_0x6793('0x16')](respondWithResult(_0x6addf9,null))[_0x6793('0xc')](handleError(_0x6addf9,null));};exports[_0x6793('0x3e')]=function(_0x1ac2d3,_0x554a82){return respondWithRpcPromise(_0x6793('0x3f'),_0x1ac2d3['query'],routingClient)[_0x6793('0x16')](respondWithResult(_0x554a82,null))['catch'](handleError(_0x554a82,null));};exports[_0x6793('0x40')]=function(_0x24c808,_0x28fe50){return respondWithRpcPromise('ChatQueues',_0x24c808[_0x6793('0x15')],routingClient)['then'](findById(_0x24c808['params']['id']))['then'](respondWithResult(_0x28fe50,null))[_0x6793('0xc')](handleError(_0x28fe50,null));};exports[_0x6793('0x41')]=function(_0x3f281a,_0x58883b){return respondWithRpcPromise(_0x6793('0x42'),_0x3f281a[_0x6793('0x15')],routingClient)[_0x6793('0x16')](respondWithResult(_0x58883b,null))[_0x6793('0xc')](handleError(_0x58883b,null));};exports[_0x6793('0x43')]=function(_0x417655,_0x1b7396){return respondWithRpcPromise(_0x6793('0x42'),_0x417655[_0x6793('0x15')],routingClient)[_0x6793('0x16')](findById(_0x417655[_0x6793('0x18')]['id']))['then'](respondWithResult(_0x1b7396,null))[_0x6793('0xc')](handleError(_0x1b7396,null));};exports['mailAccounts']=function(_0x322477,_0x4ba402){return respondWithRpcPromise(_0x6793('0x44'),_0x322477[_0x6793('0x15')],mailClient)[_0x6793('0x16')](respondWithResult(_0x4ba402,null))[_0x6793('0xc')](handleError(_0x4ba402,null));};exports[_0x6793('0x45')]=function(_0x30365a,_0x29190f){return respondWithRpcPromise(_0x6793('0x46'),_0x30365a[_0x6793('0x15')],routingClient)[_0x6793('0x16')](respondWithResult(_0x29190f,null))[_0x6793('0xc')](handleError(_0x29190f,null));};exports['showOpenchannelQueues']=function(_0x1741f0,_0x102b7a){return respondWithRpcPromise(_0x6793('0x46'),_0x1741f0[_0x6793('0x15')],routingClient)[_0x6793('0x16')](findById(_0x1741f0[_0x6793('0x18')]['id']))[_0x6793('0x16')](respondWithResult(_0x102b7a,null))[_0x6793('0xc')](handleError(_0x102b7a,null));};exports['smsQueues']=function(_0x3d17a7,_0x480227){return respondWithRpcPromise(_0x6793('0x47'),_0x3d17a7[_0x6793('0x15')],routingClient)[_0x6793('0x16')](respondWithResult(_0x480227,null))[_0x6793('0xc')](handleError(_0x480227,null));};exports['showSmsQueues']=function(_0xf11961,_0x4eb62a){return respondWithRpcPromise('SmsQueues',_0xf11961[_0x6793('0x15')],routingClient)[_0x6793('0x16')](findById(_0xf11961['params']['id']))[_0x6793('0x16')](respondWithResult(_0x4eb62a,null))[_0x6793('0xc')](handleError(_0x4eb62a,null));};exports[_0x6793('0x48')]=function(_0x190ea5,_0x1e70f1){return respondWithRpcPromise(_0x6793('0x49'),_0x190ea5[_0x6793('0x15')],routingClient)[_0x6793('0x16')](respondWithResult(_0x1e70f1,null))[_0x6793('0xc')](handleError(_0x1e70f1,null));};exports[_0x6793('0x4a')]=function(_0x2fef45,_0x2080ed){return respondWithRpcPromise(_0x6793('0x49'),_0x2fef45[_0x6793('0x15')],routingClient)[_0x6793('0x16')](findById(_0x2fef45[_0x6793('0x18')]['id']))[_0x6793('0x16')](respondWithResult(_0x2080ed,null))['catch'](handleError(_0x2080ed,null));};exports[_0x6793('0x4b')]=function(_0x586d48,_0x397369){return respondWithRpcPromise('FaxAccounts',_0x586d48[_0x6793('0x15')])['then'](respondWithResult(_0x397369,null))[_0x6793('0xc')](handleError(_0x397369,null));};exports[_0x6793('0x4c')]=function(_0x47f576,_0x2eb1ed){return respondWithRpcPromise(_0x6793('0x4d'),_0x47f576[_0x6793('0x15')],routingClient)[_0x6793('0x16')](respondWithResult(_0x2eb1ed,null))[_0x6793('0xc')](handleError(_0x2eb1ed,null));};exports[_0x6793('0x4e')]=function(_0x1c049a,_0x51e11e){return respondWithRpcPromise(_0x6793('0x4f'),_0x1c049a['query'],routingClient)[_0x6793('0x16')](respondWithResult(_0x51e11e,null))[_0x6793('0xc')](handleError(_0x51e11e,null));};exports[_0x6793('0x50')]=function(_0x3736b4,_0x389dfc){return respondWithRpcPromise(_0x6793('0x51'),_0x3736b4[_0x6793('0x15')],routingClient)['then'](respondWithResult(_0x389dfc,null))[_0x6793('0xc')](handleError(_0x389dfc,null));};exports['smsQueuesWaitingInteractions']=function(_0x116849,_0x3c44ad){return respondWithRpcPromise(_0x6793('0x52'),_0x116849['query'],routingClient)[_0x6793('0x16')](respondWithResult(_0x3c44ad,null))['catch'](handleError(_0x3c44ad,null));};exports['faxQueuesWaitingInteractions']=function(_0x385ad0,_0x27851a){return respondWithRpcPromise(_0x6793('0x53'),_0x385ad0['query'],routingClient)['then'](respondWithResult(_0x27851a,null))[_0x6793('0xc')](handleError(_0x27851a,null));};exports[_0x6793('0x54')]=function(_0x1c5afd){return function(_0x4df548,_0x4b73f5){var _0x23da53,_0x4a2bca;var _0x4f26a2=_[_0x6793('0x55')](_0x1c5afd);var _0x1edcd4=_0x1c5afd===_0x6793('0x56')?_0x6793('0x57'):_0x6793('0x58');return db[_0x4f26a2+'Queue'][_0x6793('0x59')]({'raw':!![],'where':{'id':_0x4df548[_0x6793('0x18')]['id']}})[_0x6793('0x16')](function(_0x209bf4){if(_[_0x6793('0x13')](_0x209bf4)){throw new Error(_0x4f26a2+_0x6793('0x5a'));}_0x23da53=_0x209bf4;return db[_0x4f26a2+_0x6793('0x5b')][_0x6793('0x59')]({'where':{'id':_0x4df548[_0x6793('0x28')][_0x6793('0x5c')]},'include':[{'model':db[_0x4f26a2+_0x6793('0x5d')],'as':_0x6793('0x5d')},{'model':db[_0x4f26a2+_0x1edcd4],'as':'Account'}]});})[_0x6793('0x16')](function(_0x333634){if(_[_0x6793('0x13')](_0x333634)){throw new Error(_0x4f26a2+_0x6793('0x5e'));}_0x4a2bca=_0x333634;return _0x333634[_0x6793('0x5f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6793('0x16')](function(){var _0x159a63={'uniqueid':_0x1c5afd+'.'+_0x4a2bca['id']+'.'+_0x4a2bca[_0x6793('0x5d')]['id'],'FromUserId':_0x4df548['user']['id'],'type':_0x6793('0x60')};_0x159a63[_0x4f26a2+'MessageId']=_0x4a2bca['id'];_0x159a63[_0x4f26a2+_0x6793('0x61')]=_0x4a2bca[_0x6793('0x5d')]['id'];_0x159a63[_0x6793('0x62')+_0x4f26a2+_0x1edcd4+'Id']=_0x4a2bca[_0x6793('0x58')]['id'];_0x159a63['To'+_0x4f26a2+_0x6793('0x63')]=_0x23da53['id'];return db[_0x4f26a2+_0x6793('0x64')][_0x6793('0x65')](_0x159a63);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x1c5afd,'interaction':_0x4a2bca[_0x6793('0x5d')],'message':_0x4a2bca,'account':_0x4a2bca[_0x6793('0x58')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x23da53[_0x6793('0x11')]+','+(_0x4a2bca[_0x6793('0x58')][_0x6793('0x66')]||0x12c),'interval':_0x6793('0x67')}]},routingClient);})[_0x6793('0x16')](respondWithResult(_0x4b73f5,null))[_0x6793('0xc')](handleError(_0x4b73f5,null));};};exports['agentNotify']=function(_0x23e749,_0x5aa312){var _0x967b65,_0x5d8c74;if(_[_0x6793('0x13')](_0x23e749['body'][_0x6793('0x68')])){throw new Error(_0x6793('0x69'));}var _0x34d17d=_0x23e749[_0x6793('0x28')][_0x6793('0x68')];var _0x95127e=_[_0x6793('0x55')](_0x34d17d);var _0x44373b=_0x34d17d==='chat'?_0x6793('0x57'):_0x6793('0x58');return db[_0x6793('0x6a')][_0x6793('0x59')]({'raw':!![],'where':{'id':_0x23e749[_0x6793('0x18')]['id'],'role':_0x6793('0x35')}})['then'](function(_0x1ce5f2){if(_['isNil'](_0x1ce5f2)){throw new Error(_0x6793('0x6b'));}_0x967b65=_0x1ce5f2;return db[_0x95127e+_0x6793('0x5b')][_0x6793('0x59')]({'where':{'id':_0x23e749[_0x6793('0x28')][_0x6793('0x5c')]},'include':[{'model':db[_0x95127e+'Interaction'],'as':'Interaction'},{'model':db[_0x95127e+_0x44373b],'as':_0x6793('0x58')}]});})[_0x6793('0x16')](function(_0x298e04){if(_[_0x6793('0x13')](_0x298e04)){throw new Error(_0x95127e+_0x6793('0x5e'));}_0x5d8c74=_0x298e04;return _0x298e04['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x6793('0x16')](function(){var _0x2cffa3={'uniqueid':_0x34d17d+'.'+_0x5d8c74['id']+'.'+_0x5d8c74[_0x6793('0x5d')]['id'],'FromUserId':_0x23e749['user']['id'],'type':'queue','ToUserId':_0x967b65['id']};_0x2cffa3[_0x95127e+_0x6793('0x6c')]=_0x5d8c74['id'];_0x2cffa3[_0x95127e+_0x6793('0x61')]=_0x5d8c74['Interaction']['id'];_0x2cffa3[_0x6793('0x62')+_0x95127e+_0x44373b+'Id']=_0x5d8c74[_0x6793('0x58')]['id'];return db[_0x95127e+_0x6793('0x64')][_0x6793('0x65')](_0x2cffa3);})[_0x6793('0x16')](function(){return respondWithRpcPromise('Start',{'channel':_0x34d17d,'interaction':_0x5d8c74[_0x6793('0x5d')],'message':_0x5d8c74,'account':_0x5d8c74[_0x6793('0x58')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x967b65[_0x6793('0x11')]+','+(_0x5d8c74['Account'][_0x6793('0x6d')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x6793('0x16')](respondWithResult(_0x5aa312,null))[_0x6793('0xc')](handleError(_0x5aa312,null));};
\ No newline at end of file
+var _0x159c=['capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','Agent\x20not\x20found','TransferReport','create','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','code','message','result','catch','status','json','sendStatus','send','isNil','find','rows','voiceChannels','VoiceChannels','query','then','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','Agents','agentCapacity','body','interaction','name','MemberReport','findAll','user','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','length','interface','SIP/%s','INTERACTION','agent','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showFaxQueues','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify'];(function(_0x295f4e,_0x62822e){var _0x454dc8=function(_0x6c0c1c){while(--_0x6c0c1c){_0x295f4e['push'](_0x295f4e['shift']());}};_0x454dc8(++_0x62822e);}(_0x159c,0x88));var _0xc159=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x159c[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0xc159('0x0'));var moment=require(_0xc159('0x1'));var _=require(_0xc159('0x2'));var util=require('util');var db=require(_0xc159('0x3'))['db'];var logger=require(_0xc159('0x4'))(_0xc159('0x5'));var jayson=require(_0xc159('0x6'));var amiClient=jayson[_0xc159('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0xc159('0x7')][_0xc159('0x8')]({'port':0x232b});var routingClient=jayson[_0xc159('0x7')][_0xc159('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x25981b,_0x4d3a97,_0x151b1a){return new BPromise(function(_0xaddc87,_0x27030f){var _0x3cf415=_0x151b1a?_0x151b1a:amiClient;return _0x3cf415[_0xc159('0x9')](_0x25981b,_0x4d3a97)['then'](function(_0x3c9a66){if(_0x3c9a66[_0xc159('0xa')]){if(_0x3c9a66[_0xc159('0xa')][_0xc159('0xb')]===0x1f4){return _0x27030f(_0x3c9a66['error']['message']);}return _0xaddc87(_0x3c9a66['error'][_0xc159('0xc')]);}else{_0xaddc87(_0x3c9a66[_0xc159('0xd')]);}})[_0xc159('0xe')](function(_0xf91bd3){_0x27030f(_0xf91bd3);});});}function respondWithResult(_0x20ed78,_0x115a97){_0x115a97=_0x115a97||0xc8;return function(_0x46dcb3){if(_0x46dcb3){return _0x20ed78[_0xc159('0xf')](_0x115a97)[_0xc159('0x10')](_0x46dcb3);}return _0x20ed78[_0xc159('0x11')](0x194);};}function handleError(_0x288342,_0x4917a2){_0x4917a2=_0x4917a2||0x1f4;return function(_0x20f07d){logger['error'](_0x20f07d['stack']);if(_0x20f07d['name']){delete _0x20f07d['name'];}_0x288342[_0xc159('0xf')](_0x4917a2)[_0xc159('0x12')](_0x20f07d);};}function findById(_0x264965){return function(_0x473f64){if(!_[_0xc159('0x13')](_0x264965)&&!_['isNil'](_0x473f64)&&!_[_0xc159('0x13')](_0x473f64['rows'])){return _[_0xc159('0x14')](_0x473f64[_0xc159('0x15')],function(_0x54116b){return _0x54116b['id']==_0x264965;});}return null;};}exports[_0xc159('0x16')]=function(_0x22cc28,_0x46cbca){return respondWithRpcPromise(_0xc159('0x17'),_0x22cc28[_0xc159('0x18')])[_0xc159('0x19')](respondWithResult(_0x46cbca,null))['catch'](handleError(_0x46cbca,null));};exports['voiceChannelMixMonitor']=function(_0x440347,_0x4ff42b){return respondWithRpcPromise(_0xc159('0x1a'),_[_0xc159('0x1b')](_0x440347[_0xc159('0x18')],_0x440347[_0xc159('0x1c')]))[_0xc159('0x19')](respondWithResult(_0x4ff42b,null))[_0xc159('0xe')](handleError(_0x4ff42b,null));};exports[_0xc159('0x1d')]=function(_0x25abe9,_0x3d2b50){return respondWithRpcPromise(_0xc159('0x1e'),_[_0xc159('0x1b')](_0x25abe9[_0xc159('0x18')],_0x25abe9[_0xc159('0x1c')]))[_0xc159('0x19')](respondWithResult(_0x3d2b50,null))[_0xc159('0xe')](handleError(_0x3d2b50,null));};exports['voiceQueues']=function(_0x1278d0,_0xdb1bcb){return respondWithRpcPromise(_0xc159('0x1f'),_0x1278d0[_0xc159('0x18')])[_0xc159('0x19')](respondWithResult(_0xdb1bcb,null))[_0xc159('0xe')](handleError(_0xdb1bcb,null));};exports[_0xc159('0x20')]=function(_0x19605f,_0x740212){return respondWithRpcPromise('VoiceQueues',_0x19605f[_0xc159('0x18')])[_0xc159('0x19')](findById(_0x19605f[_0xc159('0x1c')]['id']))['then'](respondWithResult(_0x740212,null))[_0xc159('0xe')](handleError(_0x740212,null));};exports[_0xc159('0x21')]=function(_0x40f7a6,_0x3f370a){return respondWithRpcPromise(_0xc159('0x22'),_[_0xc159('0x1b')](_0x40f7a6[_0xc159('0x18')],_0x40f7a6[_0xc159('0x1c')]))[_0xc159('0x19')](respondWithResult(_0x3f370a,null))['catch'](handleError(_0x3f370a,null));};exports[_0xc159('0x23')]=function(_0xefc38,_0xc0e2e8){return respondWithRpcPromise(_0xc159('0x24'),_0xefc38['query'])[_0xc159('0x19')](respondWithResult(_0xc0e2e8,null))[_0xc159('0xe')](handleError(_0xc0e2e8,null));};exports[_0xc159('0x25')]=function(_0x147557,_0x3f08e9){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xc159('0x1b')](_0x147557[_0xc159('0x18')],_0x147557[_0xc159('0x1c')]))[_0xc159('0x19')](respondWithResult(_0x3f08e9,null))[_0xc159('0xe')](handleError(_0x3f08e9,null));};exports[_0xc159('0x26')]=function(_0x95e3d,_0x200da2){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xc159('0x1b')](_0x95e3d[_0xc159('0x18')],_0x95e3d[_0xc159('0x1c')]))[_0xc159('0x19')](respondWithResult(_0x200da2,null))[_0xc159('0xe')](handleError(_0x200da2,null));};exports[_0xc159('0x27')]=function(_0x4df7a9,_0x5805df){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_['merge'](_0x4df7a9[_0xc159('0x18')],_0x4df7a9[_0xc159('0x1c')]))[_0xc159('0x19')](respondWithResult(_0x5805df,null))[_0xc159('0xe')](handleError(_0x5805df,null));};exports[_0xc159('0x28')]=function(_0x195ce2,_0x15fb7c){return respondWithRpcPromise(_0xc159('0x29'),_0x195ce2[_0xc159('0x18')])['then'](respondWithResult(_0x15fb7c,null))[_0xc159('0xe')](handleError(_0x15fb7c,null));};exports['outboundChannels']=function(_0x6ef210,_0x35dbf4){return respondWithRpcPromise(_0xc159('0x2a'),_0x6ef210[_0xc159('0x18')])[_0xc159('0x19')](respondWithResult(_0x35dbf4,null))[_0xc159('0xe')](handleError(_0x35dbf4,null));};exports['agents']=function(_0x182349,_0x197361){var _0x2d9870;return respondWithRpcPromise(_0xc159('0x2b'),_0x182349[_0xc159('0x18')])[_0xc159('0x19')](function(_0x2fb5e8){_0x2d9870=_0x2fb5e8;return respondWithRpcPromise(_0xc159('0x2b'),_0x182349['query'],routingClient);})['then'](function(_0x11ccaf){return _[_0xc159('0x1b')]({},_0x11ccaf,_0x2d9870);})['then'](respondWithResult(_0x197361,null))[_0xc159('0xe')](handleError(_0x197361,null));};exports[_0xc159('0x2c')]=function(_0x3866d4,_0x4f301d){if(_0x3866d4[_0xc159('0x2d')]&&_0x3866d4[_0xc159('0x2d')][_0xc159('0x2e')]&&_0x3866d4['user']&&_0x3866d4['user'][_0xc159('0x2f')]){for(var _0x10d99e in _0x3866d4[_0xc159('0x2d')][_0xc159('0x2e')]){if(_0x3866d4['body'][_0xc159('0x2e')]['hasOwnProperty'](_0x10d99e)){db[_0xc159('0x30')][_0xc159('0x31')]({'where':{'channel':_0x10d99e,'membername':_0x3866d4[_0xc159('0x32')][_0xc159('0x2f')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3866d4['body'][_0xc159('0x2e')][_0x10d99e]&&_0x3866d4['body'][_0xc159('0x2e')][_0x10d99e]['length']?{'$notIn':_0x3866d4[_0xc159('0x2d')][_0xc159('0x2e')][_0x10d99e]}:{'$ne':null}}})[_0xc159('0x19')](function(_0x850ca9){var _0x591f96=moment()[_0xc159('0x33')](_0xc159('0x34'));for(var _0x149a69=0x0,_0x3ed31b=_0x850ca9['length'];_0x149a69<_0x3ed31b;_0x149a69+=0x1){_0x850ca9[_0x149a69][_0xc159('0x35')]({'exitAt':_0x591f96});}});for(var _0x277bbb=0x0;_0x277bbb<_0x3866d4[_0xc159('0x2d')][_0xc159('0x2e')][_0x10d99e][_0xc159('0x36')];_0x277bbb+=0x1){db[_0xc159('0x30')]['findOrCreate']({'where':{'channel':_0x10d99e,'membername':_0x3866d4[_0xc159('0x32')][_0xc159('0x2f')],'type':'INTERACTION','uniqueid':_0x3866d4[_0xc159('0x2d')][_0xc159('0x2e')][_0x10d99e][_0x277bbb],'exitAt':null},'defaults':{'channel':_0x10d99e,'membername':_0x3866d4[_0xc159('0x32')][_0xc159('0x2f')],'interface':_[_0xc159('0x13')](_0x3866d4[_0xc159('0x32')][_0xc159('0x37')])?util[_0xc159('0x33')](_0xc159('0x38'),_0x3866d4[_0xc159('0x32')]['name']):_0x3866d4[_0xc159('0x32')]['interface'],'type':_0xc159('0x39'),'enterAt':moment()['format'](_0xc159('0x34')),'role':_0xc159('0x3a'),'internal':_0x3866d4[_0xc159('0x32')][_0xc159('0x3b')],'uniqueid':_0x3866d4[_0xc159('0x2d')]['interaction'][_0x10d99e][_0x277bbb]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3866d4[_0xc159('0x1c')]['id'],'capacity':_0x3866d4[_0xc159('0x2d')][_0xc159('0x3c')]},routingClient)[_0xc159('0x19')](respondWithResult(_0x4f301d,null))[_0xc159('0xe')](handleError(_0x4f301d,null));};exports[_0xc159('0x3d')]=function(_0x5a5532,_0x264ca5){return respondWithRpcPromise(_0xc159('0x3e'),_0x5a5532['query'])[_0xc159('0x19')](respondWithResult(_0x264ca5,null))[_0xc159('0xe')](handleError(_0x264ca5,null));};exports[_0xc159('0x3f')]=function(_0x4c54f6,_0x53c149){return respondWithRpcPromise(_0xc159('0x40'),_0x4c54f6[_0xc159('0x18')])['then'](respondWithResult(_0x53c149,null))[_0xc159('0xe')](handleError(_0x53c149,null));};exports[_0xc159('0x41')]=function(_0x494984,_0x4ca6a4){return respondWithRpcPromise(_0xc159('0x42'),_0x494984[_0xc159('0x18')])[_0xc159('0x19')](respondWithResult(_0x4ca6a4,null))[_0xc159('0xe')](handleError(_0x4ca6a4,null));};exports[_0xc159('0x43')]=function(_0x2cf994,_0x3bae62){return respondWithRpcPromise(_0xc159('0x44'),_0x2cf994[_0xc159('0x18')],routingClient)[_0xc159('0x19')](respondWithResult(_0x3bae62,null))[_0xc159('0xe')](handleError(_0x3bae62,null));};exports[_0xc159('0x45')]=function(_0x3b9e00,_0x2370aa){return respondWithRpcPromise(_0xc159('0x44'),_0x3b9e00[_0xc159('0x18')],routingClient)[_0xc159('0x19')](findById(_0x3b9e00[_0xc159('0x1c')]['id']))[_0xc159('0x19')](respondWithResult(_0x2370aa,null))['catch'](handleError(_0x2370aa,null));};exports[_0xc159('0x46')]=function(_0x3fcbcc,_0x4519e8){return respondWithRpcPromise(_0xc159('0x47'),_0x3fcbcc[_0xc159('0x18')],routingClient)[_0xc159('0x19')](respondWithResult(_0x4519e8,null))[_0xc159('0xe')](handleError(_0x4519e8,null));};exports[_0xc159('0x48')]=function(_0x2e5bea,_0x4f52dd){return respondWithRpcPromise('MailQueues',_0x2e5bea[_0xc159('0x18')],routingClient)[_0xc159('0x19')](findById(_0x2e5bea[_0xc159('0x1c')]['id']))['then'](respondWithResult(_0x4f52dd,null))[_0xc159('0xe')](handleError(_0x4f52dd,null));};exports[_0xc159('0x49')]=function(_0x1ece62,_0x1d53e2){return respondWithRpcPromise(_0xc159('0x4a'),_0x1ece62[_0xc159('0x18')],mailClient)[_0xc159('0x19')](respondWithResult(_0x1d53e2,null))[_0xc159('0xe')](handleError(_0x1d53e2,null));};exports[_0xc159('0x4b')]=function(_0x30af95,_0x28416d){return respondWithRpcPromise(_0xc159('0x4c'),_0x30af95[_0xc159('0x18')],routingClient)[_0xc159('0x19')](respondWithResult(_0x28416d,null))['catch'](handleError(_0x28416d,null));};exports[_0xc159('0x4d')]=function(_0x161473,_0xbdd3dd){return respondWithRpcPromise('OpenchannelQueues',_0x161473['query'],routingClient)[_0xc159('0x19')](findById(_0x161473[_0xc159('0x1c')]['id']))[_0xc159('0x19')](respondWithResult(_0xbdd3dd,null))[_0xc159('0xe')](handleError(_0xbdd3dd,null));};exports['smsQueues']=function(_0x34c214,_0x5ca43a){return respondWithRpcPromise(_0xc159('0x4e'),_0x34c214[_0xc159('0x18')],routingClient)['then'](respondWithResult(_0x5ca43a,null))[_0xc159('0xe')](handleError(_0x5ca43a,null));};exports['showSmsQueues']=function(_0x4a5ed1,_0x33fedf){return respondWithRpcPromise(_0xc159('0x4e'),_0x4a5ed1[_0xc159('0x18')],routingClient)[_0xc159('0x19')](findById(_0x4a5ed1[_0xc159('0x1c')]['id']))[_0xc159('0x19')](respondWithResult(_0x33fedf,null))[_0xc159('0xe')](handleError(_0x33fedf,null));};exports['faxQueues']=function(_0x2d8097,_0x27d7a1){return respondWithRpcPromise('FaxQueues',_0x2d8097[_0xc159('0x18')],routingClient)[_0xc159('0x19')](respondWithResult(_0x27d7a1,null))['catch'](handleError(_0x27d7a1,null));};exports[_0xc159('0x4f')]=function(_0x9e11d0,_0x1f1c54){return respondWithRpcPromise('FaxQueues',_0x9e11d0[_0xc159('0x18')],routingClient)[_0xc159('0x19')](findById(_0x9e11d0[_0xc159('0x1c')]['id']))['then'](respondWithResult(_0x1f1c54,null))[_0xc159('0xe')](handleError(_0x1f1c54,null));};exports['faxAccounts']=function(_0x35b52f,_0x49d57a){return respondWithRpcPromise('FaxAccounts',_0x35b52f[_0xc159('0x18')])[_0xc159('0x19')](respondWithResult(_0x49d57a,null))[_0xc159('0xe')](handleError(_0x49d57a,null));};exports[_0xc159('0x50')]=function(_0x3db3a8,_0x5b34e8){return respondWithRpcPromise(_0xc159('0x51'),_0x3db3a8['query'],routingClient)['then'](respondWithResult(_0x5b34e8,null))['catch'](handleError(_0x5b34e8,null));};exports[_0xc159('0x52')]=function(_0x2d74d5,_0xdfff4f){return respondWithRpcPromise(_0xc159('0x53'),_0x2d74d5[_0xc159('0x18')],routingClient)[_0xc159('0x19')](respondWithResult(_0xdfff4f,null))['catch'](handleError(_0xdfff4f,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x2ee008,_0x2d6c1b){return respondWithRpcPromise(_0xc159('0x54'),_0x2ee008['query'],routingClient)[_0xc159('0x19')](respondWithResult(_0x2d6c1b,null))[_0xc159('0xe')](handleError(_0x2d6c1b,null));};exports[_0xc159('0x55')]=function(_0x387c5f,_0x50634d){return respondWithRpcPromise(_0xc159('0x56'),_0x387c5f['query'],routingClient)['then'](respondWithResult(_0x50634d,null))['catch'](handleError(_0x50634d,null));};exports[_0xc159('0x57')]=function(_0x513a8e,_0x1fc3ba){return respondWithRpcPromise(_0xc159('0x58'),_0x513a8e[_0xc159('0x18')],routingClient)[_0xc159('0x19')](respondWithResult(_0x1fc3ba,null))['catch'](handleError(_0x1fc3ba,null));};exports[_0xc159('0x59')]=function(_0x1366f8){return function(_0x371153,_0x2da0c8){var _0x453800,_0x105d7a;var _0x5c7252=_[_0xc159('0x5a')](_0x1366f8);var _0x544ffc=_0x1366f8===_0xc159('0x5b')?_0xc159('0x5c'):_0xc159('0x5d');return db[_0x5c7252+_0xc159('0x5e')][_0xc159('0x5f')]({'raw':!![],'where':{'id':_0x371153[_0xc159('0x1c')]['id']}})[_0xc159('0x19')](function(_0x216ef9){if(_[_0xc159('0x13')](_0x216ef9)){throw new Error(_0x5c7252+_0xc159('0x60'));}_0x453800=_0x216ef9;return db[_0x5c7252+_0xc159('0x61')][_0xc159('0x5f')]({'where':{'id':_0x371153[_0xc159('0x2d')][_0xc159('0x62')]},'include':[{'model':db[_0x5c7252+'Interaction'],'as':_0xc159('0x63')},{'model':db[_0x5c7252+_0x544ffc],'as':_0xc159('0x5d')}]});})[_0xc159('0x19')](function(_0xf94ff){if(_['isNil'](_0xf94ff)){throw new Error(_0x5c7252+_0xc159('0x64'));}_0x105d7a=_0xf94ff;return _0xf94ff[_0xc159('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0xc159('0x19')](function(){var _0x260ae0={'uniqueid':_0x1366f8+'.'+_0x105d7a['id']+'.'+_0x105d7a[_0xc159('0x63')]['id'],'FromUserId':_0x371153[_0xc159('0x32')]['id'],'type':_0xc159('0x66')};_0x260ae0[_0x5c7252+'MessageId']=_0x105d7a['id'];_0x260ae0[_0x5c7252+_0xc159('0x67')]=_0x105d7a[_0xc159('0x63')]['id'];_0x260ae0[_0xc159('0x68')+_0x5c7252+_0x544ffc+'Id']=_0x105d7a[_0xc159('0x5d')]['id'];_0x260ae0['To'+_0x5c7252+'QueueId']=_0x453800['id'];return db[_0x5c7252+'TransferReport']['create'](_0x260ae0);})['then'](function(){return respondWithRpcPromise(_0xc159('0x69'),{'channel':_0x1366f8,'interaction':_0x105d7a['Interaction'],'message':_0x105d7a,'account':_0x105d7a[_0xc159('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':_0xc159('0x66'),'appdata':_0x453800[_0xc159('0x2f')]+','+(_0x105d7a[_0xc159('0x5d')][_0xc159('0x6a')]||0x12c),'interval':_0xc159('0x6b')}]},routingClient);})[_0xc159('0x19')](respondWithResult(_0x2da0c8,null))[_0xc159('0xe')](handleError(_0x2da0c8,null));};};exports['agentNotify']=function(_0x2170be,_0x10fc33){var _0x389496,_0x5b4aaa;if(_['isNil'](_0x2170be[_0xc159('0x2d')][_0xc159('0x6c')])){throw new Error(_0xc159('0x6d'));}var _0x5d54b8=_0x2170be[_0xc159('0x2d')]['channel'];var _0x1aa57d=_[_0xc159('0x5a')](_0x5d54b8);var _0x9c6db9=_0x5d54b8===_0xc159('0x5b')?'Website':_0xc159('0x5d');return db['User'][_0xc159('0x5f')]({'raw':!![],'where':{'id':_0x2170be['params']['id'],'role':'agent'}})['then'](function(_0x37cbd8){if(_[_0xc159('0x13')](_0x37cbd8)){throw new Error(_0xc159('0x6e'));}_0x389496=_0x37cbd8;return db[_0x1aa57d+'Message'][_0xc159('0x5f')]({'where':{'id':_0x2170be[_0xc159('0x2d')]['messageId']},'include':[{'model':db[_0x1aa57d+_0xc159('0x63')],'as':_0xc159('0x63')},{'model':db[_0x1aa57d+_0x9c6db9],'as':_0xc159('0x5d')}]});})[_0xc159('0x19')](function(_0x2b7f8a){if(_['isNil'](_0x2b7f8a)){throw new Error(_0x1aa57d+_0xc159('0x64'));}_0x5b4aaa=_0x2b7f8a;return _0x2b7f8a[_0xc159('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0xc159('0x19')](function(){var _0x57be15={'uniqueid':_0x5d54b8+'.'+_0x5b4aaa['id']+'.'+_0x5b4aaa['Interaction']['id'],'FromUserId':_0x2170be['user']['id'],'type':_0xc159('0x66'),'ToUserId':_0x389496['id']};_0x57be15[_0x1aa57d+'MessageId']=_0x5b4aaa['id'];_0x57be15[_0x1aa57d+'InteractionId']=_0x5b4aaa[_0xc159('0x63')]['id'];_0x57be15[_0xc159('0x68')+_0x1aa57d+_0x9c6db9+'Id']=_0x5b4aaa['Account']['id'];return db[_0x1aa57d+_0xc159('0x6f')][_0xc159('0x70')](_0x57be15);})[_0xc159('0x19')](function(){return respondWithRpcPromise(_0xc159('0x69'),{'channel':_0x5d54b8,'interaction':_0x5b4aaa[_0xc159('0x63')],'message':_0x5b4aaa,'account':_0x5b4aaa[_0xc159('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x389496[_0xc159('0x2f')]+','+(_0x5b4aaa[_0xc159('0x5d')]['agentTransferTimeout']||0x12c),'interval':_0xc159('0x6b')}]},routingClient);})[_0xc159('0x19')](respondWithResult(_0x10fc33,null))[_0xc159('0xe')](handleError(_0x10fc33,null));};
\ No newline at end of file