Built motion from commit da617fac.|2.6.6
[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 _0xb908=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xb908,0xb1));var _0x8b90=function(_0x13992d,_0x3029ea){_0x13992d=_0x13992d-0x0;var _0x3d15bf=_0xb908[_0x13992d];return _0x3d15bf;};'use strict';var _=require(_0x8b90('0x0'));var util=require('util');var moment=require(_0x8b90('0x1'));var BPromise=require(_0x8b90('0x2'));var rs=require(_0x8b90('0x3'));var fs=require('fs');var Redis=require(_0x8b90('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b90('0x5'));var logger=require('../../config/logger')(_0x8b90('0x6'));var config=require(_0x8b90('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8b90('0x8')][_0x8b90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54bcda,_0x35ed0c,_0x555f61){return new BPromise(function(_0x5e40ab,_0x23da2a){return client[_0x8b90('0xa')](_0x54bcda,_0x555f61)[_0x8b90('0xb')](function(_0x329ff1){logger['info'](_0x8b90('0xc'),_0x35ed0c,_0x8b90('0xd'));logger[_0x8b90('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x35ed0c,_0x8b90('0xd'),JSON[_0x8b90('0xf')](_0x329ff1));if(_0x329ff1[_0x8b90('0x10')]){if(_0x329ff1[_0x8b90('0x10')][_0x8b90('0x11')]===0x1f4){logger[_0x8b90('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x35ed0c,_0x329ff1[_0x8b90('0x10')][_0x8b90('0x12')]);return _0x23da2a(_0x329ff1[_0x8b90('0x10')][_0x8b90('0x12')]);}logger[_0x8b90('0x10')](_0x8b90('0xc'),_0x35ed0c,_0x329ff1[_0x8b90('0x10')][_0x8b90('0x12')]);return _0x5e40ab(_0x329ff1[_0x8b90('0x10')][_0x8b90('0x12')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x35ed0c,'request\x20sent');_0x5e40ab(_0x329ff1[_0x8b90('0x13')][_0x8b90('0x12')]);}})[_0x8b90('0x14')](function(_0x1d2c2c){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x35ed0c,_0x1d2c2c);_0x23da2a(_0x1d2c2c);});});}