b2e49f27d4b3a9f7b2bf50a0d8bd283d1d7a5581
[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 _0x0298=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x406011,_0x56c84b){var _0x4a005c=function(_0xd13687){while(--_0xd13687){_0x406011['push'](_0x406011['shift']());}};_0x4a005c(++_0x56c84b);}(_0x0298,0x74));var _0x8029=function(_0x6a0cad,_0x24b832){_0x6a0cad=_0x6a0cad-0x0;var _0x5d2602=_0x0298[_0x6a0cad];return _0x5d2602;};'use strict';var _=require(_0x8029('0x0'));var util=require(_0x8029('0x1'));var moment=require('moment');var BPromise=require(_0x8029('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8029('0x3'));var db=require(_0x8029('0x4'))['db'];var utils=require(_0x8029('0x5'));var logger=require(_0x8029('0x6'))(_0x8029('0x7'));var config=require(_0x8029('0x8'));var jayson=require(_0x8029('0x9'));var client=jayson[_0x8029('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd7497e,_0x24ddfa,_0x1ac95a){return new BPromise(function(_0xc61637,_0x29688f){return client[_0x8029('0xb')](_0xd7497e,_0x1ac95a)[_0x8029('0xc')](function(_0x5a0ddc){logger[_0x8029('0xd')](_0x8029('0xe'),_0x24ddfa,_0x8029('0xf'));logger[_0x8029('0x10')](_0x8029('0x11'),_0x24ddfa,_0x8029('0xf'),JSON[_0x8029('0x12')](_0x5a0ddc));if(_0x5a0ddc[_0x8029('0x13')]){if(_0x5a0ddc['error'][_0x8029('0x14')]===0x1f4){logger[_0x8029('0x13')](_0x8029('0xe'),_0x24ddfa,_0x5a0ddc[_0x8029('0x13')][_0x8029('0x15')]);return _0x29688f(_0x5a0ddc[_0x8029('0x13')][_0x8029('0x15')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x24ddfa,_0x5a0ddc[_0x8029('0x13')][_0x8029('0x15')]);return _0xc61637(_0x5a0ddc[_0x8029('0x13')][_0x8029('0x15')]);}else{logger['info'](_0x8029('0xe'),_0x24ddfa,_0x8029('0xf'));_0xc61637(_0x5a0ddc['result'][_0x8029('0x15')]);}})['catch'](function(_0xaa28da){logger[_0x8029('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x24ddfa,_0xaa28da);_0x29688f(_0xaa28da);});});}