Module: sip-router Branch: master Commit: db618ddbdc2ec92a508acd913f2f847a4fb59cae URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=db618ddb...
Author: Jason Penton jason.penton@smilecoms.com Committer: Jason Penton jason.penton@smilecoms.com Date: Thu Oct 10 14:59:23 2013 +0200
modules/ims_charging: corrected default termination cause code to DIAMETER_LOGOUT - also corrected typo - added other termination cause code defines for future use
---
modules/ims_charging/ims_ro.c | 4 ++-- modules/ims_charging/mod.h | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/modules/ims_charging/ims_ro.c b/modules/ims_charging/ims_ro.c index d0c67ac..1907958 100644 --- a/modules/ims_charging/ims_ro.c +++ b/modules/ims_charging/ims_ro.c @@ -206,7 +206,7 @@ inline int Ro_add_user_equipment_info(AAAMessage *msg, unsigned int type, str va return Ro_add_avp(msg, group.s, group.len, AVP_User_Equipment_Info, AAA_AVP_FLAG_MANDATORY, 0, AVP_FREE_DATA, __FUNCTION__); }
-inline int Ro_add_termination_casue(AAAMessage *msg, unsigned int term_code) { +inline int Ro_add_termination_cause(AAAMessage *msg, unsigned int term_code) { char x[4]; str s = {x, 4}; uint32_t code = htonl(term_code); @@ -804,7 +804,7 @@ void send_ccr_stop(struct ro_session *ro_session) { LM_ERR("Problem adding Multiple Service Credit Control data\n"); }
- if (!Ro_add_termination_casue(ccr, 4)) { + if (!Ro_add_termination_cause(ccr, TERM_CAUSE_LOGOUT)) { LM_ERR("problem add Termination cause AVP to STOP record.\n"); }
diff --git a/modules/ims_charging/mod.h b/modules/ims_charging/mod.h index 9c445f2..95f5edf 100644 --- a/modules/ims_charging/mod.h +++ b/modules/ims_charging/mod.h @@ -29,6 +29,18 @@ #define RO_RETURN_ERROR -2 #define RO_RETURN_ERROR_STR "-2"
+/** Diameter Termination Cause Codes */ +#define TERM_CAUSE_LOGOUT 1 +#define TERM_CAUSE_SERVICE_NOT_PROVIDED 2 +#define TERM_CAUSE_BAD_ANSWER 3 +#define TERM_CAUSE_ADMINISTRATIVE 4 +#define TERM_CAUSE_LINK_BROKEN 5 +#define TERM_CAUSE_AUTH_EXPIRED 6 +#define TERM_CAUSE_USER_MOVED 7 +#define TERM_CAUSE_SESSION_TIMEOUT 8 + + + #define RO_AVP_CCA_RETURN_CODE "cca_return_code" #define RO_AVP_CCA_RETURN_CODE_LENGTH 15