Built motion from commit (unavailable).|2.5.5
[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 _0x4187=['lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3f6d59,_0x2dd14d){var _0x4b62fb=function(_0x4d5eb3){while(--_0x4d5eb3){_0x3f6d59['push'](_0x3f6d59['shift']());}};_0x4b62fb(++_0x2dd14d);}(_0x4187,0x154));var _0x7418=function(_0x27310c,_0x3b5528){_0x27310c=_0x27310c-0x0;var _0x3f3657=_0x4187[_0x27310c];return _0x3f3657;};'use strict';var _=require(_0x7418('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7418('0x1'));var fs=require('fs');var Redis=require(_0x7418('0x2'));var db=require(_0x7418('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7418('0x4'))(_0x7418('0x5'));var config=require(_0x7418('0x6'));var jayson=require(_0x7418('0x7'));var client=jayson['client'][_0x7418('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40bfad,_0xeff915,_0xbd3ebe){return new BPromise(function(_0x403371,_0xc0bca2){return client[_0x7418('0x9')](_0x40bfad,_0xbd3ebe)[_0x7418('0xa')](function(_0x53cb98){logger[_0x7418('0xb')](_0x7418('0xc'),_0xeff915,_0x7418('0xd'));logger[_0x7418('0xe')](_0x7418('0xf'),_0xeff915,_0x7418('0xd'),JSON[_0x7418('0x10')](_0x53cb98));if(_0x53cb98['error']){if(_0x53cb98[_0x7418('0x11')]['code']===0x1f4){logger[_0x7418('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0xeff915,_0x53cb98[_0x7418('0x11')][_0x7418('0x12')]);return _0xc0bca2(_0x53cb98[_0x7418('0x11')]['message']);}logger['error'](_0x7418('0xc'),_0xeff915,_0x53cb98[_0x7418('0x11')][_0x7418('0x12')]);return _0x403371(_0x53cb98[_0x7418('0x11')][_0x7418('0x12')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0xeff915,_0x7418('0xd'));_0x403371(_0x53cb98[_0x7418('0x13')]['message']);}})['catch'](function(_0xd1f434){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0xeff915,_0xd1f434);_0xc0bca2(_0xd1f434);});});}