Module: kamailio
Branch: 5.3
Commit: 38df9e58a81b24ec898107e23513ae1401345bfd
URL:
https://github.com/kamailio/kamailio/commit/38df9e58a81b24ec898107e23513ae1…
Author: Henning Westerholt <hw(a)skalatan.de>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2020-07-02T09:11:56Z
ims_charging: bugfix for destination_host parameter, implementation was incomplete
(cherry picked from commit f5e44252c39c7695cb66893035a0581a65a72f91)
---
Modified: src/modules/ims_charging/Ro_data.c
Modified: src/modules/ims_charging/Ro_data.h
Modified: src/modules/ims_charging/config.h
Modified: src/modules/ims_charging/doc/ims_charging_admin.xml
Modified: src/modules/ims_charging/ims_charging_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/38df9e58a81b24ec898107e23513ae1…
Patch:
https://github.com/kamailio/kamailio/commit/38df9e58a81b24ec898107e23513ae1…
---
diff --git a/src/modules/ims_charging/Ro_data.c b/src/modules/ims_charging/Ro_data.c
index 69e0f1408b..f3ce0bead8 100644
--- a/src/modules/ims_charging/Ro_data.c
+++ b/src/modules/ims_charging/Ro_data.c
@@ -185,6 +185,9 @@ Ro_CCR_t * new_Ro_CCR(int32_t acc_record_type, str * user_name,
ims_information_
if (cfg.origin_realm.s && cfg.origin_realm.len >0)
str_dup(x->origin_realm, cfg.origin_realm, pkg);
+
+ if (cfg.destination_host.s && cfg.destination_host.len > 0)
+ str_dup(x->destination_host, cfg.destination_host, pkg);
if (cfg.destination_realm.s && cfg.destination_realm.len > 0)
str_dup(x->destination_realm, cfg.destination_realm, pkg);
@@ -281,6 +284,7 @@ void Ro_free_CCR(Ro_CCR_t *x) {
str_free(x->origin_host, pkg);
str_free(x->origin_realm, pkg);
+ str_free(x->destination_host, pkg);
str_free(x->destination_realm, pkg);
str_free_ptr(x->user_name, pkg);
diff --git a/src/modules/ims_charging/Ro_data.h b/src/modules/ims_charging/Ro_data.h
index 5ac3efab05..5a47b58fb7 100644
--- a/src/modules/ims_charging/Ro_data.h
+++ b/src/modules/ims_charging/Ro_data.h
@@ -340,6 +340,7 @@ typedef struct {
typedef struct {
str origin_host;
str origin_realm;
+ str destination_host;
str destination_realm;
int32_t acct_record_type;
diff --git a/src/modules/ims_charging/config.h b/src/modules/ims_charging/config.h
index 8ceabd4428..1ac03f24ca 100644
--- a/src/modules/ims_charging/config.h
+++ b/src/modules/ims_charging/config.h
@@ -4,6 +4,7 @@
typedef struct {
str origin_host;
str origin_realm;
+ str destination_host;
str destination_realm;
str * service_context_id;
} client_ro_cfg;
diff --git a/src/modules/ims_charging/doc/ims_charging_admin.xml
b/src/modules/ims_charging/doc/ims_charging_admin.xml
index 92bf0e000b..c14937e06f 100644
--- a/src/modules/ims_charging/doc/ims_charging_admin.xml
+++ b/src/modules/ims_charging/doc/ims_charging_admin.xml
@@ -530,7 +530,7 @@ modparam("ims_charging", "origin_realm",
"kamailio-ims.org")
<para>Destination host to be used in Diameter messages to
charging-server.</para>
- <para><emphasis>Default value is
"hss.ims.smilecoms.com".</emphasis></para>
+ <para><emphasis>Default value is
"".</emphasis></para>
<example>
<title><varname>destination_host</varname>parameter
usage</title>
diff --git a/src/modules/ims_charging/ims_charging_mod.c
b/src/modules/ims_charging/ims_charging_mod.c
index 150a525884..efb933c3d3 100644
--- a/src/modules/ims_charging/ims_charging_mod.c
+++ b/src/modules/ims_charging/ims_charging_mod.c
@@ -28,7 +28,6 @@ MODULE_VERSION
struct dlg_binds* dlgb_p;
/* parameters */
-char* ro_destination_host_s = "hss.ims.smilecoms.com";
char* ro_service_context_id_root_s = "32260(a)3gpp.org".org";
char* ro_service_context_id_ext_s = "ext";
char* ro_service_context_id_mnc_s = "01";
@@ -60,6 +59,7 @@ int ro_db_mode = DB_MODE_NONE;
char *domain = "location";
client_ro_cfg cfg = { str_init(""),
+ str_init(""),
str_init(""),
str_init(""),
0
@@ -122,7 +122,7 @@ static param_export_t params[] = {
{ "origin_host", PARAM_STR, &cfg.origin_host },
{ "origin_realm", PARAM_STR, &cfg.origin_realm },
{ "destination_realm", PARAM_STR, &cfg.destination_realm },
- { "destination_host", PARAM_STRING, &ro_destination_host_s }, /*
Unused parameter? */
+ { "destination_host", PARAM_STR, &cfg.destination_host },
{ "service_context_id_root",PARAM_STRING, &ro_service_context_id_root_s
},
{ "service_context_id_ext", PARAM_STRING, &ro_service_context_id_ext_s
},
{ "service_context_id_mnc", PARAM_STRING, &ro_service_context_id_mnc_s
},