Built motion from commit 43538d75.|2.5.35
[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 _0xcea2=['VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info'];(function(_0x52814a,_0x49bcfc){var _0x2374d5=function(_0x32445a){while(--_0x32445a){_0x52814a['push'](_0x52814a['shift']());}};_0x2374d5(++_0x49bcfc);}(_0xcea2,0x15a));var _0x2cea=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xcea2[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x2cea('0x0'));var util=require('util');var moment=require(_0x2cea('0x1'));var BPromise=require('bluebird');var rs=require(_0x2cea('0x2'));var fs=require('fs');var Redis=require(_0x2cea('0x3'));var db=require(_0x2cea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cea('0x5'))(_0x2cea('0x6'));var config=require(_0x2cea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2cea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d69ff,_0xc04963,_0x805a1b){return new BPromise(function(_0x160cca,_0x11c5c0){return client[_0x2cea('0x9')](_0x2d69ff,_0x805a1b)['then'](function(_0x1f4d90){logger[_0x2cea('0xa')](_0x2cea('0xb'),_0xc04963,_0x2cea('0xc'));logger[_0x2cea('0xd')](_0x2cea('0xe'),_0xc04963,_0x2cea('0xc'),JSON[_0x2cea('0xf')](_0x1f4d90));if(_0x1f4d90['error']){if(_0x1f4d90['error'][_0x2cea('0x10')]===0x1f4){logger[_0x2cea('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0xc04963,_0x1f4d90['error'][_0x2cea('0x12')]);return _0x11c5c0(_0x1f4d90['error'][_0x2cea('0x12')]);}logger[_0x2cea('0x11')](_0x2cea('0xb'),_0xc04963,_0x1f4d90['error']['message']);return _0x160cca(_0x1f4d90['error'][_0x2cea('0x12')]);}else{logger['info'](_0x2cea('0xb'),_0xc04963,_0x2cea('0xc'));_0x160cca(_0x1f4d90[_0x2cea('0x13')][_0x2cea('0x12')]);}})[_0x2cea('0x14')](function(_0x1bbfdb){logger[_0x2cea('0x11')](_0x2cea('0xb'),_0xc04963,_0x1bbfdb);_0x11c5c0(_0x1bbfdb);});});}