Module: kamailio
Branch: master
Commit: e7514fde047a8616cea49db76efdc6c98e92030f
URL: https://github.com/kamailio/kamailio/commit/e7514fde047a8616cea49db76efdc6c…
Author: Jason Penton <jason.penton(a)gmail.com>
Committer: Jason Penton <jason.penton(a)gmail.com>
Date: 2015-02-03T16:16:33+02:00
modules/ims_charging: fixed up some locking problems
- could result in unexpected behaviour and even seg faults
---
Modified: modules/ims_charging/dialog.c
Modified: modules/ims_charging/ims_ro.c
Modified: modules/ims_charging/ro_timer.c
---
Diff: https://github.com/kamailio/kamailio/commit/e7514fde047a8616cea49db76efdc6c…
Patch: https://github.com/kamailio/kamailio/commit/e7514fde047a8616cea49db76efdc6c…
---
diff --git a/modules/ims_charging/dialog.c b/modules/ims_charging/dialog.c
index 1a79175..0f8beb8 100644
--- a/modules/ims_charging/dialog.c
+++ b/modules/ims_charging/dialog.c
@@ -159,14 +159,15 @@ void dlg_terminated(struct dlg_cell *dlg, int type, struct dlg_cb_params *_param
//if the Ro session is not active we don't need to do anything. This prevents
//double processing for various dialog_terminated callback events.
//If however, the call was never answered, then we can continue as normal
+ ro_session_lock(ro_session_table, ro_session_entry);
if (!ro_session->active && (ro_session->start_time != 0)) {
unref_ro_session(ro_session,1);
LM_ERR("Ro Session is not active, but may have been answered [%d]\n", (int)ro_session->start_time);
+ ro_session_unlock(ro_session_table, ro_session_entry);
return;
}
- ro_session_lock(ro_session_table, ro_session_entry);
if (ro_session->active) { // if the call was never activated, there's no timer to remove
int ret = remove_ro_timer(&ro_session->ro_tl);
@@ -280,4 +281,4 @@ void add_dlg_data_to_contact(struct dlg_cell *dlg, int type, struct dlg_cb_param
}
ul.unlock_udomain(domain_t, &impu_data->identity);
}
-}
\ No newline at end of file
+}
diff --git a/modules/ims_charging/ims_ro.c b/modules/ims_charging/ims_ro.c
index 5cd0f5f..142135f 100644
--- a/modules/ims_charging/ims_ro.c
+++ b/modules/ims_charging/ims_ro.c
@@ -487,6 +487,7 @@ int sip_create_ro_ccr_data(struct sip_msg * msg, int dir, Ro_CCR_t ** ro_ccr_dat
return 0;
}
+/* must be called with lock on ro_session */
void send_ccr_interim(struct ro_session* ro_session, unsigned int used, unsigned int reserve) {
AAASession * auth = 0;
@@ -647,6 +648,7 @@ void send_ccr_interim(struct ro_session* ro_session, unsigned int used, unsigned
// to it can be reused later.
//
struct ro_session_entry *ro_session_entry = &(ro_session_table->entries[ro_session->h_entry]);
+ ro_session_lock(ro_session_table, ro_session_entry);
unref_ro_session_unsafe(ro_session, 1, ro_session_entry);//unref from the initial timer that fired this event.
ro_session_unlock(ro_session_table, ro_session_entry);
diff --git a/modules/ims_charging/ro_timer.c b/modules/ims_charging/ro_timer.c
index 5821e8c..75f6eab 100644
--- a/modules/ims_charging/ro_timer.c
+++ b/modules/ims_charging/ro_timer.c
@@ -266,7 +266,7 @@ void resume_ro_session_ontimeout(struct interim_ccr *i_req) {
}
ro_session_entry = &(ro_session_table->entries[i_req->ro_session->h_entry]);
-
+ ro_session_lock(ro_session_table, ro_session_entry);
LM_DBG("credit=%d credit_valid_for=%d", i_req->new_credit, i_req->credit_valid_for);
used_secs = now - i_req->ro_session->last_event_timestamp;
@@ -392,7 +392,6 @@ void ro_session_ontimeout(struct ro_tl *tl) {
}
ro_session_entry = &(ro_session_table->entries[ro_session->h_entry]);
- ro_session_lock(ro_session_table, ro_session_entry);
LM_DBG("event-type=%d", ro_session->event_type);
@@ -467,7 +466,7 @@ void ro_session_ontimeout(struct ro_tl *tl) {
update_stat(killed_calls, 1);
//unref_ro_session_unsafe(ro_session, 1, ro_session_entry); //unref from the initial timer that fired this event.
- ro_session_unlock(ro_session_table, ro_session_entry);
+// ro_session_unlock(ro_session_table, ro_session_entry);
dlgb.lookup_terminate_dlg(ro_session->dlg_h_entry, ro_session->dlg_h_id, NULL);
return;
Hello,
please correct typos in the "COREX" module documentation (verified in current
devel module´s documentation), chapter 1.3 ff:
modparam("corex", "min_msg_len", 32)
The modparam "min_msg_len" (=
http://kamailio.org/docs/modules/devel/modules/corex.html#idm14680) is always
named "msg_min_len" in the README file and online documentation. Only the
exemplary kamailio.cfg excerpt is using the right name of this module parameter.
Please use the right parameters name "min_msg_len" in the whole document.
Thx.
Klaus
Hello,
I have big troubles using the db_berkeley module in Kamailio version 4.2.2 in
combination with presence related modules like presence, presence_xml or rls.
Kamailio cannot startup and is "hanging" in the OS (RHEL 6.4 with kernel
2.6.32-358.el6.i686). In the debug modus I can see following log output:
[...] kamailio[18400]: INFO: cfgutils [cfgutils.c:784]: mod_init(): no hash_file
given, disable hash functionality
[...] kamailio[18400]: INFO: db_berkeley [km_db_berkeley.c:212]: bdb_init():
using database at: /var/lib/berkeley_kamailio42.db
[...] kamailio: ERROR: <core> [daemonize.c:315]: daemonize(): Main process
exited before writing to pipe
During startup the OS is creating a core dump. Backtrace analysation of these
dumps brought following information (gdb output):
(variant 1):
Program terminated with signal 11, Segmentation fault.
#0 0x00ee965b in ?? () from /lib/libdb-4.7.so(gdb) bt
#0 0x00ee965b in ?? () from /lib/libdb-4.7.so
#1 0x00ee9bbc in ?? () from /lib/libdb-4.7.so
#2 0x00eea2a0 in __dbc_get_pp () from /lib/libdb-4.7.so
#3 0x00269a07 in bdb_delete (_h=0xb6f94484, _k=0x0, _op=0x0, _v=0x0, _n=0) at
km_db_berkeley.c:827
#4 0x08a5cf7f in restore_db_subs () at subscribe.c:2475
#5 0x08a05193 in mod_init () at presence.c:344
#6 0x081bb23b in init_mod (m=0xb6f5c918) at sr_module.c:966
#7 0x081bafd0 in init_mod (m=0xb6f5cbe4) at sr_module.c:963
#8 0x081bb513 in init_modules () at sr_module.c:995
#9 0x080e4c77 in main (argc=3, argv=0xbf922c04) at main.c:2502
OR (variant 2):
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x00eef343 in __db_prdbt () from /lib/libdb-4.8.so
#2 0x00d408d9 in km_bdblib_create_dbenv (_dbenv=0xb7050b7c, _home=0xbf9f2784
"/var/lib/berkeley_kamailio42.db") at km_bdb_lib.c:320
#3 0x00d41cd9 in km_bdblib_get_db (_s=0xbf9f2b7c) at km_bdb_lib.c:409
#4 0x00d56302 in bdb_init (_sqlurl=0x7aaeb10) at km_db_berkeley.c:213
#5 0x07a35528 in mod_init () at presence.c:312
#6 0x081bb23b in init_mod (m=0xb6ff4a8c) at sr_module.c:966
#7 0x081bafd0 in init_mod (m=0xb6ff4d58) at sr_module.c:963
#8 0x081bafd0 in init_mod (m=0xb6ff4f6c) at sr_module.c:963
#9 0x081bafd0 in init_mod (m=0xb6ff5118) at sr_module.c:963
#10 0x081bafd0 in init_mod (m=0xb6ff5314) at sr_module.c:963
#11 0x081bafd0 in init_mod (m=0xb6ff5550) at sr_module.c:963
#12 0x081bafd0 in init_mod (m=0xb6ff5848) at sr_module.c:963
#13 0x081bafd0 in init_mod (m=0xb6ff5b8c) at sr_module.c:963
#14 0x081bafd0 in init_mod (m=0xb6ff5dac) at sr_module.c:963
#15 0x081bafd0 in init_mod (m=0xb6ff5f9c) at sr_module.c:963
#16 0x081bafd0 in init_mod (m=0xb6ff62b0) at sr_module.c:963
#17 0x081bafd0 in init_mod (m=0xb6ff674c) at sr_module.c:963
#18 0x081bafd0 in init_mod (m=0xb6ff697c) at sr_module.c:963
#19 0x081bb513 in init_modules () at sr_module.c:995
#20 0x080e4c77 in main (argc=3, argv=0xbf9f37e4) at main.c:2502
However, it seems to be caused by the presence.c file of the presence module all
time. When I comment out any presence related module and use the usrloc module
(e.g.) only, it is working fine with berkeley DB, too. The configuration itself
is working fine with DB_ENGINE MySQL instead of Berkeley. I´ve also tested
different versions of Berkeley DB (4.7 (originally delivered with the OS), 4.8,
5.3 and 6.1). The result is always the same....
Could anybody take a look at this dump output? What is causing these dumps? Is
there any bug within the presence modules? I cannot move to another DB so easy,
as it should be used (in future) in embedded environment.....
Thanks in advance!
br
Klaus
Hello,
short note to say that I updated the ssl certificates for kamailio.org
web site. They are issued by cacert.org, which is probably not trusted
by most of the browsers, but they are well known in the open source
environment.
If you get a warning about certificate change and the issuer is
cacert.org, then you should be safe to login over https (e.g., to edit
the wiki pages).
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
I got in contact with MySQL development and in MySQL 5.7 they have already changed the "--ssl" option so that it requires TLS, with no default fallback to plaintext.
They are working on TLS by default and to make it easier to verify TLS for replication and connections.
We can implement some of the TLS options in our db_mysql module with modparams, which would make it easier for us to help using TLS - this way there's no need to specify TLS in my.cnf sections any more.
/Olle
Hi!
The kamailio_cdrs procedure, as described at
http://siremis.asipto.com/install-accounting/, has the database name
hard coded (i.e. "openser").
I suggest to remove the hard coded DB or at least make a warning that
the DB name needs to be adopted.
Thanks
Klaus