Built motion from commit da24aabd.|2.6.20
[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 _0xc74e=['../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x303962,_0x4febc7){var _0x393675=function(_0x8f4417){while(--_0x8f4417){_0x303962['push'](_0x303962['shift']());}};_0x393675(++_0x4febc7);}(_0xc74e,0xe0));var _0xec74=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc74e[_0x432682];return _0x463d05;};'use strict';var _=require(_0xec74('0x0'));var util=require(_0xec74('0x1'));var moment=require(_0xec74('0x2'));var BPromise=require(_0xec74('0x3'));var rs=require(_0xec74('0x4'));var fs=require('fs');var Redis=require(_0xec74('0x5'));var db=require(_0xec74('0x6'))['db'];var utils=require(_0xec74('0x7'));var logger=require(_0xec74('0x8'))(_0xec74('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xec74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x341436,_0x1e718e,_0x4569f7){return new BPromise(function(_0x1c7419,_0x3863ca){return client['request'](_0x341436,_0x4569f7)[_0xec74('0xb')](function(_0x373393){logger[_0xec74('0xc')](_0xec74('0xd'),_0x1e718e,'request\x20sent');logger[_0xec74('0xe')](_0xec74('0xf'),_0x1e718e,_0xec74('0x10'),JSON[_0xec74('0x11')](_0x373393));if(_0x373393[_0xec74('0x12')]){if(_0x373393[_0xec74('0x12')][_0xec74('0x13')]===0x1f4){logger['error'](_0xec74('0xd'),_0x1e718e,_0x373393[_0xec74('0x12')][_0xec74('0x14')]);return _0x3863ca(_0x373393[_0xec74('0x12')]['message']);}logger['error'](_0xec74('0xd'),_0x1e718e,_0x373393[_0xec74('0x12')][_0xec74('0x14')]);return _0x1c7419(_0x373393[_0xec74('0x12')]['message']);}else{logger[_0xec74('0xc')](_0xec74('0xd'),_0x1e718e,'request\x20sent');_0x1c7419(_0x373393[_0xec74('0x15')][_0xec74('0x14')]);}})[_0xec74('0x16')](function(_0xe27fa6){logger[_0xec74('0x12')](_0xec74('0xd'),_0x1e718e,_0xe27fa6);_0x3863ca(_0xe27fa6);});});}