f8e7d3c0210785f57928f95766cfe31aed209434
[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 _0x235e=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash'];(function(_0x1dfcbc,_0x597f0e){var _0x5d00ca=function(_0x3c84ee){while(--_0x3c84ee){_0x1dfcbc['push'](_0x1dfcbc['shift']());}};_0x5d00ca(++_0x597f0e);}(_0x235e,0x12a));var _0xe235=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x235e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe235('0x0'));var util=require(_0xe235('0x1'));var moment=require(_0xe235('0x2'));var BPromise=require(_0xe235('0x3'));var rs=require(_0xe235('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe235('0x5'))['db'];var utils=require(_0xe235('0x6'));var logger=require(_0xe235('0x7'))('rpc');var config=require(_0xe235('0x8'));var jayson=require(_0xe235('0x9'));var client=jayson[_0xe235('0xa')][_0xe235('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x301416,_0x588439,_0x3de0e3){return new BPromise(function(_0x5e1c09,_0x355c5e){return client[_0xe235('0xc')](_0x301416,_0x3de0e3)[_0xe235('0xd')](function(_0x3e65ef){logger[_0xe235('0xe')](_0xe235('0xf'),_0x588439,'request\x20sent');logger[_0xe235('0x10')](_0xe235('0x11'),_0x588439,_0xe235('0x12'),JSON[_0xe235('0x13')](_0x3e65ef));if(_0x3e65ef[_0xe235('0x14')]){if(_0x3e65ef['error'][_0xe235('0x15')]===0x1f4){logger[_0xe235('0x14')](_0xe235('0xf'),_0x588439,_0x3e65ef[_0xe235('0x14')][_0xe235('0x16')]);return _0x355c5e(_0x3e65ef['error'][_0xe235('0x16')]);}logger['error'](_0xe235('0xf'),_0x588439,_0x3e65ef[_0xe235('0x14')][_0xe235('0x16')]);return _0x5e1c09(_0x3e65ef[_0xe235('0x14')]['message']);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x588439,_0xe235('0x12'));_0x5e1c09(_0x3e65ef['result'][_0xe235('0x16')]);}})['catch'](function(_0x4c435e){logger[_0xe235('0x14')](_0xe235('0xf'),_0x588439,_0x4c435e);_0x355c5e(_0x4c435e);});});}