Module: sip-router
Branch: ser_modules
Commit: c76cffae64d8f1711f776de2bf23f64265b1a432
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c76cffa…
Author: Miklos Tirpak <miklos(a)iptel.org>
Committer: Miklos Tirpak <miklos(a)iptel.org>
Date: Thu Sep 3 09:56:18 2009 +0000
cfg framework: fix the initialization of child processes
(backport from sip-router)
The number of child processes that keep updating their
local configuration needs to be known before any child
process is forked.
Before this the child processes increased the reference
counter of the callback function list items after forking.
If a child process was forked "too fast" then it freed the list
before the other processes had a chance to refer to the list
item. The result was that some child processes missed
the initial configuration changes. (Those changes that
had per-child process callback defined.)
---
modules_s/cpl-c/cpl.c | 4 ++++
modules_s/ctl/ctl.c | 3 +++
modules_s/fifo/fifo.c | 8 +++++++-
modules_s/jabber/jabber.c | 11 +++++++++--
modules_s/nathelper/natping.c | 7 +++++--
modules_s/sms/sms.c | 4 ++++
6 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/modules_s/cpl-c/cpl.c b/modules_s/cpl-c/cpl.c
index 486cefd..82e1322 100644
--- a/modules_s/cpl-c/cpl.c
+++ b/modules_s/cpl-c/cpl.c
@@ -375,6 +375,10 @@ static int cpl_init(void)
strlower( &cpl_env.realm_prefix );
}
+ /* Register a child process that will keep updating
+ * its local configuration */
+ cfg_register_child(1);
+
return 0;
error:
return -1;
diff --git a/modules_s/ctl/ctl.c b/modules_s/ctl/ctl.c
index 071c2e2..d3fc9d8 100644
--- a/modules_s/ctl/ctl.c
+++ b/modules_s/ctl/ctl.c
@@ -36,6 +36,7 @@
#include "../../ut.h"
#include "../../dprint.h"
#include "../../pt.h"
+#include "../../cfg/cfg_struct.h"
#include "ctrl_socks.h"
#include "io_listener.h"
@@ -265,6 +266,8 @@ static int mod_init(void)
/* we will fork */
register_procs(1); /* we will be creating an extra process */
register_fds(fd_no);
+ /* The child process will keep updating its local configuration */
+ cfg_register_child(1);
}
#ifdef USE_FIFO
fifo_rpc_init();
diff --git a/modules_s/fifo/fifo.c b/modules_s/fifo/fifo.c
index 37b12ec..74d43cf 100644
--- a/modules_s/fifo/fifo.c
+++ b/modules_s/fifo/fifo.c
@@ -33,6 +33,7 @@
#include "../../ut.h"
#include "../../dprint.h"
#include "../../pt.h"
+#include "../../cfg/cfg_struct.h"
#include "fifo_server.h"
#include "fifo.h"
@@ -82,7 +83,12 @@ static int mod_init(void)
/* Signal to the core that we will be creating one
* additional process
*/
- if (fifo) register_procs(1);
+ if (fifo) {
+ register_procs(1);
+ /* The child process will keep updating its
+ * local configuration */
+ cfg_register_child(1);
+ }
return 0;
}
diff --git a/modules_s/jabber/jabber.c b/modules_s/jabber/jabber.c
index d512447..7d00171 100644
--- a/modules_s/jabber/jabber.c
+++ b/modules_s/jabber/jabber.c
@@ -280,6 +280,10 @@ static int mod_init(void)
return -1;
}
+ /* register nrw + 1 number of children that will keep
+ * updating their local configuration */
+ cfg_register_child(nrw + 1);
+
DBG("XJAB:mod_init: initialized ...\n");
return 0;
}
@@ -850,8 +854,11 @@ void xjab_check_workers(int mpid)
}
- /* initialize the config framework */
- if (cfg_child_init()) return;
+ /* initialize the config framework
+ * The child process was not registered under
+ * the framework during mod_init, therefore the
+ * late version needs to be called. (Miklos) */
+ if (cfg_late_child_init()) return;
ctx = db_ctx("jabber");
if (ctx == NULL) goto dberror;
diff --git a/modules_s/nathelper/natping.c b/modules_s/nathelper/natping.c
index 27877d7..d802e44 100644
--- a/modules_s/nathelper/natping.c
+++ b/modules_s/nathelper/natping.c
@@ -109,10 +109,13 @@ natpinger_init(void)
* Use timer only in single process. For forked SER,
* use separate process (see natpinger_child_init())
*/
- if (dont_fork)
+ if (dont_fork) {
register_timer(natping, NULL, natping_interval);
- else
+ } else {
register_procs(1); /* register the separate natpinger process */
+ /* The process will keep updating its configuration */
+ cfg_register_child(1);
+ }
if (natping_method == NULL) {
if (natping_crlf == 0)
diff --git a/modules_s/sms/sms.c b/modules_s/sms/sms.c
index d1832f4..c55247c 100644
--- a/modules_s/sms/sms.c
+++ b/modules_s/sms/sms.c
@@ -628,6 +628,10 @@ int global_init()
goto error;
}
*queued_msgs = 0;
+
+ /* register nr_of_modems number of child processes that will
+ * update their local configuration */
+ cfg_register_child(nr_of_modems);
return 1;
error:
There is a new bugfix release for the old 0.9.x ser (if you are using a
2.x version or sip-router, please disregard this message).
The release is made from the top of the rel_0_9_0 branch (so if you
already have a ser version compiled from the top of rel_0_9_0 in the
last 10 month you don't need to upgrade). It contains 3 more fixes when
compared to 0.9.7:
- tm: fix delete_cell() when the transaction is referenced
- core: fix memory leak in subst_user
- acc: misspeled function name and wrong check
You can either get it from cvs (v_0_9_8 tag or the top of rel_0_9_0
branch) or you can download a tarball with the sources:
http://ftp.iptel.org/pub/ser/0.9.8/src/ser-0.9.8_src.tar.gz.
There are no binary packages provided, only sources.
Upgrading from older 0.9.x versions should only involve re-compiling and
re-installing ser. There are no changes in the config file format or in
the DB schemes.
Andrei
The example in documentation for "set_dlg_profile()" shows:
Example 1.37. set_dlg_profile usage
...
set_dlg_profile("inbound_call");
But the fact is that profile name doesn't allow non alphanumeric chars:
ERROR:dialog:add_profile_definitions: bad profile name <to_gw>, char
_ - use only
alphanumerical characters
¿?
--
Iñaki Baz Castillo
<ibc(a)aliax.net>
sobomax 2009/09/16 20:50:52 CEST
SER CVS Repository
Modified files:
. rtpp_command.c
Log:
Only list disconnect notifications as supported if user actually had enabled
this feature with -n.
Revision Changes Path
1.31 +10 -1 rtpproxy/rtpp_command.c
http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/rtpproxy/rtpp_command.c.diff?…
Hi, using the lates 1.5 revision I've realized that when calling a NAT
registered user, the RURI domain is set to the real domain used in the
user REGISTER (this is, a private address).
I remember some threads asking this feature long time ago since then
Kamailio sets the "received" address in the RURI after "loockup".
When has been it fixes/improved? :)
--
Iñaki Baz Castillo
<ibc(a)aliax.net>