21817c77f5930d120506dc5724916ad423401a5c
[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 _0xe889=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe889,0x67));var _0x9e88=function(_0x70b06f,_0x57d602){_0x70b06f=_0x70b06f-0x0;var _0x2a1404=_0xe889[_0x70b06f];return _0x2a1404;};'use strict';var _=require(_0x9e88('0x0'));var util=require(_0x9e88('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9e88('0x2'));var fs=require('fs');var Redis=require(_0x9e88('0x3'));var db=require(_0x9e88('0x4'))['db'];var utils=require(_0x9e88('0x5'));var logger=require(_0x9e88('0x6'))(_0x9e88('0x7'));var config=require(_0x9e88('0x8'));var jayson=require(_0x9e88('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a03b9,_0x1001f9,_0x2e3b2b){return new BPromise(function(_0x3d293a,_0x1f18c5){return client[_0x9e88('0xa')](_0x4a03b9,_0x2e3b2b)[_0x9e88('0xb')](function(_0xc07d3b){logger['info'](_0x9e88('0xc'),_0x1001f9,_0x9e88('0xd'));logger['debug'](_0x9e88('0xe'),_0x1001f9,'request\x20sent',JSON[_0x9e88('0xf')](_0xc07d3b));if(_0xc07d3b[_0x9e88('0x10')]){if(_0xc07d3b[_0x9e88('0x10')][_0x9e88('0x11')]===0x1f4){logger[_0x9e88('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x1001f9,_0xc07d3b['error'][_0x9e88('0x12')]);return _0x1f18c5(_0xc07d3b['error']['message']);}logger[_0x9e88('0x10')](_0x9e88('0xc'),_0x1001f9,_0xc07d3b[_0x9e88('0x10')]['message']);return _0x3d293a(_0xc07d3b[_0x9e88('0x10')][_0x9e88('0x12')]);}else{logger[_0x9e88('0x13')](_0x9e88('0xc'),_0x1001f9,_0x9e88('0xd'));_0x3d293a(_0xc07d3b['result'][_0x9e88('0x12')]);}})[_0x9e88('0x14')](function(_0x228c82){logger[_0x9e88('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x1001f9,_0x228c82);_0x1f18c5(_0x228c82);});});}