9c5a0ac79d3d39a8726bb96f6c2eb00a0b53b125
[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 _0xef88=['error','code','message','VoiceQueuesLog,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','stringify'];(function(_0x3306bd,_0x3cafa5){var _0xad257=function(_0x54531c){while(--_0x54531c){_0x3306bd['push'](_0x3306bd['shift']());}};_0xad257(++_0x3cafa5);}(_0xef88,0x10f));var _0x8ef8=function(_0xbb15f8,_0x2b21c4){_0xbb15f8=_0xbb15f8-0x0;var _0x305e2d=_0xef88[_0xbb15f8];return _0x305e2d;};'use strict';var _=require('lodash');var util=require(_0x8ef8('0x0'));var moment=require(_0x8ef8('0x1'));var BPromise=require(_0x8ef8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ef8('0x3'));var db=require(_0x8ef8('0x4'))['db'];var utils=require(_0x8ef8('0x5'));var logger=require(_0x8ef8('0x6'))(_0x8ef8('0x7'));var config=require('../../config/environment');var jayson=require(_0x8ef8('0x8'));var client=jayson[_0x8ef8('0x9')][_0x8ef8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cc25f,_0x180179,_0x565639){return new BPromise(function(_0x5e3464,_0x10649a){return client[_0x8ef8('0xb')](_0x3cc25f,_0x565639)[_0x8ef8('0xc')](function(_0x42dc00){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x180179,_0x8ef8('0xd'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x180179,_0x8ef8('0xd'),JSON[_0x8ef8('0xe')](_0x42dc00));if(_0x42dc00[_0x8ef8('0xf')]){if(_0x42dc00[_0x8ef8('0xf')][_0x8ef8('0x10')]===0x1f4){logger[_0x8ef8('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x180179,_0x42dc00[_0x8ef8('0xf')][_0x8ef8('0x11')]);return _0x10649a(_0x42dc00[_0x8ef8('0xf')][_0x8ef8('0x11')]);}logger['error'](_0x8ef8('0x12'),_0x180179,_0x42dc00['error'][_0x8ef8('0x11')]);return _0x5e3464(_0x42dc00[_0x8ef8('0xf')][_0x8ef8('0x11')]);}else{logger[_0x8ef8('0x13')](_0x8ef8('0x12'),_0x180179,_0x8ef8('0xd'));_0x5e3464(_0x42dc00[_0x8ef8('0x14')][_0x8ef8('0x11')]);}})[_0x8ef8('0x15')](function(_0x591332){logger[_0x8ef8('0xf')](_0x8ef8('0x12'),_0x180179,_0x591332);_0x10649a(_0x591332);});});}