Built motion from commit 497d3d92.|2.5.43
[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 _0xb9ce=['debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3d864a,_0x587a40){var _0x35f3c4=function(_0x12b985){while(--_0x12b985){_0x3d864a['push'](_0x3d864a['shift']());}};_0x35f3c4(++_0x587a40);}(_0xb9ce,0x1ab));var _0xeb9c=function(_0x377a04,_0x267248){_0x377a04=_0x377a04-0x0;var _0x506667=_0xb9ce[_0x377a04];return _0x506667;};'use strict';var _=require(_0xeb9c('0x0'));var util=require(_0xeb9c('0x1'));var moment=require(_0xeb9c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb9c('0x3'))['db'];var utils=require(_0xeb9c('0x4'));var logger=require(_0xeb9c('0x5'))(_0xeb9c('0x6'));var config=require(_0xeb9c('0x7'));var jayson=require(_0xeb9c('0x8'));var client=jayson[_0xeb9c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a0bb9,_0x31224e,_0xc5338d){return new BPromise(function(_0x4d604c,_0x3c897a){return client[_0xeb9c('0xa')](_0x3a0bb9,_0xc5338d)[_0xeb9c('0xb')](function(_0x3c0824){logger['info'](_0xeb9c('0xc'),_0x31224e,_0xeb9c('0xd'));logger[_0xeb9c('0xe')](_0xeb9c('0xf'),_0x31224e,_0xeb9c('0xd'),JSON[_0xeb9c('0x10')](_0x3c0824));if(_0x3c0824[_0xeb9c('0x11')]){if(_0x3c0824['error'][_0xeb9c('0x12')]===0x1f4){logger['error'](_0xeb9c('0xc'),_0x31224e,_0x3c0824[_0xeb9c('0x11')]['message']);return _0x3c897a(_0x3c0824[_0xeb9c('0x11')][_0xeb9c('0x13')]);}logger[_0xeb9c('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x31224e,_0x3c0824[_0xeb9c('0x11')]['message']);return _0x4d604c(_0x3c0824[_0xeb9c('0x11')][_0xeb9c('0x13')]);}else{logger[_0xeb9c('0x14')](_0xeb9c('0xc'),_0x31224e,_0xeb9c('0xd'));_0x4d604c(_0x3c0824['result'][_0xeb9c('0x13')]);}})['catch'](function(_0x33958b){logger['error'](_0xeb9c('0xc'),_0x31224e,_0x33958b);_0x3c897a(_0x33958b);});});}