From c28c99c39445294e1172bdacaca7fc5e6151f733 Mon Sep 17 00:00:00 2001 From: William King Date: Thu, 13 Sep 2012 15:12:35 -0700 Subject: [PATCH] If the timer value isn't available it isn't an error. Instead just don't add the field. --- .../xml_int/mod_xml_radius/mod_radius.diff | 59 ------------------- .../xml_int/mod_xml_radius/mod_xml_radius.c | 6 +- 2 files changed, 3 insertions(+), 62 deletions(-) delete mode 100644 src/mod/xml_int/mod_xml_radius/mod_radius.diff diff --git a/src/mod/xml_int/mod_xml_radius/mod_radius.diff b/src/mod/xml_int/mod_xml_radius/mod_radius.diff deleted file mode 100644 index f32d39e1b6..0000000000 --- a/src/mod/xml_int/mod_xml_radius/mod_radius.diff +++ /dev/null @@ -1,59 +0,0 @@ -diff --git src/mod/xml_int/mod_xml_radius/mod_xml_radius.c src/mod/xml_int/mod_xml_radius/mod_xml_radius.c -index 0707388..e9e6e2a 100644 ---- src/mod/xml_int/mod_xml_radius/mod_xml_radius.c -+++ src/mod/xml_int/mod_xml_radius/mod_xml_radius.c -@@ -367,6 +367,10 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch - switch_time_t time = profile->times->created; - switch_time_exp_t tm; - -+ if ( !time ) { -+ goto err; -+ } -+ - switch_time_exp_lt(&tm, time); - av_value = switch_mprintf("%04u-%02u-%02uT%02u:%02u:%02u.%06u%+03d%02d", - tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, -@@ -381,6 +385,10 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch - switch_caller_profile_t *profile = switch_channel_get_caller_profile(channel); - switch_time_t time = profile->times->answered; - switch_time_exp_t tm; -+ -+ if ( !time ) { -+ goto err; -+ } - - switch_time_exp_lt(&tm, time); - -@@ -397,6 +405,10 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch - switch_caller_profile_t *profile = switch_channel_get_caller_profile(channel); - switch_time_t time = profile->times->hungup; - switch_time_exp_t tm; -+ -+ if ( !time ) { -+ goto err; -+ } - - switch_time_exp_lt(&tm, time); - -diff --git src/mod/xml_int/mod_xml_radius/xml_radius.conf.xml src/mod/xml_int/mod_xml_radius/xml_radius.conf.xml -index eb3070c..6349d05 100644 ---- src/mod/xml_int/mod_xml_radius/xml_radius.conf.xml -+++ src/mod/xml_int/mod_xml_radius/xml_radius.conf.xml -@@ -22,7 +22,7 @@ - - - -- -+ - - - -@@ -48,7 +48,7 @@ - - - -- -+ - - - diff --git a/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c b/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c index e9e6e2ac82..035a16f7f3 100644 --- a/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c +++ b/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c @@ -368,7 +368,7 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch switch_time_exp_t tm; if ( !time ) { - goto err; + return SWITCH_STATUS_SUCCESS; } switch_time_exp_lt(&tm, time); @@ -387,7 +387,7 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch switch_time_exp_t tm; if ( !time ) { - goto err; + return SWITCH_STATUS_SUCCESS; } switch_time_exp_lt(&tm, time); @@ -407,7 +407,7 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch switch_time_exp_t tm; if ( !time ) { - goto err; + return SWITCH_STATUS_SUCCESS; } switch_time_exp_lt(&tm, time);