131c972ee0c9c056095e4d574e9d048736f5015c
[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 _0x4ff7=['jayson/promise','client','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4eb5ec,_0x3056f1){var _0x2b936e=function(_0x188bd4){while(--_0x188bd4){_0x4eb5ec['push'](_0x4eb5ec['shift']());}};_0x2b936e(++_0x3056f1);}(_0x4ff7,0xf4));var _0x74ff=function(_0x1699e9,_0x1f2652){_0x1699e9=_0x1699e9-0x0;var _0x14b104=_0x4ff7[_0x1699e9];return _0x14b104;};'use strict';var _=require(_0x74ff('0x0'));var util=require(_0x74ff('0x1'));var moment=require(_0x74ff('0x2'));var BPromise=require(_0x74ff('0x3'));var rs=require(_0x74ff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74ff('0x5'))['db'];var utils=require(_0x74ff('0x6'));var logger=require(_0x74ff('0x7'))('rpc');var config=require(_0x74ff('0x8'));var jayson=require(_0x74ff('0x9'));var client=jayson[_0x74ff('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52a6e3,_0x4bbf39,_0x1d2557){return new BPromise(function(_0x5196bb,_0x2391f0){return client['request'](_0x52a6e3,_0x1d2557)[_0x74ff('0xb')](function(_0x1bb042){logger[_0x74ff('0xc')](_0x74ff('0xd'),_0x4bbf39,_0x74ff('0xe'));logger[_0x74ff('0xf')](_0x74ff('0x10'),_0x4bbf39,_0x74ff('0xe'),JSON[_0x74ff('0x11')](_0x1bb042));if(_0x1bb042[_0x74ff('0x12')]){if(_0x1bb042['error'][_0x74ff('0x13')]===0x1f4){logger['error'](_0x74ff('0xd'),_0x4bbf39,_0x1bb042[_0x74ff('0x12')]['message']);return _0x2391f0(_0x1bb042[_0x74ff('0x12')][_0x74ff('0x14')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4bbf39,_0x1bb042[_0x74ff('0x12')][_0x74ff('0x14')]);return _0x5196bb(_0x1bb042[_0x74ff('0x12')]['message']);}else{logger[_0x74ff('0xc')](_0x74ff('0xd'),_0x4bbf39,_0x74ff('0xe'));_0x5196bb(_0x1bb042[_0x74ff('0x15')][_0x74ff('0x14')]);}})[_0x74ff('0x16')](function(_0x43ce15){logger[_0x74ff('0x12')](_0x74ff('0xd'),_0x4bbf39,_0x43ce15);_0x2391f0(_0x43ce15);});});}