cc9c64ff99868c900401ade8870225332337a955
[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 _0x9d5b=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x597fd6,_0x22ef0b){var _0x4c4420=function(_0x49297f){while(--_0x49297f){_0x597fd6['push'](_0x597fd6['shift']());}};_0x4c4420(++_0x22ef0b);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x9949d9,_0x5908b9){_0x9949d9=_0x9949d9-0x0;var _0x2adfa0=_0x9d5b[_0x9949d9];return _0x2adfa0;};'use strict';var _=require('lodash');var util=require(_0xb9d5('0x0'));var moment=require(_0xb9d5('0x1'));var BPromise=require(_0xb9d5('0x2'));var rs=require(_0xb9d5('0x3'));var fs=require('fs');var Redis=require(_0xb9d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9d5('0x5'));var logger=require('../../config/logger')(_0xb9d5('0x6'));var config=require(_0xb9d5('0x7'));var jayson=require(_0xb9d5('0x8'));var client=jayson[_0xb9d5('0x9')][_0xb9d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5144c7,_0x1ddb78,_0x35cf2){return new BPromise(function(_0x4dc4be,_0x2d3f66){return client[_0xb9d5('0xb')](_0x5144c7,_0x35cf2)[_0xb9d5('0xc')](function(_0x94e766){logger['info'](_0xb9d5('0xd'),_0x1ddb78,_0xb9d5('0xe'));logger['debug'](_0xb9d5('0xf'),_0x1ddb78,_0xb9d5('0xe'),JSON[_0xb9d5('0x10')](_0x94e766));if(_0x94e766[_0xb9d5('0x11')]){if(_0x94e766[_0xb9d5('0x11')][_0xb9d5('0x12')]===0x1f4){logger[_0xb9d5('0x11')](_0xb9d5('0xd'),_0x1ddb78,_0x94e766[_0xb9d5('0x11')][_0xb9d5('0x13')]);return _0x2d3f66(_0x94e766[_0xb9d5('0x11')]['message']);}logger[_0xb9d5('0x11')](_0xb9d5('0xd'),_0x1ddb78,_0x94e766['error'][_0xb9d5('0x13')]);return _0x4dc4be(_0x94e766[_0xb9d5('0x11')][_0xb9d5('0x13')]);}else{logger['info'](_0xb9d5('0xd'),_0x1ddb78,_0xb9d5('0xe'));_0x4dc4be(_0x94e766[_0xb9d5('0x14')][_0xb9d5('0x13')]);}})[_0xb9d5('0x15')](function(_0x321a77){logger[_0xb9d5('0x11')](_0xb9d5('0xd'),_0x1ddb78,_0x321a77);_0x2d3f66(_0x321a77);});});}