Here are some proposed modifications to handle the P-Charging-Vector header as defined in rfc3455 section 4.6 to
- parse charging vector from SIP message
- generate new unique charging vector
- remove a charging vector header
a new pseudo variable
pseudo variables are exported and enable Read onlly access to charging vector fields
$pcv = whole field
$pcv.value = icid-value field (see RFC3455 section 5.6)
$pcv.genaddr = icid-generated-at field (see RFC3455 section 5.6)
a new function acc_charging_vector()
- g = generate a new charging vector or forward the orginal one
- f = generate a new charging vector regardless of the orginal charging vector
- r = remote the P-Charging vector header from the packet
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/214
-- Commit Summary --
* P-Charging-Vector implementation
* Merge remote branch 'upstream/master'
-- File Changes --
A modules/acc/chargingvector.c (435)
A modules/acc/chargingvector.h (18)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/214.patchhttps://github.com/kamailio/kamailio/pull/214.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/214
Module: kamailio
Branch: master
Commit: f995edfb7fc9305dc72a6b04575e6112cd873473
URL: https://github.com/kamailio/kamailio/commit/f995edfb7fc9305dc72a6b04575e611…
Author: Stefan Mititelu <stefan.mititelu(a)1and1.ro>
Committer: Stefan Mititelu <stefan.mititelu(a)1and1.ro>
Date: 2015-06-18T13:28:16+03:00
pdb: new protocol between pdb_server and kama pdb module
Modified the communication protocol between the pdb clent <-> server such
that the server will give more feedback on scenarios like "pdb_id not found" or
"request number contains letters". New msg types or reply codes can be easily
added. Curent version of the protocol is 1 (0x01).
Also backwards compatibility is maintained when the first received byte is
different than the known versions (now, just 0x01).
Updated the http link for the get_carrier_germany script. Created a new perl
script to get german carrier id.
Updated doku (utils/pdbt/docs/network_protocol.txt).
added the perls script
---
Added: modules/pdb/common.h
Added: utils/pdbt/common.c
Added: utils/pdbt/scripts/get_carrier_names_germany.pl
Modified: modules/pdb/doc/pdb_admin.xml
Modified: modules/pdb/pdb.c
Modified: utils/pdbt/Makefile
Modified: utils/pdbt/common.h
Modified: utils/pdbt/docs/network_protocol.txt
Modified: utils/pdbt/log.c
Modified: utils/pdbt/log.h
Modified: utils/pdbt/pdb_server.c
Modified: utils/pdbt/pdbt.c
Modified: utils/pdbt/scripts/get_carrier_names_germany.sh
---
Diff: https://github.com/kamailio/kamailio/commit/f995edfb7fc9305dc72a6b04575e611…
Patch: https://github.com/kamailio/kamailio/commit/f995edfb7fc9305dc72a6b04575e611…
Module: kamailio
Branch: master
Commit: 96e5a6aa5d3c00d0020315f5455b6c98c73d4a19
URL: https://github.com/kamailio/kamailio/commit/96e5a6aa5d3c00d0020315f5455b6c9…
Author: Richard Good <richard.good(a)smilecoms.com>
Committer: Richard Good <richard.good(a)smilecoms.com>
Date: 2015-06-18T08:56:20+02:00
modules/ims_qos: improve reliability of active media sessions stat
---
Modified: modules/ims_qos/cdpeventprocessor.c
Modified: modules/ims_qos/rx_aar.c
---
Diff: https://github.com/kamailio/kamailio/commit/96e5a6aa5d3c00d0020315f5455b6c9…
Patch: https://github.com/kamailio/kamailio/commit/96e5a6aa5d3c00d0020315f5455b6c9…
---
diff --git a/modules/ims_qos/cdpeventprocessor.c b/modules/ims_qos/cdpeventprocessor.c
index 2b38050..ae683c6 100644
--- a/modules/ims_qos/cdpeventprocessor.c
+++ b/modules/ims_qos/cdpeventprocessor.c
@@ -262,8 +262,11 @@ void cdp_cb_event_process() {
}
} else {
LM_DBG("This is a media bearer session session");
+ if(p_session_data->session_has_been_opened) {
+ LM_DBG("Session was opened so decrementing active_media_rx_sessions\n");
+ counter_add(ims_qos_cnts_h.active_media_rx_sessions, -1);
+ }
- counter_add(ims_qos_cnts_h.active_media_rx_sessions, -1);
//we only terminate the dialog if this was triggered from the transport plane or timeout - i.e. if must_terminate_dialog is set
//if this was triggered from the signalling plane (i.e. someone hanging up) then we don'y need to terminate the dialog
if (p_session_data->must_terminate_dialog) {
diff --git a/modules/ims_qos/rx_aar.c b/modules/ims_qos/rx_aar.c
index fcc91de..4871dc5 100644
--- a/modules/ims_qos/rx_aar.c
+++ b/modules/ims_qos/rx_aar.c
@@ -98,6 +98,8 @@ void async_aar_callback(int is_timeout, void *param, AAAMessage *aaa, long elaps
struct cell *t = 0;
unsigned int cdp_result;
int result = CSCF_RETURN_ERROR;
+ AAASession *auth = 0;
+ rx_authsessiondata_t* p_session_data = 0;
LM_DBG("Received AAR callback\n");
saved_transaction_t* data = (saved_transaction_t*) param;
@@ -145,8 +147,29 @@ void async_aar_callback(int is_timeout, void *param, AAAMessage *aaa, long elaps
LM_DBG("Auth session ID [%.*s]", aaa->sessionId->data.len, aaa->sessionId->data.s);
if(!data->aar_update) {
- LM_DBG("This is an AAA response to an initial AAR");
+ LM_DBG("This is an AAA response to an initial AAR - active_media_rx_sessions");
+
+ //need to set Rx auth data to say this session has been successfully opened
+ //This is used elsewhere to prevent acting on termination events when the session has not been opened
+ //getting auth session
+ auth = cdpb.AAAGetAuthSession(aaa->sessionId->data);
+ if (!auth) {
+ LM_DBG("Could not get Auth Session for session id: [%.*s]\n", aaa->sessionId->data.len, aaa->sessionId->data.s);
+ goto error;
+ }
+ //getting session data
+ p_session_data = (rx_authsessiondata_t*) auth->u.auth.generic_data;
+ if (!p_session_data) {
+ LM_DBG("Could not get session data on Auth Session for session id: [%.*s]\n", aaa->sessionId->data.len, aaa->sessionId->data.s);
+ if (auth) cdpb.AAASessionsUnlock(auth->hash);
+ goto error;
+ }
+
+ LM_DBG("Setting session_has_been_opened and incrementing active_media_rx_sessions\n");
+ p_session_data->session_has_been_opened = 1;
counter_inc(ims_qos_cnts_h.active_media_rx_sessions);
+
+ if (auth) cdpb.AAASessionsUnlock(auth->hash);
str * passed_rx_session_id = shm_malloc(sizeof (struct _str));
passed_rx_session_id->s = 0;
@@ -252,7 +275,7 @@ void async_aar_reg_callback(int is_timeout, void *param, AAAMessage *aaa, long e
if (cdp_result >= 2000 && cdp_result < 3000) {
counter_inc(ims_qos_cnts_h.successful_registration_aars);
- if (is_rereg) {
+ if (is_rereg) {
LM_DBG("this is a re-registration, therefore we don't need to do anything except know that the the subscription was successful\n");
result = CSCF_RETURN_TRUE;
create_return_code(result);
@@ -273,7 +296,7 @@ void async_aar_reg_callback(int is_timeout, void *param, AAAMessage *aaa, long e
if (auth) cdpb.AAASessionsUnlock(auth->hash);
goto error;
}
- p_session_data->session_has_been_opened = 1;
+ p_session_data->session_has_been_opened = 1;
counter_inc(ims_qos_cnts_h.active_registration_rx_sessions);
if (auth) cdpb.AAASessionsUnlock(auth->hash);
update + workaround
replace_body_atonce function is very similar to replace_body_all but is
replace_body_atonce is defined to use fixup_regexpNL_none for incoming
parameters processing. Apparantly something in fixup_regexpNL_none is
causing the issue because when I change definition for replace_body_atonce
to use fixup_regexp_none (just like its "sister" function replace_body_all)
everything is working fine and no crash.
I am not sure about significance of fixup_regexpNL_none as it is not used by
any other function but replace_body_atonce however, as workaround I ended up
utilizing replace_body_all for my search + replace needs.
As far as fixup_regexpNL_none; I see it uses regcomp but I do not see a call
to regfee... So that is might be the root cause of the memory issue.
-----Original Message-----
From: denis(a)dilvest.com [mailto:denis@dilvest.com]
Sent: Wednesday, June 17, 2015 4:59 PM
To: 'sr-dev(a)lists.sip-router.org'
Subject: RE: Kamailio crashes when using replace_body_atonce from Textops
upon further tracing it looks like crash happens in action.c
MODF_RVE_PARAM_FREE when calling pkg_free((dst)[i+2].u.data);
-----Original Message-----
From: denis(a)dilvest.com [mailto:denis@dilvest.com]
Sent: Wednesday, June 17, 2015 1:25 PM
To: 'sr-dev(a)lists.sip-router.org'
Subject: Kamailio crashes when using replace_body_atonce from Textops
Hi,
Need some help resolving Kamailio crash.
Kamailio version 4.1 on Centos (uname -r "Linux 2.6.18-164.11.1.el5")
The issue:
I want to replace text in the message body using replace_body_atonce from
TextOps module
Works fine when called like:
replace_body_atonce("123456789","000");
Works fine when called like:
$var(replacewith)="000";
replace_body_atonce("123456789",$var(replacewith));
However, Kamailio crashes when called like
$var(findwhat)="123456789";
$var(replacewith)="000";
replace_body_atonce($var(findwhat),$var(replacewith));
The following is in the log
Jun 17 16:21:08 tms /usr/local/sbin/kamailio[18614]: ERROR: textops
[textops.c:570]: do_replace_body_f(): exit Jun 17 16:21:08 tms
/usr/local/sbin/kamailio[18614]: : <core> [mem/q_malloc.c:454]: qm_free():
BUG: qm_free: bad pointer 0xc0c0c0c0 (out of memory block!) called from
<core>: action.c: do_action(1164) - aborting Jun 17 16:21:08 tms
/usr/local/sbin/kamailio[18612]: ALERT: <core> [main.c:778]: handle_sigs():
child process 18614 exited by a signal 6 Jun 17 16:21:08 tms
/usr/local/sbin/kamailio[18612]: ALERT: <core> [main.c:781]: handle_sigs():
core was not generated
For some reason no core dump is generated ( i have tried "ulimit -c
unlimited" and "echo "1" > /proc/sys/kernel/core_uses_pid"). However, I
added log entry right before replace_body_atonce returns and I do see that
replace_body_atonce completes and returns but then crashes.
I can easily reproduce the issue. Please let me know if you have some
suggestion to try (even in the code as I can recompile it).
Thanks,
Denis