fa645b4fc866040095adcfb72f27739bf1063184
[motion2.git] / server / api / voiceChanSpy / voiceChanSpy.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 _0xf5e8=['then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x25ac5e,_0x19a672){var _0x41be74=function(_0x478d8b){while(--_0x478d8b){_0x25ac5e['push'](_0x25ac5e['shift']());}};_0x41be74(++_0x19a672);}(_0xf5e8,0xfc));var _0x8f5e=function(_0x36d203,_0x3653f3){_0x36d203=_0x36d203-0x0;var _0x2f9e62=_0xf5e8[_0x36d203];return _0x2f9e62;};'use strict';var _=require(_0x8f5e('0x0'));var util=require(_0x8f5e('0x1'));var moment=require('moment');var BPromise=require(_0x8f5e('0x2'));var rs=require(_0x8f5e('0x3'));var fs=require('fs');var Redis=require(_0x8f5e('0x4'));var db=require(_0x8f5e('0x5'))['db'];var utils=require(_0x8f5e('0x6'));var logger=require('../../config/logger')(_0x8f5e('0x7'));var config=require(_0x8f5e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8f5e('0x9')][_0x8f5e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f6ee5,_0x3d3687,_0x846c22){return new BPromise(function(_0x5072a7,_0x4da323){return client[_0x8f5e('0xb')](_0x1f6ee5,_0x846c22)[_0x8f5e('0xc')](function(_0x5ef6e9){logger[_0x8f5e('0xd')](_0x8f5e('0xe'),_0x3d3687,_0x8f5e('0xf'));logger[_0x8f5e('0x10')](_0x8f5e('0x11'),_0x3d3687,_0x8f5e('0xf'),JSON[_0x8f5e('0x12')](_0x5ef6e9));if(_0x5ef6e9[_0x8f5e('0x13')]){if(_0x5ef6e9[_0x8f5e('0x13')][_0x8f5e('0x14')]===0x1f4){logger['error'](_0x8f5e('0xe'),_0x3d3687,_0x5ef6e9['error'][_0x8f5e('0x15')]);return _0x4da323(_0x5ef6e9['error'][_0x8f5e('0x15')]);}logger[_0x8f5e('0x13')](_0x8f5e('0xe'),_0x3d3687,_0x5ef6e9[_0x8f5e('0x13')][_0x8f5e('0x15')]);return _0x5072a7(_0x5ef6e9[_0x8f5e('0x13')][_0x8f5e('0x15')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x3d3687,_0x8f5e('0xf'));_0x5072a7(_0x5ef6e9['result'][_0x8f5e('0x15')]);}})['catch'](function(_0x1af375){logger[_0x8f5e('0x13')](_0x8f5e('0xe'),_0x3d3687,_0x1af375);_0x4da323(_0x1af375);});});}