Built motion from commit 9d1906d1.|2.5.40
[motion2.git] / server / api / voiceQueuesLog / voiceQueuesLog.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 _0x280f=['VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x40fd7b,_0x1edb17){var _0x2e33ec=function(_0x38a277){while(--_0x38a277){_0x40fd7b['push'](_0x40fd7b['shift']());}};_0x2e33ec(++_0x1edb17);}(_0x280f,0xe2));var _0xf280=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0x280f[_0x5f08a6];return _0x5d0641;};'use strict';var _=require(_0xf280('0x0'));var util=require('util');var moment=require(_0xf280('0x1'));var BPromise=require(_0xf280('0x2'));var rs=require(_0xf280('0x3'));var fs=require('fs');var Redis=require(_0xf280('0x4'));var db=require(_0xf280('0x5'))['db'];var utils=require(_0xf280('0x6'));var logger=require(_0xf280('0x7'))('rpc');var config=require(_0xf280('0x8'));var jayson=require(_0xf280('0x9'));var client=jayson[_0xf280('0xa')][_0xf280('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3454e8,_0x49d0df,_0x3de766){return new BPromise(function(_0x4392c5,_0x1a090d){return client[_0xf280('0xc')](_0x3454e8,_0x3de766)[_0xf280('0xd')](function(_0x370566){logger['info'](_0xf280('0xe'),_0x49d0df,_0xf280('0xf'));logger[_0xf280('0x10')](_0xf280('0x11'),_0x49d0df,_0xf280('0xf'),JSON[_0xf280('0x12')](_0x370566));if(_0x370566[_0xf280('0x13')]){if(_0x370566[_0xf280('0x13')][_0xf280('0x14')]===0x1f4){logger[_0xf280('0x13')](_0xf280('0xe'),_0x49d0df,_0x370566['error'][_0xf280('0x15')]);return _0x1a090d(_0x370566[_0xf280('0x13')][_0xf280('0x15')]);}logger[_0xf280('0x13')](_0xf280('0xe'),_0x49d0df,_0x370566[_0xf280('0x13')]['message']);return _0x4392c5(_0x370566[_0xf280('0x13')][_0xf280('0x15')]);}else{logger[_0xf280('0x16')](_0xf280('0xe'),_0x49d0df,_0xf280('0xf'));_0x4392c5(_0x370566[_0xf280('0x17')][_0xf280('0x15')]);}})['catch'](function(_0x487efc){logger['error'](_0xf280('0xe'),_0x49d0df,_0x487efc);_0x1a090d(_0x487efc);});});}