Module: kamailio
Branch: master
Commit: 91dd5f7c4ed09116795561eea267b35a098020b2
URL:
https://github.com/kamailio/kamailio/commit/91dd5f7c4ed09116795561eea267b35…
Author: Carsten Bock <carsten(a)ng-voice.com>
Committer: Carsten Bock <carsten(a)ng-voice.com>
Date: 2015-07-14T16:06:21+02:00
ims_charging: Do not send trunk-ids or charging group, if those values are not set
---
Modified: modules/ims_charging/ccr.c
Modified: modules/ims_charging/ims_ro.c
---
Diff:
https://github.com/kamailio/kamailio/commit/91dd5f7c4ed09116795561eea267b35…
Patch:
https://github.com/kamailio/kamailio/commit/91dd5f7c4ed09116795561eea267b35…
---
diff --git a/modules/ims_charging/ccr.c b/modules/ims_charging/ccr.c
index 140d1c1..99ab727 100644
--- a/modules/ims_charging/ccr.c
+++ b/modules/ims_charging/ccr.c
@@ -96,7 +96,7 @@ int Ro_write_ims_information_avps(AAA_AVP_LIST * avp_list,
ims_information_t* x)
if (!cdp_avp->epcapp.add_Called_Party_Address(&aList2,
*(x->called_party_address), 0))
goto error;
- if (x->incoming_trunk_id && x->outgoing_trunk_id) {
+ if (x->incoming_trunk_id && (x->incoming_trunk_id->len > 0)
&& x->outgoing_trunk_id && (x->outgoing_trunk_id->len > 0)) {
if (!cdp_avp->epcapp.add_Outgoing_Trunk_Group_Id(&aList,
*(x->outgoing_trunk_id), 0))
goto error;
diff --git a/modules/ims_charging/ims_ro.c b/modules/ims_charging/ims_ro.c
index 00a89ad..d2ceb02 100644
--- a/modules/ims_charging/ims_ro.c
+++ b/modules/ims_charging/ims_ro.c
@@ -210,8 +210,10 @@ inline int Ro_add_multiple_service_credit_Control_stop(AAAMessage
*msg, int used
set_4bytes(x, active_service_identifier);
Ro_add_avp_list(&mscc_list, x, 4, AVP_Service_Identifier, AAA_AVP_FLAG_MANDATORY,
0, AVP_DUPLICATE_DATA, __FUNCTION__);
- set_4bytes(x, active_rating_group);
- Ro_add_avp_list(&mscc_list, x, 4, AVP_Rating_Group, AAA_AVP_FLAG_MANDATORY, 0,
AVP_DUPLICATE_DATA, __FUNCTION__);
+ if (active_rating_group >= 0) {
+ set_4bytes(x, active_rating_group);
+ Ro_add_avp_list(&mscc_list, x, 4, AVP_Rating_Group, AAA_AVP_FLAG_MANDATORY,
0, AVP_DUPLICATE_DATA, __FUNCTION__);
+ }
used_group = cdpb.AAAGroupAVPS(mscc_list);
cdpb.AAAFreeAVPList(&mscc_list);
@@ -245,8 +247,10 @@ inline int Ro_add_multiple_service_credit_Control(AAAMessage *msg,
unsigned int
set_4bytes(x, active_service_identifier);
Ro_add_avp_list(&mscc_list, x, 4, AVP_Service_Identifier, AAA_AVP_FLAG_MANDATORY,
0, AVP_DUPLICATE_DATA, __FUNCTION__);
- set_4bytes(x, active_rating_group);
- Ro_add_avp_list(&mscc_list, x, 4, AVP_Rating_Group, AAA_AVP_FLAG_MANDATORY, 0,
AVP_DUPLICATE_DATA, __FUNCTION__);
+ if (active_rating_group >= 0) {
+ set_4bytes(x, active_rating_group);
+ Ro_add_avp_list(&mscc_list, x, 4, AVP_Rating_Group, AAA_AVP_FLAG_MANDATORY,
0, AVP_DUPLICATE_DATA, __FUNCTION__);
+ }
/* if we must Used-Service-Unit */
if (used_unit >= 0) {