Built motion from commit (unavailable).|2.5.21
[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 _0xfc32=['request','then','info','request\x20sent','stringify','error','message','VoiceChanSpy,\x20%s,\x20%s','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xfc32,0x1c2));var _0x2fc3=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xfc32[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x2fc3('0x0'));var util=require('util');var moment=require(_0x2fc3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fc3('0x2'));var db=require(_0x2fc3('0x3'))['db'];var utils=require(_0x2fc3('0x4'));var logger=require('../../config/logger')(_0x2fc3('0x5'));var config=require(_0x2fc3('0x6'));var jayson=require(_0x2fc3('0x7'));var client=jayson[_0x2fc3('0x8')][_0x2fc3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfb4597,_0x527984,_0x1ef4ab){return new BPromise(function(_0x132667,_0x2151a1){return client[_0x2fc3('0xa')](_0xfb4597,_0x1ef4ab)[_0x2fc3('0xb')](function(_0x5c89a0){logger[_0x2fc3('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x527984,_0x2fc3('0xd'));logger['debug']('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x527984,'request\x20sent',JSON[_0x2fc3('0xe')](_0x5c89a0));if(_0x5c89a0[_0x2fc3('0xf')]){if(_0x5c89a0['error']['code']===0x1f4){logger[_0x2fc3('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x527984,_0x5c89a0[_0x2fc3('0xf')][_0x2fc3('0x10')]);return _0x2151a1(_0x5c89a0[_0x2fc3('0xf')][_0x2fc3('0x10')]);}logger['error'](_0x2fc3('0x11'),_0x527984,_0x5c89a0[_0x2fc3('0xf')][_0x2fc3('0x10')]);return _0x132667(_0x5c89a0[_0x2fc3('0xf')][_0x2fc3('0x10')]);}else{logger['info'](_0x2fc3('0x11'),_0x527984,'request\x20sent');_0x132667(_0x5c89a0[_0x2fc3('0x12')][_0x2fc3('0x10')]);}})[_0x2fc3('0x13')](function(_0x19a377){logger[_0x2fc3('0xf')](_0x2fc3('0x11'),_0x527984,_0x19a377);_0x2151a1(_0x19a377);});});}