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 _0xae4e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment'];(function(_0x1d4a48,_0x1b289c){var _0x100d67=function(_0x7ba067){while(--_0x7ba067){_0x1d4a48['push'](_0x1d4a48['shift']());}};_0x100d67(++_0x1b289c);}(_0xae4e,0x1b6));var _0xeae4=function(_0x10c8f0,_0xce9f83){_0x10c8f0=_0x10c8f0-0x0;var _0x5e933a=_0xae4e[_0x10c8f0];return _0x5e933a;};'use strict';var _=require(_0xeae4('0x0'));var util=require('util');var moment=require(_0xeae4('0x1'));var BPromise=require('bluebird');var rs=require(_0xeae4('0x2'));var fs=require('fs');var Redis=require(_0xeae4('0x3'));var db=require(_0xeae4('0x4'))['db'];var utils=require(_0xeae4('0x5'));var logger=require(_0xeae4('0x6'))(_0xeae4('0x7'));var config=require(_0xeae4('0x8'));var jayson=require(_0xeae4('0x9'));var client=jayson[_0xeae4('0xa')][_0xeae4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x371a3c,_0x4b248f,_0x3f8a63){return new BPromise(function(_0x274cdd,_0x5b3804){return client[_0xeae4('0xc')](_0x371a3c,_0x3f8a63)['then'](function(_0x4ff382){logger[_0xeae4('0xd')](_0xeae4('0xe'),_0x4b248f,_0xeae4('0xf'));logger[_0xeae4('0x10')](_0xeae4('0x11'),_0x4b248f,_0xeae4('0xf'),JSON['stringify'](_0x4ff382));if(_0x4ff382[_0xeae4('0x12')]){if(_0x4ff382[_0xeae4('0x12')]['code']===0x1f4){logger['error'](_0xeae4('0xe'),_0x4b248f,_0x4ff382[_0xeae4('0x12')][_0xeae4('0x13')]);return _0x5b3804(_0x4ff382[_0xeae4('0x12')][_0xeae4('0x13')]);}logger[_0xeae4('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x4b248f,_0x4ff382[_0xeae4('0x12')]['message']);return _0x274cdd(_0x4ff382[_0xeae4('0x12')]['message']);}else{logger[_0xeae4('0xd')](_0xeae4('0xe'),_0x4b248f,'request\x20sent');_0x274cdd(_0x4ff382[_0xeae4('0x14')][_0xeae4('0x13')]);}})[_0xeae4('0x15')](function(_0x56700a){logger[_0xeae4('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x4b248f,_0x56700a);_0x5b3804(_0x56700a);});});}