Built motion from commit 1cfc41f6.|2.5.41
[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 _0x5621=['info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','then'];(function(_0x4bdc0c,_0x45c08e){var _0x28fed3=function(_0x18f280){while(--_0x18f280){_0x4bdc0c['push'](_0x4bdc0c['shift']());}};_0x28fed3(++_0x45c08e);}(_0x5621,0x127));var _0x1562=function(_0x5b623c,_0x59afc5){_0x5b623c=_0x5b623c-0x0;var _0x32c286=_0x5621[_0x5b623c];return _0x32c286;};'use strict';var _=require(_0x1562('0x0'));var util=require('util');var moment=require(_0x1562('0x1'));var BPromise=require(_0x1562('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1562('0x3'));var db=require(_0x1562('0x4'))['db'];var utils=require(_0x1562('0x5'));var logger=require('../../config/logger')(_0x1562('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1562('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb79fc5,_0x1ac4c1,_0x24e1db){return new BPromise(function(_0x4bf90f,_0xc7bd8c){return client['request'](_0xb79fc5,_0x24e1db)[_0x1562('0x8')](function(_0x509466){logger[_0x1562('0x9')](_0x1562('0xa'),_0x1ac4c1,_0x1562('0xb'));logger[_0x1562('0xc')](_0x1562('0xd'),_0x1ac4c1,_0x1562('0xb'),JSON[_0x1562('0xe')](_0x509466));if(_0x509466[_0x1562('0xf')]){if(_0x509466[_0x1562('0xf')][_0x1562('0x10')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x1ac4c1,_0x509466[_0x1562('0xf')][_0x1562('0x11')]);return _0xc7bd8c(_0x509466[_0x1562('0xf')][_0x1562('0x11')]);}logger[_0x1562('0xf')](_0x1562('0xa'),_0x1ac4c1,_0x509466['error'][_0x1562('0x11')]);return _0x4bf90f(_0x509466[_0x1562('0xf')][_0x1562('0x11')]);}else{logger[_0x1562('0x9')](_0x1562('0xa'),_0x1ac4c1,_0x1562('0xb'));_0x4bf90f(_0x509466[_0x1562('0x12')][_0x1562('0x11')]);}})['catch'](function(_0x58ecfe){logger[_0x1562('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x1ac4c1,_0x58ecfe);_0xc7bd8c(_0x58ecfe);});});}