Built motion from commit e6806ed6.|2.6.0
[motion2.git] / server / api / teamVoiceQueue / teamVoiceQueue.rpc.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 _0x77a4=['result','lodash','util','moment','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x43fa0a,_0x14f1a9){var _0x570155=function(_0x140687){while(--_0x140687){_0x43fa0a['push'](_0x43fa0a['shift']());}};_0x570155(++_0x14f1a9);}(_0x77a4,0x155));var _0x477a=function(_0x143565,_0x54d887){_0x143565=_0x143565-0x0;var _0x4dc1d9=_0x77a4[_0x143565];return _0x4dc1d9;};'use strict';var _=require(_0x477a('0x0'));var util=require(_0x477a('0x1'));var moment=require(_0x477a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x477a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x477a('0x4'))(_0x477a('0x5'));var config=require('../../config/environment');var jayson=require(_0x477a('0x6'));var client=jayson['client'][_0x477a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x29d2c0,_0x15e6fe,_0x217ce0){return new BPromise(function(_0xbfea2a,_0x68568a){return client[_0x477a('0x8')](_0x29d2c0,_0x217ce0)[_0x477a('0x9')](function(_0x54e662){logger[_0x477a('0xa')](_0x477a('0xb'),_0x15e6fe,'request\x20sent');logger[_0x477a('0xc')](_0x477a('0xd'),_0x15e6fe,_0x477a('0xe'),JSON[_0x477a('0xf')](_0x54e662));if(_0x54e662[_0x477a('0x10')]){if(_0x54e662[_0x477a('0x10')][_0x477a('0x11')]===0x1f4){logger[_0x477a('0x10')](_0x477a('0xb'),_0x15e6fe,_0x54e662[_0x477a('0x10')]['message']);return _0x68568a(_0x54e662[_0x477a('0x10')][_0x477a('0x12')]);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x15e6fe,_0x54e662[_0x477a('0x10')][_0x477a('0x12')]);return _0xbfea2a(_0x54e662[_0x477a('0x10')][_0x477a('0x12')]);}else{logger[_0x477a('0xa')](_0x477a('0xb'),_0x15e6fe,_0x477a('0xe'));_0xbfea2a(_0x54e662[_0x477a('0x13')][_0x477a('0x12')]);}})['catch'](function(_0x1fa947){logger[_0x477a('0x10')](_0x477a('0xb'),_0x15e6fe,_0x1fa947);_0x68568a(_0x1fa947);});});}