Built motion from commit 1fa89557.|2.6.10
[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 _0x710e=['result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b3032,_0xb06e2d){var _0x139f4d=function(_0x31a55d){while(--_0x31a55d){_0x4b3032['push'](_0x4b3032['shift']());}};_0x139f4d(++_0xb06e2d);}(_0x710e,0xb6));var _0xe710=function(_0x1b7c22,_0x25b097){_0x1b7c22=_0x1b7c22-0x0;var _0x41891b=_0x710e[_0x1b7c22];return _0x41891b;};'use strict';var _=require(_0xe710('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe710('0x1'));var rs=require(_0xe710('0x2'));var fs=require('fs');var Redis=require(_0xe710('0x3'));var db=require(_0xe710('0x4'))['db'];var utils=require(_0xe710('0x5'));var logger=require('../../config/logger')(_0xe710('0x6'));var config=require(_0xe710('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe710('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x302291,_0x205db2,_0x211a33){return new BPromise(function(_0xf86a0f,_0x19ab1d){return client['request'](_0x302291,_0x211a33)['then'](function(_0x58d510){logger[_0xe710('0x9')](_0xe710('0xa'),_0x205db2,_0xe710('0xb'));logger[_0xe710('0xc')](_0xe710('0xd'),_0x205db2,_0xe710('0xb'),JSON[_0xe710('0xe')](_0x58d510));if(_0x58d510[_0xe710('0xf')]){if(_0x58d510[_0xe710('0xf')][_0xe710('0x10')]===0x1f4){logger[_0xe710('0xf')](_0xe710('0xa'),_0x205db2,_0x58d510[_0xe710('0xf')]['message']);return _0x19ab1d(_0x58d510['error'][_0xe710('0x11')]);}logger[_0xe710('0xf')](_0xe710('0xa'),_0x205db2,_0x58d510[_0xe710('0xf')][_0xe710('0x11')]);return _0xf86a0f(_0x58d510[_0xe710('0xf')]['message']);}else{logger[_0xe710('0x9')](_0xe710('0xa'),_0x205db2,_0xe710('0xb'));_0xf86a0f(_0x58d510[_0xe710('0x12')][_0xe710('0x11')]);}})[_0xe710('0x13')](function(_0x39bdf7){logger[_0xe710('0xf')](_0xe710('0xa'),_0x205db2,_0x39bdf7);_0x19ab1d(_0x39bdf7);});});}