544d8b6f43ad1b3f07ad30e2276764ec27b48a20
[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(_0x5717df,_0x145007){var _0x25c425=function(_0x5b53f4){while(--_0x5b53f4){_0x5717df['push'](_0x5717df['shift']());}};_0x25c425(++_0x145007);}(_0x0298,0x74));var _0x8029=function(_0x5316d3,_0x5cba98){_0x5316d3=_0x5316d3-0x0;var _0x27d9fa=_0x0298[_0x5316d3];return _0x27d9fa;};'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);});});}