Built motion from commit (unavailable).|2.4.18
[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 _0x5704=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','ioredis'];(function(_0x2fb050,_0x340357){var _0x3e5513=function(_0x1eb98c){while(--_0x1eb98c){_0x2fb050['push'](_0x2fb050['shift']());}};_0x3e5513(++_0x340357);}(_0x5704,0x66));var _0x4570=function(_0x473b87,_0x3fb8d3){_0x473b87=_0x473b87-0x0;var _0x41e241=_0x5704[_0x473b87];return _0x41e241;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4570('0x0'));var rs=require(_0x4570('0x1'));var fs=require('fs');var Redis=require(_0x4570('0x2'));var db=require(_0x4570('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4570('0x4'))(_0x4570('0x5'));var config=require(_0x4570('0x6'));var jayson=require(_0x4570('0x7'));var client=jayson[_0x4570('0x8')][_0x4570('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x213921,_0x5a16fd,_0x40e4d8){return new BPromise(function(_0x49743a,_0x2423e7){return client[_0x4570('0xa')](_0x213921,_0x40e4d8)[_0x4570('0xb')](function(_0x4b1d51){logger[_0x4570('0xc')](_0x4570('0xd'),_0x5a16fd,'request\x20sent');logger[_0x4570('0xe')](_0x4570('0xf'),_0x5a16fd,'request\x20sent',JSON[_0x4570('0x10')](_0x4b1d51));if(_0x4b1d51[_0x4570('0x11')]){if(_0x4b1d51[_0x4570('0x11')][_0x4570('0x12')]===0x1f4){logger[_0x4570('0x11')](_0x4570('0xd'),_0x5a16fd,_0x4b1d51[_0x4570('0x11')]['message']);return _0x2423e7(_0x4b1d51[_0x4570('0x11')]['message']);}logger[_0x4570('0x11')](_0x4570('0xd'),_0x5a16fd,_0x4b1d51[_0x4570('0x11')][_0x4570('0x13')]);return _0x49743a(_0x4b1d51[_0x4570('0x11')][_0x4570('0x13')]);}else{logger['info'](_0x4570('0xd'),_0x5a16fd,'request\x20sent');_0x49743a(_0x4b1d51[_0x4570('0x14')]['message']);}})['catch'](function(_0x33499a){logger[_0x4570('0x11')](_0x4570('0xd'),_0x5a16fd,_0x33499a);_0x2423e7(_0x33499a);});});}