Built motion from commit (unavailable).|2.4.3
[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 _0x93d3=['VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x51a3e9,_0x80bc33){var _0x30d626=function(_0x3f6684){while(--_0x3f6684){_0x51a3e9['push'](_0x51a3e9['shift']());}};_0x30d626(++_0x80bc33);}(_0x93d3,0x1ec));var _0x393d=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x93d3[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x393d('0x0'));var util=require(_0x393d('0x1'));var moment=require(_0x393d('0x2'));var BPromise=require(_0x393d('0x3'));var rs=require(_0x393d('0x4'));var fs=require('fs');var Redis=require(_0x393d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x393d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x393d('0x7'));var jayson=require(_0x393d('0x8'));var client=jayson[_0x393d('0x9')][_0x393d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5267ac,_0x114d22,_0x5b75ea){return new BPromise(function(_0x53f6a4,_0x38825e){return client[_0x393d('0xb')](_0x5267ac,_0x5b75ea)[_0x393d('0xc')](function(_0x56ea95){logger[_0x393d('0xd')](_0x393d('0xe'),_0x114d22,'request\x20sent');logger[_0x393d('0xf')](_0x393d('0x10'),_0x114d22,_0x393d('0x11'),JSON['stringify'](_0x56ea95));if(_0x56ea95[_0x393d('0x12')]){if(_0x56ea95[_0x393d('0x12')]['code']===0x1f4){logger['error'](_0x393d('0xe'),_0x114d22,_0x56ea95[_0x393d('0x12')][_0x393d('0x13')]);return _0x38825e(_0x56ea95['error']['message']);}logger['error'](_0x393d('0xe'),_0x114d22,_0x56ea95['error']['message']);return _0x53f6a4(_0x56ea95['error'][_0x393d('0x13')]);}else{logger[_0x393d('0xd')](_0x393d('0xe'),_0x114d22,_0x393d('0x11'));_0x53f6a4(_0x56ea95[_0x393d('0x14')][_0x393d('0x13')]);}})[_0x393d('0x15')](function(_0x34ce28){logger[_0x393d('0x12')](_0x393d('0xe'),_0x114d22,_0x34ce28);_0x38825e(_0x34ce28);});});}