Built motion from commit efa66e19.|2.6.22
[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 _0xaa90=['client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x220ab5,_0x5c0ae6){var _0xe89604=function(_0xb2f107){while(--_0xb2f107){_0x220ab5['push'](_0x220ab5['shift']());}};_0xe89604(++_0x5c0ae6);}(_0xaa90,0x9f));var _0x0aa9=function(_0x33e68c,_0x346aa8){_0x33e68c=_0x33e68c-0x0;var _0x46ebc5=_0xaa90[_0x33e68c];return _0x46ebc5;};'use strict';var _=require(_0x0aa9('0x0'));var util=require(_0x0aa9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0aa9('0x2'));var fs=require('fs');var Redis=require(_0x0aa9('0x3'));var db=require(_0x0aa9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0aa9('0x5'))(_0x0aa9('0x6'));var config=require(_0x0aa9('0x7'));var jayson=require(_0x0aa9('0x8'));var client=jayson[_0x0aa9('0x9')][_0x0aa9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ae67a,_0x28b866,_0x33b479){return new BPromise(function(_0x15ee4b,_0x8d73f0){return client[_0x0aa9('0xb')](_0x4ae67a,_0x33b479)['then'](function(_0x34d485){logger[_0x0aa9('0xc')](_0x0aa9('0xd'),_0x28b866,_0x0aa9('0xe'));logger[_0x0aa9('0xf')](_0x0aa9('0x10'),_0x28b866,'request\x20sent',JSON['stringify'](_0x34d485));if(_0x34d485['error']){if(_0x34d485['error']['code']===0x1f4){logger[_0x0aa9('0x11')](_0x0aa9('0xd'),_0x28b866,_0x34d485[_0x0aa9('0x11')]['message']);return _0x8d73f0(_0x34d485[_0x0aa9('0x11')][_0x0aa9('0x12')]);}logger[_0x0aa9('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x28b866,_0x34d485[_0x0aa9('0x11')][_0x0aa9('0x12')]);return _0x15ee4b(_0x34d485[_0x0aa9('0x11')][_0x0aa9('0x12')]);}else{logger['info'](_0x0aa9('0xd'),_0x28b866,_0x0aa9('0xe'));_0x15ee4b(_0x34d485[_0x0aa9('0x13')][_0x0aa9('0x12')]);}})[_0x0aa9('0x14')](function(_0x566753){logger[_0x0aa9('0x11')](_0x0aa9('0xd'),_0x28b866,_0x566753);_0x8d73f0(_0x566753);});});}