Built motion from commit (unavailable).|2.5.31
[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 _0x5720=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x5720,0xf6));var _0x0572=function(_0x28a00f,_0x1c7be3){_0x28a00f=_0x28a00f-0x0;var _0x32ea18=_0x5720[_0x28a00f];return _0x32ea18;};'use strict';var _=require(_0x0572('0x0'));var util=require(_0x0572('0x1'));var moment=require(_0x0572('0x2'));var BPromise=require(_0x0572('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0572('0x4'));var db=require(_0x0572('0x5'))['db'];var utils=require(_0x0572('0x6'));var logger=require(_0x0572('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0572('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50ccae,_0x2c7dd6,_0x1bcc72){return new BPromise(function(_0xc89350,_0x195a06){return client[_0x0572('0x9')](_0x50ccae,_0x1bcc72)[_0x0572('0xa')](function(_0x104b65){logger[_0x0572('0xb')](_0x0572('0xc'),_0x2c7dd6,_0x0572('0xd'));logger[_0x0572('0xe')](_0x0572('0xf'),_0x2c7dd6,_0x0572('0xd'),JSON[_0x0572('0x10')](_0x104b65));if(_0x104b65[_0x0572('0x11')]){if(_0x104b65[_0x0572('0x11')]['code']===0x1f4){logger[_0x0572('0x11')](_0x0572('0xc'),_0x2c7dd6,_0x104b65['error']['message']);return _0x195a06(_0x104b65[_0x0572('0x11')][_0x0572('0x12')]);}logger[_0x0572('0x11')](_0x0572('0xc'),_0x2c7dd6,_0x104b65[_0x0572('0x11')][_0x0572('0x12')]);return _0xc89350(_0x104b65[_0x0572('0x11')][_0x0572('0x12')]);}else{logger['info'](_0x0572('0xc'),_0x2c7dd6,_0x0572('0xd'));_0xc89350(_0x104b65['result'][_0x0572('0x12')]);}})[_0x0572('0x13')](function(_0x5e3b15){logger['error'](_0x0572('0xc'),_0x2c7dd6,_0x5e3b15);_0x195a06(_0x5e3b15);});});}