Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / api / voiceMail / voiceMail.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 _0x61fa=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x2d10e6,_0x410e5e){var _0x20cf16=function(_0x26a88b){while(--_0x26a88b){_0x2d10e6['push'](_0x2d10e6['shift']());}};_0x20cf16(++_0x410e5e);}(_0x61fa,0x7b));var _0xa61f=function(_0x3b14e4,_0x277d5c){_0x3b14e4=_0x3b14e4-0x0;var _0x3e8616=_0x61fa[_0x3b14e4];return _0x3e8616;};'use strict';var _=require('lodash');var util=require(_0xa61f('0x0'));var moment=require(_0xa61f('0x1'));var BPromise=require(_0xa61f('0x2'));var rs=require(_0xa61f('0x3'));var fs=require('fs');var Redis=require(_0xa61f('0x4'));var db=require(_0xa61f('0x5'))['db'];var utils=require(_0xa61f('0x6'));var logger=require(_0xa61f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa61f('0x8')][_0xa61f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ebeae,_0x4e1425,_0x5a8009){return new BPromise(function(_0x25fa7d,_0x5346d1){return client[_0xa61f('0xa')](_0x1ebeae,_0x5a8009)['then'](function(_0x2a0359){logger[_0xa61f('0xb')](_0xa61f('0xc'),_0x4e1425,_0xa61f('0xd'));logger[_0xa61f('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x4e1425,_0xa61f('0xd'),JSON['stringify'](_0x2a0359));if(_0x2a0359[_0xa61f('0xf')]){if(_0x2a0359[_0xa61f('0xf')][_0xa61f('0x10')]===0x1f4){logger['error'](_0xa61f('0xc'),_0x4e1425,_0x2a0359['error'][_0xa61f('0x11')]);return _0x5346d1(_0x2a0359['error'][_0xa61f('0x11')]);}logger[_0xa61f('0xf')]('VoiceMail,\x20%s,\x20%s',_0x4e1425,_0x2a0359[_0xa61f('0xf')][_0xa61f('0x11')]);return _0x25fa7d(_0x2a0359[_0xa61f('0xf')][_0xa61f('0x11')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x4e1425,_0xa61f('0xd'));_0x25fa7d(_0x2a0359[_0xa61f('0x12')]['message']);}})[_0xa61f('0x13')](function(_0x2977f5){logger[_0xa61f('0xf')]('VoiceMail,\x20%s,\x20%s',_0x4e1425,_0x2977f5);_0x5346d1(_0x2977f5);});});}