Built motion from commit (unavailable).|2.5.11
[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 _0xe4a1=['then','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','VoiceChanSpy,\x20%s,\x20%s','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x713aa8,_0x487e3b){var _0x483d26=function(_0x57d058){while(--_0x57d058){_0x713aa8['push'](_0x713aa8['shift']());}};_0x483d26(++_0x487e3b);}(_0xe4a1,0x199));var _0x1e4a=function(_0x38b313,_0x4c5217){_0x38b313=_0x38b313-0x0;var _0x5d393d=_0xe4a1[_0x38b313];return _0x5d393d;};'use strict';var _=require(_0x1e4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1e4a('0x1'));var rs=require(_0x1e4a('0x2'));var fs=require('fs');var Redis=require(_0x1e4a('0x3'));var db=require(_0x1e4a('0x4'))['db'];var utils=require(_0x1e4a('0x5'));var logger=require(_0x1e4a('0x6'))('rpc');var config=require(_0x1e4a('0x7'));var jayson=require(_0x1e4a('0x8'));var client=jayson[_0x1e4a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54d5c4,_0x358707,_0xe5cc6a){return new BPromise(function(_0x297141,_0x43cfa3){return client[_0x1e4a('0xa')](_0x54d5c4,_0xe5cc6a)[_0x1e4a('0xb')](function(_0xb53783){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x358707,_0x1e4a('0xc'));logger['debug'](_0x1e4a('0xd'),_0x358707,_0x1e4a('0xc'),JSON['stringify'](_0xb53783));if(_0xb53783[_0x1e4a('0xe')]){if(_0xb53783['error'][_0x1e4a('0xf')]===0x1f4){logger[_0x1e4a('0xe')](_0x1e4a('0x10'),_0x358707,_0xb53783[_0x1e4a('0xe')][_0x1e4a('0x11')]);return _0x43cfa3(_0xb53783[_0x1e4a('0xe')]['message']);}logger[_0x1e4a('0xe')](_0x1e4a('0x10'),_0x358707,_0xb53783[_0x1e4a('0xe')][_0x1e4a('0x11')]);return _0x297141(_0xb53783[_0x1e4a('0xe')]['message']);}else{logger[_0x1e4a('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x358707,_0x1e4a('0xc'));_0x297141(_0xb53783[_0x1e4a('0x13')]['message']);}})['catch'](function(_0x7e97a8){logger['error'](_0x1e4a('0x10'),_0x358707,_0x7e97a8);_0x43cfa3(_0x7e97a8);});});}