ed555744f24e985e4cecf2d911985270de92206e
[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 _0x6c3f=['../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','code','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xd653eb,_0xfef7e3){var _0x4ef048=function(_0x154884){while(--_0x154884){_0xd653eb['push'](_0xd653eb['shift']());}};_0x4ef048(++_0xfef7e3);}(_0x6c3f,0x1e9));var _0xf6c3=function(_0x23f9c7,_0xbea809){_0x23f9c7=_0x23f9c7-0x0;var _0x546cc5=_0x6c3f[_0x23f9c7];return _0x546cc5;};'use strict';var _=require(_0xf6c3('0x0'));var util=require(_0xf6c3('0x1'));var moment=require(_0xf6c3('0x2'));var BPromise=require(_0xf6c3('0x3'));var rs=require(_0xf6c3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6c3('0x6'))(_0xf6c3('0x7'));var config=require(_0xf6c3('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56f58e,_0x19718f,_0x5ca1ba){return new BPromise(function(_0x339407,_0x30687b){return client[_0xf6c3('0x9')](_0x56f58e,_0x5ca1ba)[_0xf6c3('0xa')](function(_0x39fda7){logger[_0xf6c3('0xb')](_0xf6c3('0xc'),_0x19718f,_0xf6c3('0xd'));logger['debug'](_0xf6c3('0xe'),_0x19718f,'request\x20sent',JSON['stringify'](_0x39fda7));if(_0x39fda7['error']){if(_0x39fda7['error'][_0xf6c3('0xf')]===0x1f4){logger[_0xf6c3('0x10')](_0xf6c3('0xc'),_0x19718f,_0x39fda7['error']['message']);return _0x30687b(_0x39fda7[_0xf6c3('0x10')]['message']);}logger['error'](_0xf6c3('0xc'),_0x19718f,_0x39fda7[_0xf6c3('0x10')]['message']);return _0x339407(_0x39fda7[_0xf6c3('0x10')]['message']);}else{logger[_0xf6c3('0xb')](_0xf6c3('0xc'),_0x19718f,_0xf6c3('0xd'));_0x339407(_0x39fda7['result'][_0xf6c3('0x11')]);}})[_0xf6c3('0x12')](function(_0x47a1f8){logger[_0xf6c3('0x10')](_0xf6c3('0xc'),_0x19718f,_0x47a1f8);_0x30687b(_0x47a1f8);});});}