7e4ddd4bfd04c5e5b1868d6b276bdad8d43698a4
[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 _0x2995=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x2995,0x17f));var _0x5299=function(_0x364648,_0xa07836){_0x364648=_0x364648-0x0;var _0x391dd7=_0x2995[_0x364648];return _0x391dd7;};'use strict';var _=require(_0x5299('0x0'));var util=require('util');var moment=require(_0x5299('0x1'));var BPromise=require(_0x5299('0x2'));var rs=require(_0x5299('0x3'));var fs=require('fs');var Redis=require(_0x5299('0x4'));var db=require(_0x5299('0x5'))['db'];var utils=require(_0x5299('0x6'));var logger=require(_0x5299('0x7'))(_0x5299('0x8'));var config=require('../../config/environment');var jayson=require(_0x5299('0x9'));var client=jayson[_0x5299('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x581c2c,_0x26c9c7,_0x4c0c6f){return new BPromise(function(_0x3181ea,_0x2a5a9e){return client[_0x5299('0xb')](_0x581c2c,_0x4c0c6f)['then'](function(_0xc0d75d){logger[_0x5299('0xc')](_0x5299('0xd'),_0x26c9c7,_0x5299('0xe'));logger[_0x5299('0xf')](_0x5299('0x10'),_0x26c9c7,_0x5299('0xe'),JSON[_0x5299('0x11')](_0xc0d75d));if(_0xc0d75d[_0x5299('0x12')]){if(_0xc0d75d[_0x5299('0x12')]['code']===0x1f4){logger[_0x5299('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x26c9c7,_0xc0d75d[_0x5299('0x12')][_0x5299('0x13')]);return _0x2a5a9e(_0xc0d75d[_0x5299('0x12')][_0x5299('0x13')]);}logger[_0x5299('0x12')](_0x5299('0xd'),_0x26c9c7,_0xc0d75d[_0x5299('0x12')][_0x5299('0x13')]);return _0x3181ea(_0xc0d75d[_0x5299('0x12')][_0x5299('0x13')]);}else{logger['info'](_0x5299('0xd'),_0x26c9c7,_0x5299('0xe'));_0x3181ea(_0xc0d75d[_0x5299('0x14')][_0x5299('0x13')]);}})[_0x5299('0x15')](function(_0x32d9e6){logger[_0x5299('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x26c9c7,_0x32d9e6);_0x2a5a9e(_0x32d9e6);});});}