1683f66647259d8f2784e3b2c7952aaaec9f5005
[motion2.git] / server / api / voiceMail / voiceMail.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 _0x34ef=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x34ef,0x108));var _0xf34e=function(_0x3ab461,_0x38094f){_0x3ab461=_0x3ab461-0x0;var _0xc4140a=_0x34ef[_0x3ab461];return _0xc4140a;};'use strict';var _=require(_0xf34e('0x0'));var util=require(_0xf34e('0x1'));var moment=require(_0xf34e('0x2'));var BPromise=require(_0xf34e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf34e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf34e('0x5'));var logger=require(_0xf34e('0x6'))(_0xf34e('0x7'));var config=require('../../config/environment');var jayson=require(_0xf34e('0x8'));var client=jayson[_0xf34e('0x9')][_0xf34e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1df9d8,_0xd61d0,_0x1f2a03){return new BPromise(function(_0x403a55,_0xb950b7){return client[_0xf34e('0xb')](_0x1df9d8,_0x1f2a03)[_0xf34e('0xc')](function(_0x983dd0){logger[_0xf34e('0xd')](_0xf34e('0xe'),_0xd61d0,_0xf34e('0xf'));logger[_0xf34e('0x10')](_0xf34e('0x11'),_0xd61d0,_0xf34e('0xf'),JSON['stringify'](_0x983dd0));if(_0x983dd0['error']){if(_0x983dd0[_0xf34e('0x12')]['code']===0x1f4){logger[_0xf34e('0x12')](_0xf34e('0xe'),_0xd61d0,_0x983dd0['error'][_0xf34e('0x13')]);return _0xb950b7(_0x983dd0['error']['message']);}logger['error'](_0xf34e('0xe'),_0xd61d0,_0x983dd0[_0xf34e('0x12')][_0xf34e('0x13')]);return _0x403a55(_0x983dd0[_0xf34e('0x12')][_0xf34e('0x13')]);}else{logger[_0xf34e('0xd')](_0xf34e('0xe'),_0xd61d0,_0xf34e('0xf'));_0x403a55(_0x983dd0[_0xf34e('0x14')][_0xf34e('0x13')]);}})[_0xf34e('0x15')](function(_0x2c412f){logger[_0xf34e('0x12')](_0xf34e('0xe'),_0xd61d0,_0x2c412f);_0xb950b7(_0x2c412f);});});}