52649fb3011e24a0448dce05e2928fa3b4cb2532
[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 _0x2f38=['message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x5de46a,_0xd2ed3f){var _0x1c110a=function(_0x273c4c){while(--_0x273c4c){_0x5de46a['push'](_0x5de46a['shift']());}};_0x1c110a(++_0xd2ed3f);}(_0x2f38,0x1a7));var _0x82f3=function(_0x107e62,_0x408bc2){_0x107e62=_0x107e62-0x0;var _0x52f649=_0x2f38[_0x107e62];return _0x52f649;};'use strict';var _=require('lodash');var util=require(_0x82f3('0x0'));var moment=require('moment');var BPromise=require(_0x82f3('0x1'));var rs=require(_0x82f3('0x2'));var fs=require('fs');var Redis=require(_0x82f3('0x3'));var db=require(_0x82f3('0x4'))['db'];var utils=require(_0x82f3('0x5'));var logger=require(_0x82f3('0x6'))('rpc');var config=require(_0x82f3('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x82f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c09a0,_0x28c7f0,_0x2c69d2){return new BPromise(function(_0x659a85,_0x427ef6){return client[_0x82f3('0x9')](_0x1c09a0,_0x2c69d2)[_0x82f3('0xa')](function(_0xb445a3){logger[_0x82f3('0xb')](_0x82f3('0xc'),_0x28c7f0,_0x82f3('0xd'));logger[_0x82f3('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x28c7f0,_0x82f3('0xd'),JSON[_0x82f3('0xf')](_0xb445a3));if(_0xb445a3[_0x82f3('0x10')]){if(_0xb445a3[_0x82f3('0x10')][_0x82f3('0x11')]===0x1f4){logger[_0x82f3('0x10')](_0x82f3('0xc'),_0x28c7f0,_0xb445a3['error']['message']);return _0x427ef6(_0xb445a3[_0x82f3('0x10')][_0x82f3('0x12')]);}logger['error'](_0x82f3('0xc'),_0x28c7f0,_0xb445a3[_0x82f3('0x10')][_0x82f3('0x12')]);return _0x659a85(_0xb445a3[_0x82f3('0x10')][_0x82f3('0x12')]);}else{logger[_0x82f3('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x28c7f0,_0x82f3('0xd'));_0x659a85(_0xb445a3[_0x82f3('0x13')][_0x82f3('0x12')]);}})[_0x82f3('0x14')](function(_0x4d1a2d){logger[_0x82f3('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x28c7f0,_0x4d1a2d);_0x427ef6(_0x4d1a2d);});});}