Built motion from commit 167bccf5.|2.6.7
[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 _0xa588=['stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xa588,0xe1));var _0x8a58=function(_0x5948c6,_0x4de8ac){_0x5948c6=_0x5948c6-0x0;var _0x30059e=_0xa588[_0x5948c6];return _0x30059e;};'use strict';var _=require('lodash');var util=require(_0x8a58('0x0'));var moment=require(_0x8a58('0x1'));var BPromise=require(_0x8a58('0x2'));var rs=require(_0x8a58('0x3'));var fs=require('fs');var Redis=require(_0x8a58('0x4'));var db=require(_0x8a58('0x5'))['db'];var utils=require(_0x8a58('0x6'));var logger=require(_0x8a58('0x7'))(_0x8a58('0x8'));var config=require('../../config/environment');var jayson=require(_0x8a58('0x9'));var client=jayson[_0x8a58('0xa')][_0x8a58('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35d5ad,_0xe0af18,_0x140f99){return new BPromise(function(_0x77b421,_0x585376){return client['request'](_0x35d5ad,_0x140f99)[_0x8a58('0xc')](function(_0x39a20e){logger[_0x8a58('0xd')](_0x8a58('0xe'),_0xe0af18,_0x8a58('0xf'));logger['debug'](_0x8a58('0x10'),_0xe0af18,_0x8a58('0xf'),JSON[_0x8a58('0x11')](_0x39a20e));if(_0x39a20e[_0x8a58('0x12')]){if(_0x39a20e['error']['code']===0x1f4){logger[_0x8a58('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0xe0af18,_0x39a20e[_0x8a58('0x12')][_0x8a58('0x13')]);return _0x585376(_0x39a20e['error'][_0x8a58('0x13')]);}logger[_0x8a58('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0xe0af18,_0x39a20e[_0x8a58('0x12')][_0x8a58('0x13')]);return _0x77b421(_0x39a20e['error'][_0x8a58('0x13')]);}else{logger[_0x8a58('0xd')](_0x8a58('0xe'),_0xe0af18,_0x8a58('0xf'));_0x77b421(_0x39a20e[_0x8a58('0x14')][_0x8a58('0x13')]);}})[_0x8a58('0x15')](function(_0x49ee0e){logger['error'](_0x8a58('0xe'),_0xe0af18,_0x49ee0e);_0x585376(_0x49ee0e);});});}