ae7176ffdd3adddc1234b15442f515123b247182
[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 _0x0f1a=['info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x2f2654,_0x1572bd){var _0x332b2a=function(_0x78dfd6){while(--_0x78dfd6){_0x2f2654['push'](_0x2f2654['shift']());}};_0x332b2a(++_0x1572bd);}(_0x0f1a,0x108));var _0xa0f1=function(_0xac21df,_0x4f3ba2){_0xac21df=_0xac21df-0x0;var _0x1faa60=_0x0f1a[_0xac21df];return _0x1faa60;};'use strict';var _=require('lodash');var util=require(_0xa0f1('0x0'));var moment=require(_0xa0f1('0x1'));var BPromise=require(_0xa0f1('0x2'));var rs=require(_0xa0f1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa0f1('0x4'))['db'];var utils=require(_0xa0f1('0x5'));var logger=require(_0xa0f1('0x6'))(_0xa0f1('0x7'));var config=require('../../config/environment');var jayson=require(_0xa0f1('0x8'));var client=jayson[_0xa0f1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3827bd,_0x31555f,_0x239a42){return new BPromise(function(_0x17c10a,_0x590f14){return client[_0xa0f1('0xa')](_0x3827bd,_0x239a42)[_0xa0f1('0xb')](function(_0x1d5c05){logger[_0xa0f1('0xc')](_0xa0f1('0xd'),_0x31555f,_0xa0f1('0xe'));logger[_0xa0f1('0xf')](_0xa0f1('0x10'),_0x31555f,_0xa0f1('0xe'),JSON[_0xa0f1('0x11')](_0x1d5c05));if(_0x1d5c05[_0xa0f1('0x12')]){if(_0x1d5c05[_0xa0f1('0x12')][_0xa0f1('0x13')]===0x1f4){logger[_0xa0f1('0x12')](_0xa0f1('0xd'),_0x31555f,_0x1d5c05[_0xa0f1('0x12')]['message']);return _0x590f14(_0x1d5c05[_0xa0f1('0x12')][_0xa0f1('0x14')]);}logger['error'](_0xa0f1('0xd'),_0x31555f,_0x1d5c05[_0xa0f1('0x12')][_0xa0f1('0x14')]);return _0x17c10a(_0x1d5c05[_0xa0f1('0x12')][_0xa0f1('0x14')]);}else{logger[_0xa0f1('0xc')](_0xa0f1('0xd'),_0x31555f,_0xa0f1('0xe'));_0x17c10a(_0x1d5c05[_0xa0f1('0x15')]['message']);}})[_0xa0f1('0x16')](function(_0x139408){logger['error'](_0xa0f1('0xd'),_0x31555f,_0x139408);_0x590f14(_0x139408);});});}