ba2eb56db7f7c5c13302e527c683a13802a23ad4
[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 _0x4f3a=['../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x59acd4,_0x113f4a){var _0x3cc9a5=function(_0x4a4a62){while(--_0x4a4a62){_0x59acd4['push'](_0x59acd4['shift']());}};_0x3cc9a5(++_0x113f4a);}(_0x4f3a,0x165));var _0xa4f3=function(_0x3df3c6,_0x496e1a){_0x3df3c6=_0x3df3c6-0x0;var _0x254c43=_0x4f3a[_0x3df3c6];return _0x254c43;};'use strict';var _=require(_0xa4f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa4f3('0x1'));var rs=require(_0xa4f3('0x2'));var fs=require('fs');var Redis=require(_0xa4f3('0x3'));var db=require(_0xa4f3('0x4'))['db'];var utils=require(_0xa4f3('0x5'));var logger=require(_0xa4f3('0x6'))(_0xa4f3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa4f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c2825,_0x20c033,_0x2e5e4b){return new BPromise(function(_0x27632d,_0x3da1eb){return client[_0xa4f3('0x9')](_0x5c2825,_0x2e5e4b)['then'](function(_0x38e18c){logger[_0xa4f3('0xa')](_0xa4f3('0xb'),_0x20c033,_0xa4f3('0xc'));logger[_0xa4f3('0xd')](_0xa4f3('0xe'),_0x20c033,_0xa4f3('0xc'),JSON[_0xa4f3('0xf')](_0x38e18c));if(_0x38e18c['error']){if(_0x38e18c['error']['code']===0x1f4){logger[_0xa4f3('0x10')](_0xa4f3('0xb'),_0x20c033,_0x38e18c[_0xa4f3('0x10')][_0xa4f3('0x11')]);return _0x3da1eb(_0x38e18c[_0xa4f3('0x10')][_0xa4f3('0x11')]);}logger[_0xa4f3('0x10')](_0xa4f3('0xb'),_0x20c033,_0x38e18c[_0xa4f3('0x10')][_0xa4f3('0x11')]);return _0x27632d(_0x38e18c['error']['message']);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x20c033,_0xa4f3('0xc'));_0x27632d(_0x38e18c['result'][_0xa4f3('0x11')]);}})[_0xa4f3('0x12')](function(_0x459c44){logger[_0xa4f3('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x20c033,_0x459c44);_0x3da1eb(_0x459c44);});});}