Built motion from commit 43538d75.|2.5.35
[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 _0x2fa5=['message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4ea380,_0x3244fc){var _0x452fda=function(_0x4c72e0){while(--_0x4c72e0){_0x4ea380['push'](_0x4ea380['shift']());}};_0x452fda(++_0x3244fc);}(_0x2fa5,0xa3));var _0x52fa=function(_0x5e4ecd,_0x54f6e3){_0x5e4ecd=_0x5e4ecd-0x0;var _0x2b2c16=_0x2fa5[_0x5e4ecd];return _0x2b2c16;};'use strict';var _=require(_0x52fa('0x0'));var util=require(_0x52fa('0x1'));var moment=require(_0x52fa('0x2'));var BPromise=require(_0x52fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x52fa('0x5'));var logger=require('../../config/logger')(_0x52fa('0x6'));var config=require('../../config/environment');var jayson=require(_0x52fa('0x7'));var client=jayson[_0x52fa('0x8')][_0x52fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30ffe0,_0xa549b4,_0xe118){return new BPromise(function(_0x52ce0c,_0x591268){return client[_0x52fa('0xa')](_0x30ffe0,_0xe118)[_0x52fa('0xb')](function(_0x51fc7e){logger['info'](_0x52fa('0xc'),_0xa549b4,'request\x20sent');logger['debug'](_0x52fa('0xd'),_0xa549b4,_0x52fa('0xe'),JSON[_0x52fa('0xf')](_0x51fc7e));if(_0x51fc7e['error']){if(_0x51fc7e['error']['code']===0x1f4){logger[_0x52fa('0x10')](_0x52fa('0xc'),_0xa549b4,_0x51fc7e[_0x52fa('0x10')][_0x52fa('0x11')]);return _0x591268(_0x51fc7e[_0x52fa('0x10')][_0x52fa('0x11')]);}logger[_0x52fa('0x10')](_0x52fa('0xc'),_0xa549b4,_0x51fc7e[_0x52fa('0x10')][_0x52fa('0x11')]);return _0x52ce0c(_0x51fc7e[_0x52fa('0x10')]['message']);}else{logger[_0x52fa('0x12')](_0x52fa('0xc'),_0xa549b4,_0x52fa('0xe'));_0x52ce0c(_0x51fc7e['result']['message']);}})[_0x52fa('0x13')](function(_0x5dba09){logger[_0x52fa('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0xa549b4,_0x5dba09);_0x591268(_0x5dba09);});});}