69e517afa568ee5426e35f07dd115a1371cd9608
[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 _0x69f9=['../../config/environment','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x1fb72f,_0x32aef7){var _0x3a01d0=function(_0x12d4a2){while(--_0x12d4a2){_0x1fb72f['push'](_0x1fb72f['shift']());}};_0x3a01d0(++_0x32aef7);}(_0x69f9,0xf9));var _0x969f=function(_0x2f3420,_0x4ce6dd){_0x2f3420=_0x2f3420-0x0;var _0x5bc661=_0x69f9[_0x2f3420];return _0x5bc661;};'use strict';var _=require(_0x969f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x969f('0x1'));var rs=require(_0x969f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x969f('0x3'))['db'];var utils=require(_0x969f('0x4'));var logger=require('../../config/logger')(_0x969f('0x5'));var config=require(_0x969f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x969f('0x7')][_0x969f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a1b9d,_0x43fdbd,_0x151f03){return new BPromise(function(_0x5d081b,_0x2cd0dd){return client['request'](_0x2a1b9d,_0x151f03)[_0x969f('0x9')](function(_0x1c0427){logger[_0x969f('0xa')](_0x969f('0xb'),_0x43fdbd,'request\x20sent');logger[_0x969f('0xc')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x43fdbd,_0x969f('0xd'),JSON['stringify'](_0x1c0427));if(_0x1c0427['error']){if(_0x1c0427[_0x969f('0xe')]['code']===0x1f4){logger[_0x969f('0xe')](_0x969f('0xb'),_0x43fdbd,_0x1c0427[_0x969f('0xe')][_0x969f('0xf')]);return _0x2cd0dd(_0x1c0427[_0x969f('0xe')]['message']);}logger[_0x969f('0xe')](_0x969f('0xb'),_0x43fdbd,_0x1c0427[_0x969f('0xe')][_0x969f('0xf')]);return _0x5d081b(_0x1c0427[_0x969f('0xe')][_0x969f('0xf')]);}else{logger[_0x969f('0xa')](_0x969f('0xb'),_0x43fdbd,'request\x20sent');_0x5d081b(_0x1c0427[_0x969f('0x10')][_0x969f('0xf')]);}})['catch'](function(_0x1b9077){logger['error'](_0x969f('0xb'),_0x43fdbd,_0x1b9077);_0x2cd0dd(_0x1b9077);});});}