Built motion from commit (unavailable).|2.4.17
[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 _0x90fd=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error'];(function(_0x2dbcc0,_0x5e46e5){var _0x243fc4=function(_0x13df6e){while(--_0x13df6e){_0x2dbcc0['push'](_0x2dbcc0['shift']());}};_0x243fc4(++_0x5e46e5);}(_0x90fd,0x1d0));var _0xd90f=function(_0x333180,_0x1f055f){_0x333180=_0x333180-0x0;var _0x3f775d=_0x90fd[_0x333180];return _0x3f775d;};'use strict';var _=require(_0xd90f('0x0'));var util=require('util');var moment=require(_0xd90f('0x1'));var BPromise=require(_0xd90f('0x2'));var rs=require(_0xd90f('0x3'));var fs=require('fs');var Redis=require(_0xd90f('0x4'));var db=require(_0xd90f('0x5'))['db'];var utils=require(_0xd90f('0x6'));var logger=require('../../config/logger')(_0xd90f('0x7'));var config=require(_0xd90f('0x8'));var jayson=require(_0xd90f('0x9'));var client=jayson['client'][_0xd90f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ac94b,_0x397751,_0x18dea9){return new BPromise(function(_0x11ff82,_0x34aec1){return client[_0xd90f('0xb')](_0x1ac94b,_0x18dea9)[_0xd90f('0xc')](function(_0x2eea24){logger[_0xd90f('0xd')](_0xd90f('0xe'),_0x397751,_0xd90f('0xf'));logger[_0xd90f('0x10')](_0xd90f('0x11'),_0x397751,_0xd90f('0xf'),JSON['stringify'](_0x2eea24));if(_0x2eea24['error']){if(_0x2eea24[_0xd90f('0x12')][_0xd90f('0x13')]===0x1f4){logger[_0xd90f('0x12')](_0xd90f('0xe'),_0x397751,_0x2eea24['error']['message']);return _0x34aec1(_0x2eea24[_0xd90f('0x12')][_0xd90f('0x14')]);}logger['error'](_0xd90f('0xe'),_0x397751,_0x2eea24[_0xd90f('0x12')][_0xd90f('0x14')]);return _0x11ff82(_0x2eea24[_0xd90f('0x12')][_0xd90f('0x14')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x397751,_0xd90f('0xf'));_0x11ff82(_0x2eea24[_0xd90f('0x15')]['message']);}})[_0xd90f('0x16')](function(_0x987625){logger[_0xd90f('0x12')](_0xd90f('0xe'),_0x397751,_0x987625);_0x34aec1(_0x987625);});});}