4325f4fb71869f745f1e294ea00cf974c3426c4d
[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 _0x6c43=['message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x6c43,0x96));var _0x36c4=function(_0x25096c,_0x4b39ad){_0x25096c=_0x25096c-0x0;var _0x20319d=_0x6c43[_0x25096c];return _0x20319d;};'use strict';var _=require('lodash');var util=require(_0x36c4('0x0'));var moment=require(_0x36c4('0x1'));var BPromise=require('bluebird');var rs=require(_0x36c4('0x2'));var fs=require('fs');var Redis=require(_0x36c4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x36c4('0x4'));var logger=require(_0x36c4('0x5'))(_0x36c4('0x6'));var config=require(_0x36c4('0x7'));var jayson=require(_0x36c4('0x8'));var client=jayson[_0x36c4('0x9')][_0x36c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17f1d5,_0x36299b,_0x323b08){return new BPromise(function(_0x4e85c7,_0x110b87){return client['request'](_0x17f1d5,_0x323b08)['then'](function(_0x48e337){logger[_0x36c4('0xb')](_0x36c4('0xc'),_0x36299b,_0x36c4('0xd'));logger[_0x36c4('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x36299b,_0x36c4('0xd'),JSON[_0x36c4('0xf')](_0x48e337));if(_0x48e337['error']){if(_0x48e337[_0x36c4('0x10')][_0x36c4('0x11')]===0x1f4){logger['error'](_0x36c4('0xc'),_0x36299b,_0x48e337['error'][_0x36c4('0x12')]);return _0x110b87(_0x48e337['error'][_0x36c4('0x12')]);}logger['error'](_0x36c4('0xc'),_0x36299b,_0x48e337['error'][_0x36c4('0x12')]);return _0x4e85c7(_0x48e337['error'][_0x36c4('0x12')]);}else{logger[_0x36c4('0xb')](_0x36c4('0xc'),_0x36299b,_0x36c4('0xd'));_0x4e85c7(_0x48e337[_0x36c4('0x13')][_0x36c4('0x12')]);}})[_0x36c4('0x14')](function(_0x397cbc){logger['error'](_0x36c4('0xc'),_0x36299b,_0x397cbc);_0x110b87(_0x397cbc);});});}