Built motion from commit 639a1a7f.|2.6.19
[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 _0x4676=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result'];(function(_0x31ef15,_0x4bda00){var _0x1b242e=function(_0x1f234d){while(--_0x1f234d){_0x31ef15['push'](_0x31ef15['shift']());}};_0x1b242e(++_0x4bda00);}(_0x4676,0x1e4));var _0x6467=function(_0x401b51,_0x5a05c1){_0x401b51=_0x401b51-0x0;var _0x395ae6=_0x4676[_0x401b51];return _0x395ae6;};'use strict';var _=require(_0x6467('0x0'));var util=require('util');var moment=require(_0x6467('0x1'));var BPromise=require(_0x6467('0x2'));var rs=require(_0x6467('0x3'));var fs=require('fs');var Redis=require(_0x6467('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6467('0x5'));var logger=require(_0x6467('0x6'))(_0x6467('0x7'));var config=require(_0x6467('0x8'));var jayson=require(_0x6467('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c43db,_0x1ab400,_0x4969a7){return new BPromise(function(_0x4a3dd3,_0x2bd50c){return client[_0x6467('0xa')](_0x1c43db,_0x4969a7)[_0x6467('0xb')](function(_0x13b804){logger[_0x6467('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1ab400,_0x6467('0xd'));logger[_0x6467('0xe')](_0x6467('0xf'),_0x1ab400,_0x6467('0xd'),JSON[_0x6467('0x10')](_0x13b804));if(_0x13b804[_0x6467('0x11')]){if(_0x13b804[_0x6467('0x11')][_0x6467('0x12')]===0x1f4){logger[_0x6467('0x11')](_0x6467('0x13'),_0x1ab400,_0x13b804[_0x6467('0x11')][_0x6467('0x14')]);return _0x2bd50c(_0x13b804[_0x6467('0x11')][_0x6467('0x14')]);}logger[_0x6467('0x11')](_0x6467('0x13'),_0x1ab400,_0x13b804[_0x6467('0x11')]['message']);return _0x4a3dd3(_0x13b804[_0x6467('0x11')][_0x6467('0x14')]);}else{logger[_0x6467('0xc')](_0x6467('0x13'),_0x1ab400,'request\x20sent');_0x4a3dd3(_0x13b804[_0x6467('0x15')][_0x6467('0x14')]);}})[_0x6467('0x16')](function(_0x17f6a5){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x1ab400,_0x17f6a5);_0x2bd50c(_0x17f6a5);});});}