Built motion from commit 3e059bc2.|2.5.32
[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 _0x6177=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','lodash','util','bluebird'];(function(_0x58142e,_0x13aaf6){var _0x39ff75=function(_0x2cb579){while(--_0x2cb579){_0x58142e['push'](_0x58142e['shift']());}};_0x39ff75(++_0x13aaf6);}(_0x6177,0x7b));var _0x7617=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6177[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x7617('0x0'));var util=require(_0x7617('0x1'));var moment=require('moment');var BPromise=require(_0x7617('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7617('0x3'))['db'];var utils=require(_0x7617('0x4'));var logger=require(_0x7617('0x5'))(_0x7617('0x6'));var config=require(_0x7617('0x7'));var jayson=require(_0x7617('0x8'));var client=jayson[_0x7617('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39cb3c,_0x58d9c4,_0x338dfe){return new BPromise(function(_0x14039a,_0x432326){return client['request'](_0x39cb3c,_0x338dfe)['then'](function(_0x41f630){logger['info'](_0x7617('0xa'),_0x58d9c4,'request\x20sent');logger[_0x7617('0xb')](_0x7617('0xc'),_0x58d9c4,_0x7617('0xd'),JSON[_0x7617('0xe')](_0x41f630));if(_0x41f630[_0x7617('0xf')]){if(_0x41f630['error']['code']===0x1f4){logger[_0x7617('0xf')](_0x7617('0xa'),_0x58d9c4,_0x41f630['error'][_0x7617('0x10')]);return _0x432326(_0x41f630[_0x7617('0xf')][_0x7617('0x10')]);}logger[_0x7617('0xf')](_0x7617('0xa'),_0x58d9c4,_0x41f630[_0x7617('0xf')][_0x7617('0x10')]);return _0x14039a(_0x41f630[_0x7617('0xf')][_0x7617('0x10')]);}else{logger[_0x7617('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x58d9c4,_0x7617('0xd'));_0x14039a(_0x41f630['result']['message']);}})['catch'](function(_0x584d5d){logger[_0x7617('0xf')](_0x7617('0xa'),_0x58d9c4,_0x584d5d);_0x432326(_0x584d5d);});});}