Built motion from commit (unavailable).|2.6.0
[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 _0xd415=['../../config/utils','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','request\x20sent','result','catch','util','moment','randomstring','ioredis'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xd415,0x9d));var _0x5d41=function(_0x364cf8,_0x146b9b){_0x364cf8=_0x364cf8-0x0;var _0x6a59ee=_0xd415[_0x364cf8];return _0x6a59ee;};'use strict';var _=require('lodash');var util=require(_0x5d41('0x0'));var moment=require(_0x5d41('0x1'));var BPromise=require('bluebird');var rs=require(_0x5d41('0x2'));var fs=require('fs');var Redis=require(_0x5d41('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d41('0x4'));var logger=require('../../config/logger')(_0x5d41('0x5'));var config=require(_0x5d41('0x6'));var jayson=require(_0x5d41('0x7'));var client=jayson[_0x5d41('0x8')][_0x5d41('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5794cf,_0x8b1c1c,_0x3de871){return new BPromise(function(_0x2fe64b,_0x59d392){return client[_0x5d41('0xa')](_0x5794cf,_0x3de871)[_0x5d41('0xb')](function(_0x3d240a){logger[_0x5d41('0xc')](_0x5d41('0xd'),_0x8b1c1c,'request\x20sent');logger[_0x5d41('0xe')](_0x5d41('0xf'),_0x8b1c1c,'request\x20sent',JSON[_0x5d41('0x10')](_0x3d240a));if(_0x3d240a[_0x5d41('0x11')]){if(_0x3d240a[_0x5d41('0x11')][_0x5d41('0x12')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x8b1c1c,_0x3d240a['error']['message']);return _0x59d392(_0x3d240a[_0x5d41('0x11')][_0x5d41('0x13')]);}logger[_0x5d41('0x11')](_0x5d41('0xd'),_0x8b1c1c,_0x3d240a[_0x5d41('0x11')][_0x5d41('0x13')]);return _0x2fe64b(_0x3d240a[_0x5d41('0x11')][_0x5d41('0x13')]);}else{logger[_0x5d41('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x8b1c1c,_0x5d41('0x14'));_0x2fe64b(_0x3d240a[_0x5d41('0x15')][_0x5d41('0x13')]);}})[_0x5d41('0x16')](function(_0x3b6ec7){logger[_0x5d41('0x11')](_0x5d41('0xd'),_0x8b1c1c,_0x3b6ec7);_0x59d392(_0x3b6ec7);});});}