Module: kamailio
Branch: master
Commit: eecc0a1ae7a4f4d243ebbe713dd884493611b45c
URL:
https://github.com/kamailio/kamailio/commit/eecc0a1ae7a4f4d243ebbe713dd8844…
Author: Mikko Lehto <mslehto(a)iki.fi>
Committer: Mikko Lehto <mslehto(a)iki.fi>
Date: 2016-11-07T01:48:43+02:00
modules/siputils: do not let $pcv(value) to contain invalid value
---
Modified: modules/siputils/chargingvector.c
---
Diff:
https://github.com/kamailio/kamailio/commit/eecc0a1ae7a4f4d243ebbe713dd8844…
Patch:
https://github.com/kamailio/kamailio/commit/eecc0a1ae7a4f4d243ebbe713dd8844…
---
diff --git a/modules/siputils/chargingvector.c b/modules/siputils/chargingvector.c
index 7e64a52..48bc125 100644
--- a/modules/siputils/chargingvector.c
+++ b/modules/siputils/chargingvector.c
@@ -172,6 +172,7 @@ static int sip_parse_charging_vector(const char * pcv_value, unsigned
int len)
}
else
{
+ LM_WARN("mandatory icid-value not found\n");
pcv_id.s = NULL;
pcv_id.len = 0;
}
@@ -186,16 +187,15 @@ static int sip_parse_charging_vector(const char * pcv_value,
unsigned int len)
}
else
{
+ LM_DBG("icid-generated-at not found\n");
pcv_host.s = NULL;
pcv_host.len = 0;
}
- // Buggy charging vector where only icid-value is sent ...
- if ( pcv_host.s == NULL && pcv_id.s == NULL && len > 0)
+ // only icid-value is mandatory, log anyway when missing icid-generated-at
+ if ( pcv_host.s == NULL && pcv_id.s != NULL && len > 0)
{
- pcv_id.s = (char *) pcv_value,
- pcv_id.len = sip_param_end(pcv_id.s, len);
- LM_WARN("parsed BUGGY P-Charging-Vector %.*s\n", pcv_id.len, pcv_id.s );
+ LM_WARN("icid-generated-at is missing %.*s\n", len, pcv_value);
}
return (pcv_id.s != NULL);