Built motion from commit 994c64e1.|2.6.1
[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 _0x7af2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x7af2,0x1b5));var _0x27af=function(_0x56b2f5,_0x14743c){_0x56b2f5=_0x56b2f5-0x0;var _0x5532b8=_0x7af2[_0x56b2f5];return _0x5532b8;};'use strict';var _=require(_0x27af('0x0'));var util=require(_0x27af('0x1'));var moment=require('moment');var BPromise=require(_0x27af('0x2'));var rs=require(_0x27af('0x3'));var fs=require('fs');var Redis=require(_0x27af('0x4'));var db=require(_0x27af('0x5'))['db'];var utils=require(_0x27af('0x6'));var logger=require(_0x27af('0x7'))(_0x27af('0x8'));var config=require(_0x27af('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x27af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1525c7,_0x418716,_0x444d85){return new BPromise(function(_0x374157,_0xd42bc1){return client[_0x27af('0xb')](_0x1525c7,_0x444d85)['then'](function(_0x529560){logger[_0x27af('0xc')](_0x27af('0xd'),_0x418716,'request\x20sent');logger[_0x27af('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x418716,'request\x20sent',JSON[_0x27af('0xf')](_0x529560));if(_0x529560[_0x27af('0x10')]){if(_0x529560['error'][_0x27af('0x11')]===0x1f4){logger[_0x27af('0x10')](_0x27af('0xd'),_0x418716,_0x529560[_0x27af('0x10')][_0x27af('0x12')]);return _0xd42bc1(_0x529560['error'][_0x27af('0x12')]);}logger[_0x27af('0x10')](_0x27af('0xd'),_0x418716,_0x529560['error'][_0x27af('0x12')]);return _0x374157(_0x529560['error'][_0x27af('0x12')]);}else{logger[_0x27af('0xc')](_0x27af('0xd'),_0x418716,_0x27af('0x13'));_0x374157(_0x529560[_0x27af('0x14')][_0x27af('0x12')]);}})[_0x27af('0x15')](function(_0x8d6626){logger[_0x27af('0x10')](_0x27af('0xd'),_0x418716,_0x8d6626);_0xd42bc1(_0x8d6626);});});}