a9b2ed180dbcb8bf1167abc4db0c5f15e8bc81c3
[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 _0x570f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceChanSpy,\x20%s,\x20%s','result','catch','util','moment','bluebird'];(function(_0x5726eb,_0x3b8e83){var _0x30f4e8=function(_0x437412){while(--_0x437412){_0x5726eb['push'](_0x5726eb['shift']());}};_0x30f4e8(++_0x3b8e83);}(_0x570f,0xfa));var _0xf570=function(_0x5da4e0,_0x4e560a){_0x5da4e0=_0x5da4e0-0x0;var _0x532670=_0x570f[_0x5da4e0];return _0x532670;};'use strict';var _=require('lodash');var util=require(_0xf570('0x0'));var moment=require(_0xf570('0x1'));var BPromise=require(_0xf570('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf570('0x3'));var db=require(_0xf570('0x4'))['db'];var utils=require(_0xf570('0x5'));var logger=require(_0xf570('0x6'))(_0xf570('0x7'));var config=require('../../config/environment');var jayson=require(_0xf570('0x8'));var client=jayson[_0xf570('0x9')][_0xf570('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d5392,_0x54d85f,_0x553717){return new BPromise(function(_0x2d6ca0,_0x2fb2e5){return client['request'](_0x5d5392,_0x553717)[_0xf570('0xb')](function(_0x1b6808){logger[_0xf570('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x54d85f,_0xf570('0xd'));logger[_0xf570('0xe')](_0xf570('0xf'),_0x54d85f,_0xf570('0xd'),JSON[_0xf570('0x10')](_0x1b6808));if(_0x1b6808[_0xf570('0x11')]){if(_0x1b6808[_0xf570('0x11')][_0xf570('0x12')]===0x1f4){logger[_0xf570('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x54d85f,_0x1b6808[_0xf570('0x11')][_0xf570('0x13')]);return _0x2fb2e5(_0x1b6808[_0xf570('0x11')]['message']);}logger['error'](_0xf570('0x14'),_0x54d85f,_0x1b6808[_0xf570('0x11')]['message']);return _0x2d6ca0(_0x1b6808['error'][_0xf570('0x13')]);}else{logger['info'](_0xf570('0x14'),_0x54d85f,_0xf570('0xd'));_0x2d6ca0(_0x1b6808[_0xf570('0x15')]['message']);}})[_0xf570('0x16')](function(_0x25dc5a){logger['error'](_0xf570('0x14'),_0x54d85f,_0x25dc5a);_0x2fb2e5(_0x25dc5a);});});}