Built motion from commit b5413ace.|2.6.9
[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 _0x1c60=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message'];(function(_0x4df6ba,_0x477c3e){var _0x472acf=function(_0x248987){while(--_0x248987){_0x4df6ba['push'](_0x4df6ba['shift']());}};_0x472acf(++_0x477c3e);}(_0x1c60,0x144));var _0x01c6=function(_0x5dafd0,_0x3bcbb6){_0x5dafd0=_0x5dafd0-0x0;var _0x364354=_0x1c60[_0x5dafd0];return _0x364354;};'use strict';var _=require(_0x01c6('0x0'));var util=require('util');var moment=require(_0x01c6('0x1'));var BPromise=require(_0x01c6('0x2'));var rs=require(_0x01c6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01c6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x01c6('0x5'))(_0x01c6('0x6'));var config=require(_0x01c6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x01c6('0x8')][_0x01c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e9497,_0x4ab67b,_0x4ab37a){return new BPromise(function(_0x2889ae,_0x4e24d1){return client[_0x01c6('0xa')](_0x3e9497,_0x4ab37a)[_0x01c6('0xb')](function(_0xe831ae){logger[_0x01c6('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x4ab67b,_0x01c6('0xd'));logger[_0x01c6('0xe')](_0x01c6('0xf'),_0x4ab67b,_0x01c6('0xd'),JSON[_0x01c6('0x10')](_0xe831ae));if(_0xe831ae[_0x01c6('0x11')]){if(_0xe831ae[_0x01c6('0x11')][_0x01c6('0x12')]===0x1f4){logger[_0x01c6('0x11')](_0x01c6('0x13'),_0x4ab67b,_0xe831ae[_0x01c6('0x11')][_0x01c6('0x14')]);return _0x4e24d1(_0xe831ae[_0x01c6('0x11')]['message']);}logger[_0x01c6('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x4ab67b,_0xe831ae[_0x01c6('0x11')][_0x01c6('0x14')]);return _0x2889ae(_0xe831ae[_0x01c6('0x11')][_0x01c6('0x14')]);}else{logger[_0x01c6('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x4ab67b,_0x01c6('0xd'));_0x2889ae(_0xe831ae[_0x01c6('0x15')][_0x01c6('0x14')]);}})[_0x01c6('0x16')](function(_0x47c553){logger['error'](_0x01c6('0x13'),_0x4ab67b,_0x47c553);_0x4e24d1(_0x47c553);});});}