Built motion from commit (unavailable).|2.2.6
[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 _0x8aae=['jayson/promise','client','http','info','VoiceChanSpy,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x872f6f,_0x5efe7b){var _0x59a5f4=function(_0x147463){while(--_0x147463){_0x872f6f['push'](_0x872f6f['shift']());}};_0x59a5f4(++_0x5efe7b);}(_0x8aae,0x138));var _0xe8aa=function(_0xa32419,_0x290c00){_0xa32419=_0xa32419-0x0;var _0x42dcd1=_0x8aae[_0xa32419];return _0x42dcd1;};'use strict';var _=require(_0xe8aa('0x0'));var util=require(_0xe8aa('0x1'));var moment=require(_0xe8aa('0x2'));var BPromise=require('bluebird');var rs=require(_0xe8aa('0x3'));var fs=require('fs');var Redis=require(_0xe8aa('0x4'));var db=require(_0xe8aa('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe8aa('0x6'));var config=require(_0xe8aa('0x7'));var jayson=require(_0xe8aa('0x8'));var client=jayson[_0xe8aa('0x9')][_0xe8aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c9d3a,_0x5cccd6,_0x50ac0f){return new BPromise(function(_0x14ba4b,_0x328ce1){return client['request'](_0x2c9d3a,_0x50ac0f)['then'](function(_0x3c7fd9){logger[_0xe8aa('0xb')](_0xe8aa('0xc'),_0x5cccd6,'request\x20sent');logger[_0xe8aa('0xd')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x5cccd6,'request\x20sent',JSON['stringify'](_0x3c7fd9));if(_0x3c7fd9[_0xe8aa('0xe')]){if(_0x3c7fd9[_0xe8aa('0xe')][_0xe8aa('0xf')]===0x1f4){logger[_0xe8aa('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x5cccd6,_0x3c7fd9[_0xe8aa('0xe')]['message']);return _0x328ce1(_0x3c7fd9[_0xe8aa('0xe')]['message']);}logger[_0xe8aa('0xe')](_0xe8aa('0xc'),_0x5cccd6,_0x3c7fd9[_0xe8aa('0xe')][_0xe8aa('0x10')]);return _0x14ba4b(_0x3c7fd9['error'][_0xe8aa('0x10')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x5cccd6,_0xe8aa('0x11'));_0x14ba4b(_0x3c7fd9[_0xe8aa('0x12')][_0xe8aa('0x10')]);}})[_0xe8aa('0x13')](function(_0x38f79f){logger[_0xe8aa('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x5cccd6,_0x38f79f);_0x328ce1(_0x38f79f);});});}