749cb0f02e699250ab04a6ca32aa60d21a09a1d6
[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 _0x3d3a=['http','then','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x3d3a,0x78));var _0xa3d3=function(_0xe38e2a,_0x36597d){_0xe38e2a=_0xe38e2a-0x0;var _0x3f8130=_0x3d3a[_0xe38e2a];return _0x3f8130;};'use strict';var _=require('lodash');var util=require(_0xa3d3('0x0'));var moment=require(_0xa3d3('0x1'));var BPromise=require(_0xa3d3('0x2'));var rs=require(_0xa3d3('0x3'));var fs=require('fs');var Redis=require(_0xa3d3('0x4'));var db=require(_0xa3d3('0x5'))['db'];var utils=require(_0xa3d3('0x6'));var logger=require(_0xa3d3('0x7'))(_0xa3d3('0x8'));var config=require(_0xa3d3('0x9'));var jayson=require(_0xa3d3('0xa'));var client=jayson[_0xa3d3('0xb')][_0xa3d3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x284cb6,_0x414e2f,_0x4f581c){return new BPromise(function(_0x3b81d4,_0x4a0d46){return client['request'](_0x284cb6,_0x4f581c)[_0xa3d3('0xd')](function(_0x275497){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x414e2f,_0xa3d3('0xe'));logger['debug'](_0xa3d3('0xf'),_0x414e2f,_0xa3d3('0xe'),JSON[_0xa3d3('0x10')](_0x275497));if(_0x275497['error']){if(_0x275497[_0xa3d3('0x11')]['code']===0x1f4){logger[_0xa3d3('0x11')](_0xa3d3('0x12'),_0x414e2f,_0x275497[_0xa3d3('0x11')]['message']);return _0x4a0d46(_0x275497['error'][_0xa3d3('0x13')]);}logger['error'](_0xa3d3('0x12'),_0x414e2f,_0x275497[_0xa3d3('0x11')][_0xa3d3('0x13')]);return _0x3b81d4(_0x275497[_0xa3d3('0x11')][_0xa3d3('0x13')]);}else{logger['info'](_0xa3d3('0x12'),_0x414e2f,_0xa3d3('0xe'));_0x3b81d4(_0x275497[_0xa3d3('0x14')]['message']);}})[_0xa3d3('0x15')](function(_0x45d4b0){logger[_0xa3d3('0x11')](_0xa3d3('0x12'),_0x414e2f,_0x45d4b0);_0x4a0d46(_0x45d4b0);});});}