e49aeb1813434b4896abdac96c18b127f5e6d380
[motion2.git] / server / api / voiceMailMessage / voiceMailMessage.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 _0xa95b=['request\x20sent','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x1f72d6,_0x2f6ea6){var _0x27f3b8=function(_0x488932){while(--_0x488932){_0x1f72d6['push'](_0x1f72d6['shift']());}};_0x27f3b8(++_0x2f6ea6);}(_0xa95b,0x181));var _0xba95=function(_0x2bdb58,_0x580ec2){_0x2bdb58=_0x2bdb58-0x0;var _0x50e771=_0xa95b[_0x2bdb58];return _0x50e771;};'use strict';var _=require(_0xba95('0x0'));var util=require(_0xba95('0x1'));var moment=require(_0xba95('0x2'));var BPromise=require(_0xba95('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba95('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba95('0x5'))(_0xba95('0x6'));var config=require(_0xba95('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56fe0b,_0x2d5938,_0x2a0285){return new BPromise(function(_0x3e8688,_0x221c55){return client[_0xba95('0x8')](_0x56fe0b,_0x2a0285)[_0xba95('0x9')](function(_0x199ca6){logger[_0xba95('0xa')](_0xba95('0xb'),_0x2d5938,'request\x20sent');logger[_0xba95('0xc')](_0xba95('0xd'),_0x2d5938,_0xba95('0xe'),JSON['stringify'](_0x199ca6));if(_0x199ca6[_0xba95('0xf')]){if(_0x199ca6[_0xba95('0xf')][_0xba95('0x10')]===0x1f4){logger[_0xba95('0xf')](_0xba95('0xb'),_0x2d5938,_0x199ca6[_0xba95('0xf')][_0xba95('0x11')]);return _0x221c55(_0x199ca6[_0xba95('0xf')][_0xba95('0x11')]);}logger[_0xba95('0xf')](_0xba95('0xb'),_0x2d5938,_0x199ca6[_0xba95('0xf')][_0xba95('0x11')]);return _0x3e8688(_0x199ca6['error']['message']);}else{logger['info'](_0xba95('0xb'),_0x2d5938,_0xba95('0xe'));_0x3e8688(_0x199ca6[_0xba95('0x12')][_0xba95('0x11')]);}})['catch'](function(_0x2cc1e4){logger[_0xba95('0xf')](_0xba95('0xb'),_0x2d5938,_0x2cc1e4);_0x221c55(_0x2cc1e4);});});}