Built motion from commit (unavailable).|2.2.0
[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 _0x3be2=['request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x207dff,_0x54b360){var _0xc0e994=function(_0x2997de){while(--_0x2997de){_0x207dff['push'](_0x207dff['shift']());}};_0xc0e994(++_0x54b360);}(_0x3be2,0xbe));var _0x23be=function(_0x313194,_0x46be1b){_0x313194=_0x313194-0x0;var _0x171c5c=_0x3be2[_0x313194];return _0x171c5c;};'use strict';var _=require(_0x23be('0x0'));var util=require(_0x23be('0x1'));var moment=require('moment');var BPromise=require(_0x23be('0x2'));var rs=require(_0x23be('0x3'));var fs=require('fs');var Redis=require(_0x23be('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x23be('0x5'));var logger=require(_0x23be('0x6'))(_0x23be('0x7'));var config=require(_0x23be('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x23be('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b0747,_0xd97957,_0x5ab704){return new BPromise(function(_0x59f384,_0x5cbad7){return client[_0x23be('0xa')](_0x2b0747,_0x5ab704)[_0x23be('0xb')](function(_0xfdb1a8){logger[_0x23be('0xc')](_0x23be('0xd'),_0xd97957,_0x23be('0xe'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0xd97957,_0x23be('0xe'),JSON[_0x23be('0xf')](_0xfdb1a8));if(_0xfdb1a8['error']){if(_0xfdb1a8['error'][_0x23be('0x10')]===0x1f4){logger[_0x23be('0x11')](_0x23be('0xd'),_0xd97957,_0xfdb1a8['error'][_0x23be('0x12')]);return _0x5cbad7(_0xfdb1a8[_0x23be('0x11')][_0x23be('0x12')]);}logger[_0x23be('0x11')](_0x23be('0xd'),_0xd97957,_0xfdb1a8['error'][_0x23be('0x12')]);return _0x59f384(_0xfdb1a8[_0x23be('0x11')][_0x23be('0x12')]);}else{logger[_0x23be('0xc')](_0x23be('0xd'),_0xd97957,_0x23be('0xe'));_0x59f384(_0xfdb1a8['result'][_0x23be('0x12')]);}})[_0x23be('0x13')](function(_0x289354){logger[_0x23be('0x11')](_0x23be('0xd'),_0xd97957,_0x289354);_0x5cbad7(_0x289354);});});}