b2da5a2ddbf2145e2d07e9c27b23f60e6104e89a
[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 _0x3a25=['then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x476157,_0x1d310b){var _0x171d27=function(_0x1ee2af){while(--_0x1ee2af){_0x476157['push'](_0x476157['shift']());}};_0x171d27(++_0x1d310b);}(_0x3a25,0x15d));var _0x53a2=function(_0x34d4d9,_0x204b4d){_0x34d4d9=_0x34d4d9-0x0;var _0x3693e3=_0x3a25[_0x34d4d9];return _0x3693e3;};'use strict';var _=require(_0x53a2('0x0'));var util=require(_0x53a2('0x1'));var moment=require(_0x53a2('0x2'));var BPromise=require(_0x53a2('0x3'));var rs=require(_0x53a2('0x4'));var fs=require('fs');var Redis=require(_0x53a2('0x5'));var db=require(_0x53a2('0x6'))['db'];var utils=require(_0x53a2('0x7'));var logger=require(_0x53a2('0x8'))(_0x53a2('0x9'));var config=require(_0x53a2('0xa'));var jayson=require(_0x53a2('0xb'));var client=jayson[_0x53a2('0xc')][_0x53a2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x409fff,_0x4d53b8,_0x3ee956){return new BPromise(function(_0x5dc70e,_0x17aa09){return client[_0x53a2('0xe')](_0x409fff,_0x3ee956)[_0x53a2('0xf')](function(_0x42bf42){logger[_0x53a2('0x10')](_0x53a2('0x11'),_0x4d53b8,_0x53a2('0x12'));logger[_0x53a2('0x13')](_0x53a2('0x14'),_0x4d53b8,_0x53a2('0x12'),JSON['stringify'](_0x42bf42));if(_0x42bf42['error']){if(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x16')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x4d53b8,_0x42bf42['error'][_0x53a2('0x17')]);return _0x17aa09(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x17')]);}logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x4d53b8,_0x42bf42['error'][_0x53a2('0x17')]);return _0x5dc70e(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x17')]);}else{logger[_0x53a2('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x4d53b8,_0x53a2('0x12'));_0x5dc70e(_0x42bf42[_0x53a2('0x18')][_0x53a2('0x17')]);}})[_0x53a2('0x19')](function(_0x34c7de){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x4d53b8,_0x34c7de);_0x17aa09(_0x34c7de);});});}