Built motion from commit (unavailable).|2.5.29
[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 _0x8a93=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x48fd06,_0x24a5fa){var _0x5309b4=function(_0x4bf07c){while(--_0x4bf07c){_0x48fd06['push'](_0x48fd06['shift']());}};_0x5309b4(++_0x24a5fa);}(_0x8a93,0x16b));var _0x38a9=function(_0x5dde91,_0x3bb66e){_0x5dde91=_0x5dde91-0x0;var _0x402888=_0x8a93[_0x5dde91];return _0x402888;};'use strict';var _=require(_0x38a9('0x0'));var util=require(_0x38a9('0x1'));var moment=require('moment');var BPromise=require(_0x38a9('0x2'));var rs=require(_0x38a9('0x3'));var fs=require('fs');var Redis=require(_0x38a9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x38a9('0x5'))('rpc');var config=require(_0x38a9('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2dc64f,_0x5dce27,_0x9010c0){return new BPromise(function(_0x18d861,_0x3e017f){return client[_0x38a9('0x7')](_0x2dc64f,_0x9010c0)[_0x38a9('0x8')](function(_0x30d74f){logger[_0x38a9('0x9')](_0x38a9('0xa'),_0x5dce27,_0x38a9('0xb'));logger[_0x38a9('0xc')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x5dce27,_0x38a9('0xb'),JSON[_0x38a9('0xd')](_0x30d74f));if(_0x30d74f['error']){if(_0x30d74f[_0x38a9('0xe')]['code']===0x1f4){logger[_0x38a9('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x5dce27,_0x30d74f[_0x38a9('0xe')][_0x38a9('0xf')]);return _0x3e017f(_0x30d74f['error']['message']);}logger[_0x38a9('0xe')](_0x38a9('0xa'),_0x5dce27,_0x30d74f[_0x38a9('0xe')]['message']);return _0x18d861(_0x30d74f[_0x38a9('0xe')]['message']);}else{logger[_0x38a9('0x9')](_0x38a9('0xa'),_0x5dce27,_0x38a9('0xb'));_0x18d861(_0x30d74f[_0x38a9('0x10')][_0x38a9('0xf')]);}})[_0x38a9('0x11')](function(_0x1c3717){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x5dce27,_0x1c3717);_0x3e017f(_0x1c3717);});});}