Built motion from commit (unavailable).|2.5.1
[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 _0xcd99=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x51c2a5,_0x3e5901){var _0x743735=function(_0x20932b){while(--_0x20932b){_0x51c2a5['push'](_0x51c2a5['shift']());}};_0x743735(++_0x3e5901);}(_0xcd99,0x1c5));var _0x9cd9=function(_0x3f04a2,_0x5cef7c){_0x3f04a2=_0x3f04a2-0x0;var _0x3781fa=_0xcd99[_0x3f04a2];return _0x3781fa;};'use strict';var _=require(_0x9cd9('0x0'));var util=require(_0x9cd9('0x1'));var moment=require(_0x9cd9('0x2'));var BPromise=require(_0x9cd9('0x3'));var rs=require(_0x9cd9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9cd9('0x5'))['db'];var utils=require(_0x9cd9('0x6'));var logger=require(_0x9cd9('0x7'))(_0x9cd9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9cd9('0x9')][_0x9cd9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51d9f8,_0x54b12d,_0x4bf643){return new BPromise(function(_0x22e93e,_0x3b5a12){return client[_0x9cd9('0xb')](_0x51d9f8,_0x4bf643)[_0x9cd9('0xc')](function(_0x3f0806){logger[_0x9cd9('0xd')](_0x9cd9('0xe'),_0x54b12d,'request\x20sent');logger[_0x9cd9('0xf')](_0x9cd9('0x10'),_0x54b12d,_0x9cd9('0x11'),JSON[_0x9cd9('0x12')](_0x3f0806));if(_0x3f0806['error']){if(_0x3f0806[_0x9cd9('0x13')][_0x9cd9('0x14')]===0x1f4){logger['error'](_0x9cd9('0xe'),_0x54b12d,_0x3f0806[_0x9cd9('0x13')][_0x9cd9('0x15')]);return _0x3b5a12(_0x3f0806['error'][_0x9cd9('0x15')]);}logger['error'](_0x9cd9('0xe'),_0x54b12d,_0x3f0806[_0x9cd9('0x13')]['message']);return _0x22e93e(_0x3f0806[_0x9cd9('0x13')]['message']);}else{logger[_0x9cd9('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x54b12d,_0x9cd9('0x11'));_0x22e93e(_0x3f0806[_0x9cd9('0x16')][_0x9cd9('0x15')]);}})[_0x9cd9('0x17')](function(_0x153884){logger[_0x9cd9('0x13')](_0x9cd9('0xe'),_0x54b12d,_0x153884);_0x3b5a12(_0x153884);});});}