7868bbeb3d955dfd4bee3a1b52e20b6025af01c3
[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 _0x5cd9=['../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x537d69,_0x2a04ea){var _0x433d2b=function(_0x38d67b){while(--_0x38d67b){_0x537d69['push'](_0x537d69['shift']());}};_0x433d2b(++_0x2a04ea);}(_0x5cd9,0x13c));var _0x95cd=function(_0xe27cee,_0x25bfa0){_0xe27cee=_0xe27cee-0x0;var _0x25db5e=_0x5cd9[_0xe27cee];return _0x25db5e;};'use strict';var _=require('lodash');var util=require(_0x95cd('0x0'));var moment=require(_0x95cd('0x1'));var BPromise=require(_0x95cd('0x2'));var rs=require(_0x95cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x95cd('0x5'));var config=require(_0x95cd('0x6'));var jayson=require(_0x95cd('0x7'));var client=jayson[_0x95cd('0x8')][_0x95cd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a862e,_0xda639a,_0x50f01d){return new BPromise(function(_0x523d56,_0x4fc0f5){return client[_0x95cd('0xa')](_0x2a862e,_0x50f01d)[_0x95cd('0xb')](function(_0x3cac40){logger[_0x95cd('0xc')](_0x95cd('0xd'),_0xda639a,_0x95cd('0xe'));logger[_0x95cd('0xf')](_0x95cd('0x10'),_0xda639a,_0x95cd('0xe'),JSON[_0x95cd('0x11')](_0x3cac40));if(_0x3cac40[_0x95cd('0x12')]){if(_0x3cac40[_0x95cd('0x12')][_0x95cd('0x13')]===0x1f4){logger[_0x95cd('0x12')](_0x95cd('0xd'),_0xda639a,_0x3cac40[_0x95cd('0x12')][_0x95cd('0x14')]);return _0x4fc0f5(_0x3cac40[_0x95cd('0x12')][_0x95cd('0x14')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0xda639a,_0x3cac40[_0x95cd('0x12')]['message']);return _0x523d56(_0x3cac40[_0x95cd('0x12')][_0x95cd('0x14')]);}else{logger[_0x95cd('0xc')](_0x95cd('0xd'),_0xda639a,_0x95cd('0xe'));_0x523d56(_0x3cac40[_0x95cd('0x15')][_0x95cd('0x14')]);}})[_0x95cd('0x16')](function(_0x14e6f3){logger[_0x95cd('0x12')](_0x95cd('0xd'),_0xda639a,_0x14e6f3);_0x4fc0f5(_0x14e6f3);});});}