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>
Bugs item #2791122, was opened at 2009-05-13 13:07
Message generated for change (Comment added) made by effeks
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=2791122&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tobias Lindgren (effeks)
Assigned to: Nobody/Anonymous (nobody)
Summary: fr_inv_timer_avp on amd64
Initial Comment:
Hi!
When we compile kamailio 1.5.1 trunk on Debian Linux amd64 the fr_inv_time_avp timer cannot altered (the value of the AVP-variable has no effect on the timer) and seem stuck on something like 15 seconds. Compiling the same code in a 32bit chroot works fine, aswell as on any other standard 32bit system, where the timer is set to the value of the AVP as expected.
/effeks
----------------------------------------------------------------------
>Comment By: Tobias Lindgren (effeks)
Date: 2009-09-16 00:42
Message:
Hi, did you have a chance to look at the debugs?
----------------------------------------------------------------------
Comment By: Tobias Lindgren (effeks)
Date: 2009-06-17 16:04
Message:
Sent debugs to your email.
----------------------------------------------------------------------
Comment By: Daniel-Constantin Mierla (miconda)
Date: 2009-06-10 13:23
Message:
I did several tests and the timeout was ok. Here are my parameters:
modparam("tm", "fr_timer", 15)
modparam("tm", "fr_inv_timer", 60)
modparam("tm", "wt_timer", 5)
modparam("tm", "fr_inv_timer_avp", "$avp(i:120)")
$avp(i:120) = 30;
Can you get a ngrep trace and send it to me at: <miconda [at] gmail.com>?
Thanks.
----------------------------------------------------------------------
Comment By: Tobias Lindgren (effeks)
Date: 2009-06-05 13:23
Message:
Any news?
----------------------------------------------------------------------
Comment By: Tobias Lindgren (effeks)
Date: 2009-05-25 13:50
Message:
The avp-value was a string, but changing it into an integer makes no
difference. On 32bit it works regardless of int or str.
----------------------------------------------------------------------
Comment By: Daniel-Constantin Mierla (miconda)
Date: 2009-05-25 11:49
Message:
Did you check my last message? Is the timer avp integer or string value?
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2009-05-25 11:47
Message:
Any progress on this?
----------------------------------------------------------------------
Comment By: Daniel-Constantin Mierla (miconda)
Date: 2009-05-22 19:12
Message:
Just saw in your last comment that you assign a string to the avp:
$avp(i:10) = "25";
Should be:
$avp(i:10) = 25;
Can you doublecheck?
----------------------------------------------------------------------
Comment By: Daniel-Constantin Mierla (miconda)
Date: 2009-05-19 09:25
Message:
OK, i am going to check the log. thanks.
----------------------------------------------------------------------
Comment By: Tobias Lindgren (effeks)
Date: 2009-05-15 13:23
Message:
Done, the config snippet looks something like this:
modparam("tm", "fr_inv_timer_avp", "$avp(i:10)")
$avp(i:10) = "25";
t_relay();
----------------------------------------------------------------------
Comment By: Daniel-Constantin Mierla (miconda)
Date: 2009-05-15 12:07
Message:
Can you run with debug=5 and attach the syslog output here?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=2791122&group_…
Module: sip-router
Branch: andrei/path
Commit: 3c7744da21a2c2cb82dfdfc28f43f65e139b91cf
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3c7744d…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Mon Sep 14 13:32:08 2009 +0200
core: add path route headers after local via
- minor header order fix: route header generated from recorded
path are added after the local via if no other route headers are
present in the message (they were added in front of the local
via until now).
---
msg_translator.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/msg_translator.c b/msg_translator.c
index 42c1cf1..2958fc5 100644
--- a/msg_translator.c
+++ b/msg_translator.c
@@ -1563,6 +1563,7 @@ char * build_req_buf_from_sip_req( struct sip_msg* msg,
new_buf=0;
received_buf=0;
rport_buf=0;
+ via_anchor=0;
line_buf=0;
via_len=0;
path_buf.s=0;
@@ -1584,8 +1585,10 @@ char * build_req_buf_from_sip_req( struct sip_msg* msg,
branch.s=msg->add_to_branch_s;
branch.len=msg->add_to_branch_len;
+ via_anchor=anchor_lump(msg, msg->via1->hdr.s-buf, 0, HDR_VIA_T);
+ if (unlikely(via_anchor==0)) goto error00;
line_buf = create_via_hf( &via_len, msg, send_info, &branch);
- if (!line_buf){
+ if (unlikely(!line_buf)){
LOG(L_ERR,"ERROR: build_req_buf_from_sip_req: "
"memory allocation failure\n");
goto error00;
@@ -1684,10 +1687,13 @@ after_update_via1:
memcpy(path_buf.s+ROUTE_PREFIX_LEN+msg->path_vec.len, CRLF, CRLF_LEN);
path_buf.s[path_buf.len]=0;
/* insert Route header either before the other routes
- (if present & parsed) or after the local via */
+ (if present & parsed), after the local via or after in front of
+ the first via if we don't add a local via*/
if (msg->route){
path_anchor=anchor_lump(msg, msg->route->name.s-buf, 0,
HDR_ROUTE_T);
+ }else if (likely(via_anchor)){
+ path_anchor=via_anchor;
}else if (likely(msg->via1)){
path_anchor=anchor_lump(msg, msg->via1->hdr.s-buf, 0,
HDR_ROUTE_T);
@@ -1755,8 +1761,6 @@ after_update_via1:
/* try to add it before msg. 1st via */
/* add first via, as an anchor for second via*/
if(likely(line_buf)) {
- via_anchor=anchor_lump(msg, msg->via1->hdr.s-buf, 0, HDR_VIA_T);
- if (via_anchor==0) goto error04;
if ((via_lump=insert_new_lump_before(via_anchor, line_buf, via_len,
HDR_VIA_T))==0)
goto error04;