Module: sip-router Branch: master Commit: a39adb3497b5b095126e835104d637669dee2a7e URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a39adb34...
Author: Carsten Bock carsten@ng-voice.com Committer: Carsten Bock carsten@ng-voice.com Date: Mon Oct 7 16:17:53 2013 +0200
ims_charging: Add statistic ccr_timeouts
---
modules/ims_charging/README | 25 +++++++++++++++------- modules/ims_charging/doc/ims_charging_admin.xml | 4 +++ modules/ims_charging/ims_ro.c | 21 ++++++++++++++++++- modules/ims_charging/mod.c | 2 + modules/ims_charging/stats.h | 1 + 5 files changed, 44 insertions(+), 9 deletions(-)
diff --git a/modules/ims_charging/README b/modules/ims_charging/README index 1b4d0ea..d6abf37 100644 --- a/modules/ims_charging/README +++ b/modules/ims_charging/README @@ -75,8 +75,11 @@ Carlos Ruiz Diaz 6.9. Failed final CCRs (failed_final_ccrs) 6.10. CCRs average response time (ccr_avg_response_time) 6.11. CCRs responses time (ccr_responses_time) - 6.12. Billed seconds (billed_secs) - 6.13. Killed calls (killed_calls) + 6.12. CCRs requests, which ended with a timeout + (ccr_timeouts) + + 6.13. Billed seconds (billed_secs) + 6.14. Killed calls (killed_calls)
List of Examples
@@ -155,8 +158,9 @@ Chapter 1. Admin Guide 6.9. Failed final CCRs (failed_final_ccrs) 6.10. CCRs average response time (ccr_avg_response_time) 6.11. CCRs responses time (ccr_responses_time) - 6.12. Billed seconds (billed_secs) - 6.13. Killed calls (killed_calls) + 6.12. CCRs requests, which ended with a timeout (ccr_timeouts) + 6.13. Billed seconds (billed_secs) + 6.14. Killed calls (killed_calls)
1. Overview
@@ -645,8 +649,9 @@ n"); 6.9. Failed final CCRs (failed_final_ccrs) 6.10. CCRs average response time (ccr_avg_response_time) 6.11. CCRs responses time (ccr_responses_time) - 6.12. Billed seconds (billed_secs) - 6.13. Killed calls (killed_calls) + 6.12. CCRs requests, which ended with a timeout (ccr_timeouts) + 6.13. Billed seconds (billed_secs) + 6.14. Killed calls (killed_calls)
6.1. Initial CCRs (initial_ccrs)
@@ -696,10 +701,14 @@ n");
Total CCA arrival time in milliseconds.
-6.12. Billed seconds (billed_secs) +6.12. CCRs requests, which ended with a timeout (ccr_timeouts) + + Number of CCR-Requests, which ran into an timeout. + +6.13. Billed seconds (billed_secs)
Number of seconds billed in total.
-6.13. Killed calls (killed_calls) +6.14. Killed calls (killed_calls)
Number of calls that were killed due to lack of credit. diff --git a/modules/ims_charging/doc/ims_charging_admin.xml b/modules/ims_charging/doc/ims_charging_admin.xml index e07b71e..a6ef005 100644 --- a/modules/ims_charging/doc/ims_charging_admin.xml +++ b/modules/ims_charging/doc/ims_charging_admin.xml @@ -634,6 +634,10 @@ route[CHARGING_CCR_REPLY] <para>Total CCA arrival time in milliseconds.</para> </section> <section> + <title>CCRs requests, which ended with a timeout (ccr_timeouts)</title> + <para>Number of CCR-Requests, which ran into an timeout.</para> + </section> + <section> <title>Billed seconds (billed_secs)</title> <para>Number of seconds billed in total.</para> </section> diff --git a/modules/ims_charging/ims_ro.c b/modules/ims_charging/ims_ro.c index 1df9537..1748237 100644 --- a/modules/ims_charging/ims_ro.c +++ b/modules/ims_charging/ims_ro.c @@ -651,6 +651,12 @@ static void resume_on_interim_ccr(int is_timeout, void *param, AAAMessage *cca, struct interim_ccr *i_req = (struct interim_ccr *) param; Ro_CCA_t * ro_cca_data = NULL;
+ if (is_timeout) { + update_stat(ccr_timeouts, 1); + LM_ERR("Transaction timeout - did not get CCA\n"); + goto error; + } + update_stat(ccr_responses_time, elapsed_msecs);
if (!i_req) { @@ -833,6 +839,12 @@ error0: static void resume_on_termination_ccr(int is_timeout, void *param, AAAMessage *cca, long elapsed_msecs) { Ro_CCA_t *ro_cca_data = NULL;
+ if (is_timeout) { + update_stat(ccr_timeouts, 1); + LM_ERR("Transaction timeout - did not get CCA\n"); + goto error; + } + update_stat(ccr_responses_time, elapsed_msecs);
if (!cca) { @@ -1021,6 +1033,13 @@ static void resume_on_initial_ccr(int is_timeout, void *param, AAAMessage *cca, struct session_setup_data *ssd = (struct session_setup_data *) param; int error_code = RO_RETURN_ERROR;
+ if (is_timeout) { + update_stat(ccr_timeouts, 1); + LM_ERR("Transaction timeout - did not get CCA\n"); + error_code = RO_RETURN_ERROR; + goto error0; + } + update_stat(ccr_responses_time, elapsed_msecs);
if (!cca) { @@ -1039,7 +1058,7 @@ static void resume_on_initial_ccr(int is_timeout, void *param, AAAMessage *cca, if (tmb.t_lookup_ident(&t, ssd->tindex, ssd->tlabel) < 0) { LM_ERR("t_continue: transaction not found\n"); error_code = RO_RETURN_ERROR; - goto error1; + goto error0; }
// we bring the list of AVPs of the transaction to the current context diff --git a/modules/ims_charging/mod.c b/modules/ims_charging/mod.c index d275487..7c118e5 100644 --- a/modules/ims_charging/mod.c +++ b/modules/ims_charging/mod.c @@ -60,6 +60,7 @@ stat_var *successful_final_ccrs; stat_var *ccr_responses_time; stat_var *billed_secs; stat_var *killed_calls; +stat_var *ccr_timeouts;
/** module functions */ static int mod_init(void); @@ -113,6 +114,7 @@ stat_export_t charging_stats[] = { {"ccr_responses_time", STAT_NO_RESET, &ccr_responses_time}, {"billed_secs", STAT_NO_RESET, &billed_secs}, {"killed_calls", STAT_NO_RESET, &killed_calls}, + {"ccr_timeouts", STAT_NO_RESET, &ccr_timeouts}, {0, 0, 0} };
diff --git a/modules/ims_charging/stats.h b/modules/ims_charging/stats.h index 3bba982..9b0e3fc 100644 --- a/modules/ims_charging/stats.h +++ b/modules/ims_charging/stats.h @@ -19,6 +19,7 @@ extern stat_var *successful_final_ccrs; extern stat_var *ccr_responses_time; extern stat_var *billed_secs; extern stat_var *killed_calls; +extern stat_var *ccr_timeouts;
unsigned long get_failed_initial_ccrs(); unsigned long get_failed_interim_ccrs();