Built motion from commit (unavailable).|2.5.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 _0x5c39=['stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5c39,0x124));var _0x95c3=function(_0xc2281,_0x367c78){_0xc2281=_0xc2281-0x0;var _0x3317e3=_0x5c39[_0xc2281];return _0x3317e3;};'use strict';var _=require(_0x95c3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x95c3('0x1'));var rs=require(_0x95c3('0x2'));var fs=require('fs');var Redis=require(_0x95c3('0x3'));var db=require(_0x95c3('0x4'))['db'];var utils=require(_0x95c3('0x5'));var logger=require('../../config/logger')(_0x95c3('0x6'));var config=require(_0x95c3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x95c3('0x8')][_0x95c3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c5cf8,_0x258af1,_0x437ade){return new BPromise(function(_0x537e27,_0x25de2b){return client[_0x95c3('0xa')](_0x2c5cf8,_0x437ade)['then'](function(_0x497cd7){logger[_0x95c3('0xb')](_0x95c3('0xc'),_0x258af1,_0x95c3('0xd'));logger[_0x95c3('0xe')](_0x95c3('0xf'),_0x258af1,_0x95c3('0xd'),JSON[_0x95c3('0x10')](_0x497cd7));if(_0x497cd7['error']){if(_0x497cd7[_0x95c3('0x11')][_0x95c3('0x12')]===0x1f4){logger['error'](_0x95c3('0xc'),_0x258af1,_0x497cd7[_0x95c3('0x11')]['message']);return _0x25de2b(_0x497cd7[_0x95c3('0x11')][_0x95c3('0x13')]);}logger[_0x95c3('0x11')](_0x95c3('0xc'),_0x258af1,_0x497cd7['error'][_0x95c3('0x13')]);return _0x537e27(_0x497cd7[_0x95c3('0x11')][_0x95c3('0x13')]);}else{logger[_0x95c3('0xb')](_0x95c3('0xc'),_0x258af1,_0x95c3('0xd'));_0x537e27(_0x497cd7[_0x95c3('0x14')][_0x95c3('0x13')]);}})[_0x95c3('0x15')](function(_0x2c880f){logger[_0x95c3('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x258af1,_0x2c880f);_0x25de2b(_0x2c880f);});});}