Module: kamailio
Branch: master
Commit: 9c3ce397a1baa45a7ee0123ff4e32bcf412506de
URL:
https://github.com/kamailio/kamailio/commit/9c3ce397a1baa45a7ee0123ff4e32bc…
Author: Carsten Bock <carsten(a)ng-voice.com>
Committer: Carsten Bock <carsten(a)ng-voice.com>
Date: 2016-01-26T18:22:36+01:00
ims_charging: Add ability, to retrieve the Diameter-Status-Code for the Charging-Session
---
Modified: modules/ims_charging/ims_ro.c
Modified: modules/ims_charging/mod.h
---
Diff:
https://github.com/kamailio/kamailio/commit/9c3ce397a1baa45a7ee0123ff4e32bc…
Patch:
https://github.com/kamailio/kamailio/commit/9c3ce397a1baa45a7ee0123ff4e32bc…
---
diff --git a/modules/ims_charging/ims_ro.c b/modules/ims_charging/ims_ro.c
index 73be360..ef27513 100644
--- a/modules/ims_charging/ims_ro.c
+++ b/modules/ims_charging/ims_ro.c
@@ -1428,6 +1428,29 @@ static int create_cca_return_code(int result) {
return 1;
}
+static int create_cca_result_code(int result) {
+ int rc;
+ int_str avp_val, avp_name;
+ avp_name.s.s = RO_AVP_CCA_RESULT_CODE;
+ avp_name.s.len = RO_AVP_CCA_RESULT_CODE_LENGTH;
+
+ avp_val.n = result;
+ avp_val.s.s = RO_RETURN_TRUE_STR; //assume true
+ avp_val.s.len = 1;
+
+ rc = add_avp(AVP_NAME_STR | AVP_VAL_STR, avp_name, avp_val);
+
+ if (rc < 0)
+ LM_ERR("Couldn't create ["RO_AVP_CCA_RESULT_CODE"]
AVP\n");
+ else
+ LM_DBG("Created AVP ["RO_AVP_CCA_RESULT_CODE"] successfully:
value=[%d]\n", result);
+
+ return 1;
+}
+
+
+
+
static int get_mac_avp_value(struct sip_msg *msg, str *value) {
str mac_avp_name_str = str_init(RO_MAC_AVP_NAME);
pv_spec_t avp_spec;
diff --git a/modules/ims_charging/mod.h b/modules/ims_charging/mod.h
index a34c5a9..bb52f5e 100644
--- a/modules/ims_charging/mod.h
+++ b/modules/ims_charging/mod.h
@@ -45,6 +45,9 @@
#define RO_AVP_CCA_RETURN_CODE "cca_return_code"
#define RO_AVP_CCA_RETURN_CODE_LENGTH 15
+#define RO_AVP_CCA_RESULT_CODE "cca_result_code"
+#define RO_AVP_CCA_RESULT_CODE_LENGTH 15
+
#define RO_MAC_AVP_NAME "$avp(ro_mac_value)"
#define DB_DEFAULT_UPDATE_PERIOD 60