Built motion from commit (unavailable).|2.3.4
[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 _0x3e26=['stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','info','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','request\x20sent'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3e26,0x8c));var _0x63e2=function(_0x3e4af3,_0x5e6681){_0x3e4af3=_0x3e4af3-0x0;var _0x190c6e=_0x3e26[_0x3e4af3];return _0x190c6e;};'use strict';var _=require(_0x63e2('0x0'));var util=require(_0x63e2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x63e2('0x2'));var fs=require('fs');var Redis=require(_0x63e2('0x3'));var db=require(_0x63e2('0x4'))['db'];var utils=require(_0x63e2('0x5'));var logger=require('../../config/logger')(_0x63e2('0x6'));var config=require(_0x63e2('0x7'));var jayson=require(_0x63e2('0x8'));var client=jayson[_0x63e2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cbef1,_0x3db9f3,_0x4588e0){return new BPromise(function(_0x2faa6a,_0x9e25b0){return client['request'](_0x1cbef1,_0x4588e0)[_0x63e2('0xa')](function(_0x54037e){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x3db9f3,_0x63e2('0xb'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x3db9f3,_0x63e2('0xb'),JSON[_0x63e2('0xc')](_0x54037e));if(_0x54037e['error']){if(_0x54037e[_0x63e2('0xd')][_0x63e2('0xe')]===0x1f4){logger['error'](_0x63e2('0xf'),_0x3db9f3,_0x54037e[_0x63e2('0xd')]['message']);return _0x9e25b0(_0x54037e[_0x63e2('0xd')][_0x63e2('0x10')]);}logger[_0x63e2('0xd')](_0x63e2('0xf'),_0x3db9f3,_0x54037e[_0x63e2('0xd')][_0x63e2('0x10')]);return _0x2faa6a(_0x54037e[_0x63e2('0xd')][_0x63e2('0x10')]);}else{logger[_0x63e2('0x11')](_0x63e2('0xf'),_0x3db9f3,_0x63e2('0xb'));_0x2faa6a(_0x54037e[_0x63e2('0x12')]['message']);}})['catch'](function(_0x3f8193){logger[_0x63e2('0xd')](_0x63e2('0xf'),_0x3db9f3,_0x3f8193);_0x9e25b0(_0x3f8193);});});}