Built motion from commit (unavailable).|2.4.19
[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 _0x4e19=['request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info'];(function(_0x1d31c8,_0x5f65c0){var _0xa88931=function(_0x5d2db2){while(--_0x5d2db2){_0x1d31c8['push'](_0x1d31c8['shift']());}};_0xa88931(++_0x5f65c0);}(_0x4e19,0x144));var _0x94e1=function(_0x223c0d,_0x3ec04d){_0x223c0d=_0x223c0d-0x0;var _0x207827=_0x4e19[_0x223c0d];return _0x207827;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x94e1('0x0'));var BPromise=require(_0x94e1('0x1'));var rs=require(_0x94e1('0x2'));var fs=require('fs');var Redis=require(_0x94e1('0x3'));var db=require(_0x94e1('0x4'))['db'];var utils=require(_0x94e1('0x5'));var logger=require(_0x94e1('0x6'))(_0x94e1('0x7'));var config=require('../../config/environment');var jayson=require(_0x94e1('0x8'));var client=jayson[_0x94e1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28e6df,_0x115323,_0x5a2510){return new BPromise(function(_0x5cec13,_0x26109a){return client[_0x94e1('0xa')](_0x28e6df,_0x5a2510)['then'](function(_0x1c3dbd){logger[_0x94e1('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x115323,_0x94e1('0xc'));logger[_0x94e1('0xd')](_0x94e1('0xe'),_0x115323,_0x94e1('0xc'),JSON[_0x94e1('0xf')](_0x1c3dbd));if(_0x1c3dbd[_0x94e1('0x10')]){if(_0x1c3dbd['error']['code']===0x1f4){logger[_0x94e1('0x10')](_0x94e1('0x11'),_0x115323,_0x1c3dbd['error'][_0x94e1('0x12')]);return _0x26109a(_0x1c3dbd[_0x94e1('0x10')][_0x94e1('0x12')]);}logger[_0x94e1('0x10')](_0x94e1('0x11'),_0x115323,_0x1c3dbd[_0x94e1('0x10')]['message']);return _0x5cec13(_0x1c3dbd[_0x94e1('0x10')][_0x94e1('0x12')]);}else{logger['info'](_0x94e1('0x11'),_0x115323,_0x94e1('0xc'));_0x5cec13(_0x1c3dbd[_0x94e1('0x13')][_0x94e1('0x12')]);}})[_0x94e1('0x14')](function(_0x1ddf6a){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x115323,_0x1ddf6a);_0x26109a(_0x1ddf6a);});});}