Hi all,
we had problems with some callback-functions. The problem is isolated to
the unref_new_dialog function in dlg_handlers.c
If the whole tmcb_params structure is not initialized, we run into
segfaults in a later usage.
here a patch for this problem ("inspired" by openSIPS code)
@@ -417,7 +420,7 @@
void unref_new_dialog(void *dialog)
{
struct tmcb_params p;
-
+ memset(&p, 0, sizeof(struct tmcb_params));
p.param = (void*)&dialog;
dlg_onreply(0, TMCB_TRANS_DELETED, &p);
}
Down below the whole patch for the dlg_handlers.c file, the second thing
is a extra control part for FAKED_REPLY's in the dlg_onreply function.
I hope this is useful.
best regards
Torben Friese
Index: modules/dialog/dlg_handlers.c
===================================================================
--- modules/dialog/dlg_handlers.c (revision 5983)
+++ modules/dialog/dlg_handlers.c (working copy)
@@ -280,24 +280,27 @@
if (new_state==DLG_STATE_CONFIRMED_NA &&
old_state!=DLG_STATE_CONFIRMED_NA && old_state!=DLG_STATE_CONFIRMED )
{
LM_DBG("dialog %p confirmed\n",dlg);
-
- /* get to tag*/
- if ( !rpl->to && ((parse_headers(rpl, HDR_TO_F,0)<0) || !rpl->to) ) {
- LM_ERR("bad reply or missing TO hdr :-/\n");
- tag.s = 0;
- tag.len = 0;
- } else {
- tag = get_to(rpl)->tag_value;
- if (tag.s==0 || tag.len==0) {
- LM_ERR("missing TAG param in TO hdr :-/\n");
+ if (rpl != FAKED_REPLY) {
+ /* get to tag*/
+ if ( !rpl->to && ((parse_headers(rpl, HDR_TO_F,0)<0) || !rpl->to) )
{
+ LM_ERR("bad reply or missing TO hdr :-/\n");
tag.s = 0;
tag.len = 0;
+ } else {
+ tag = get_to(rpl)->tag_value;
+ if (tag.s==0 || tag.len==0) {
+ LM_ERR("missing TAG param in TO hdr :-/\n");
+ tag.s = 0;
+ tag.len = 0;
+ }
}
- }
- /* save callee's tag, cseq, contact and record route*/
- if (populate_leg_info( dlg, rpl, t, DLG_CALLEE_LEG, &tag) !=0) {
- LM_ERR("could not add further info to the dialog\n");
+ /* save callee's tag, cseq, contact and record route*/
+ if (populate_leg_info( dlg, rpl, t, DLG_CALLEE_LEG, &tag) !=0) {
+ LM_ERR("could not add further info to the dialog\n");
+ }
+ } else {
+ LM_ERR("Faked reply!\n");
}
/* set start time */
@@ -417,7 +420,7 @@
void unref_new_dialog(void *dialog)
{
struct tmcb_params p;
-
+ memset(&p, 0, sizeof(struct tmcb_params));
p.param = (void*)&dialog;
dlg_onreply(0, TMCB_TRANS_DELETED, &p);
}
Revision: 5983
http://openser.svn.sourceforge.net/openser/?rev=5983&view=rev
Author: juhe
Date: 2010-02-10 06:06:54 +0000 (Wed, 10 Feb 2010)
Log Message:
-----------
* modules/lcr: added in docs install dependency on libpcre
(credits to Kris Amy)
Modified Paths:
--------------
branches/1.5/modules/lcr/README
branches/1.5/modules/lcr/doc/lcr_admin.xml
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Module: sip-router
Branch: master
Commit: 0c7048297f590f140ae84efdcde8a392ef23527e
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0c70482…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Wed Feb 10 07:34:33 2010 +0200
modules/lcr: added in docs missing install dependency on libpcre
- Credits to Kris Amy.
---
modules/lcr/README | 22 +++++++++++-----------
modules/lcr/doc/lcr_admin.xml | 2 +-
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/modules/lcr/README b/modules/lcr/README
index 0603f40..02065f2 100644
--- a/modules/lcr/README
+++ b/modules/lcr/README
@@ -251,7 +251,7 @@ Chapter 1. Admin Guide
The following libraries or applications must be installed before
running SIP Router with this module:
- * none.
+ * libpcre
3. Exported Parameters
@@ -507,7 +507,7 @@ modparam("lcr","priority_column","priority")
Default value is 1.
- Example 1.20. Setting lcr_count module parameter
+ Example 1.20. Setting lcr_count module parameter
...
modparam("lcr", "lcr_count", 10)
...
@@ -558,7 +558,7 @@ modparam("lcr", "flags_avp", "$avp(i:712)")
Default value is 0.
- Example 1.24. Setting defunct_capability module parameter
+ Example 1.24. Setting defunct_capability module parameter
...
modparam("lcr", "defunct_capability", 1)
...
@@ -598,7 +598,7 @@ modparam("lcr", "defunct_gw_avp", "$avp(s:defunct_gw_avp)")
Default value is 128.
- Example 1.27. Setting lcr_hash_size module parameter
+ Example 1.27. Setting lcr_hash_size module parameter
...
modparam("lcr", "lcr_hash_size", 1024)
...
@@ -628,7 +628,7 @@ modparam("lcr", "fetch_rows", 3000)
4.6. to_gw(lcr_id [, ip_addr])
4.7. to_any_gw([ip_addr])
-4.1. load_gws(lcr_id, caller_uri)
+4.1. load_gws(lcr_id, caller_uri)
Loads URI schemes, IP addresses, hostnames, ports, and transports of
matching gateways to gw_uri_avp (see Overview section). Argument lcr_id
@@ -652,7 +652,7 @@ if (!load_gws("1", "$var(caller_uri)")) {
};
...
-4.2. next_gw()
+4.2. next_gw()
Upon first call, replaces URI scheme, host, port, and transport of
Request-URI by the values stored in first gw_uri_avp and destroys that
@@ -689,7 +689,7 @@ if (!next_gw()) {
};
...
-4.3. defunct_gw(period)
+4.3. defunct_gw(period)
Defuncts gateway selected by preceding next_gw() call for a period of
seconds given as argument. Argument must be a positive integer constant
@@ -707,7 +707,7 @@ if (!next_gw()) {
defunct_gw("60");
...
-4.4. from_gw(lcr_id [, ip_addr])
+4.4. from_gw(lcr_id [, ip_addr])
Checks if request comes from IP address of a gateway in LCR instance
specified by lcr_id argument, which can be an integer constant or a
@@ -733,7 +733,7 @@ if (from_gw("1", "$avp(s:real_source_addr)") {
};
...
-4.5. from_any_gw([ip_addr])
+4.5. from_any_gw([ip_addr])
Checks if request comes from IP address of any gateway. IP address to
be checked is either taken from source IP address of the request or (if
@@ -757,7 +757,7 @@ if (from_gw("1", "$avp(s:real_source_addr)") {
$var(lcr_id) = from_any_gw();
...
-4.6. to_gw(lcr_id [, ip_addr])
+4.6. to_gw(lcr_id [, ip_addr])
Checks if in-dialog request goes to a gateway in LCR instance specified
by lcr_id argument. IP address to be checked is either taken from
@@ -779,7 +779,7 @@ if (to_gw("1")) {
};
...
-4.7. to_any_gw([ip_addr])
+4.7. to_any_gw([ip_addr])
Checks if in-dialog request goes to any gateway. IP address to be
checked is either taken from Request-URI hostpart or (if present) from
diff --git a/modules/lcr/doc/lcr_admin.xml b/modules/lcr/doc/lcr_admin.xml
index 37aaf6c..06ab9ea 100644
--- a/modules/lcr/doc/lcr_admin.xml
+++ b/modules/lcr/doc/lcr_admin.xml
@@ -111,7 +111,7 @@
<itemizedlist>
<listitem>
<para>
- <emphasis>none</emphasis>.
+ <emphasis>libpcre</emphasis>
</para>
</listitem>
</itemizedlist>
Revision: 5982
http://openser.svn.sourceforge.net/openser/?rev=5982&view=rev
Author: juhe
Date: 2010-02-10 05:52:41 +0000 (Wed, 10 Feb 2010)
Log Message:
-----------
* modules/permissions: group id in address permissions must have a positive
integer value.
Modified Paths:
--------------
branches/1.5/modules/permissions/README
branches/1.5/modules/permissions/address.c
branches/1.5/modules/permissions/doc/permissions_admin.xml
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Module: sip-router
Branch: master
Commit: 7c20eb9f0cb555ce3fb4aee49cb475cba4a6c70a
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7c20eb9…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Wed Feb 10 07:15:24 2010 +0200
modules_k/permissions: group identifier must be positive integer
- Group Identifier in address permissions must have a positive integer
value.
(cherry picked from commit c67e72eb16f277eeae16182e15e0e8ebf319dce0)
---
modules_k/permissions/README | 4 ++--
modules_k/permissions/address.c | 1 +
modules_k/permissions/doc/permissions_admin.xml | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/modules_k/permissions/README b/modules_k/permissions/README
index ec3c3b8..8b4b7e4 100644
--- a/modules_k/permissions/README
+++ b/modules_k/permissions/README
@@ -276,8 +276,8 @@ Chapter 1. Admin Guide
(allow_source_address) or given as pvar arguments (allow_address).
Addresses stored in cached database table can be grouped together into
- one or more groups specified by a group identifier (unsigned integer).
- Group identifier is given as argument to allow_address and
+ one or more groups specified by a group identifier (positive integer
+ value). Group identifier is given as argument to allow_address and
allow_source_address functions.
1.5. Trusted Requests
diff --git a/modules_k/permissions/address.c b/modules_k/permissions/address.c
index e40e510..126c8d8 100644
--- a/modules_k/permissions/address.c
+++ b/modules_k/permissions/address.c
@@ -114,6 +114,7 @@ int reload_address_table(void)
val = ROW_VALUES(row + i);
if ((ROW_N(row + i) == 4) &&
(VAL_TYPE(val) == DB1_INT) && !VAL_NULL(val) &&
+ (VAL_INT(val) > 0) &&
(VAL_TYPE(val + 1) == DB1_STRING) && !VAL_NULL(val + 1) &&
inet_aton((char *)VAL_STRING(val + 1), &ip_addr) != 0 &&
(VAL_TYPE(val + 2) == DB1_INT) && !VAL_NULL(val + 2) &&
diff --git a/modules_k/permissions/doc/permissions_admin.xml b/modules_k/permissions/doc/permissions_admin.xml
index b0c6df3..3e15601 100644
--- a/modules_k/permissions/doc/permissions_admin.xml
+++ b/modules_k/permissions/doc/permissions_admin.xml
@@ -179,7 +179,7 @@
<para>
Addresses stored in cached database table can be grouped
together into one or more groups specified by a group
- identifier (unsigned integer). Group
+ identifier (positive integer value). Group
identifier is given as argument to allow_address and
allow_source_address functions.
</para>
Module: sip-router
Branch: sr_3.0
Commit: c67e72eb16f277eeae16182e15e0e8ebf319dce0
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c67e72e…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Wed Feb 10 07:15:24 2010 +0200
modules_k/permissions: group identifier must be positive integer
- Group Identifier in address permissions must have a positive integer
value.
---
modules_k/permissions/README | 4 ++--
modules_k/permissions/address.c | 1 +
modules_k/permissions/doc/permissions_admin.xml | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/modules_k/permissions/README b/modules_k/permissions/README
index a3406f2..ff0959f 100644
--- a/modules_k/permissions/README
+++ b/modules_k/permissions/README
@@ -276,8 +276,8 @@ Chapter 1. Admin Guide
(allow_source_address) or given as pvar arguments (allow_address).
Addresses stored in cached database table can be grouped together into
- one or more groups specified by a group identifier (unsigned integer).
- Group identifier is given as argument to allow_address and
+ one or more groups specified by a group identifier (positive integer
+ value). Group identifier is given as argument to allow_address and
allow_source_address functions.
1.5. Trusted Requests
diff --git a/modules_k/permissions/address.c b/modules_k/permissions/address.c
index e40e510..126c8d8 100644
--- a/modules_k/permissions/address.c
+++ b/modules_k/permissions/address.c
@@ -114,6 +114,7 @@ int reload_address_table(void)
val = ROW_VALUES(row + i);
if ((ROW_N(row + i) == 4) &&
(VAL_TYPE(val) == DB1_INT) && !VAL_NULL(val) &&
+ (VAL_INT(val) > 0) &&
(VAL_TYPE(val + 1) == DB1_STRING) && !VAL_NULL(val + 1) &&
inet_aton((char *)VAL_STRING(val + 1), &ip_addr) != 0 &&
(VAL_TYPE(val + 2) == DB1_INT) && !VAL_NULL(val + 2) &&
diff --git a/modules_k/permissions/doc/permissions_admin.xml b/modules_k/permissions/doc/permissions_admin.xml
index 4ad28b7..06512a9 100644
--- a/modules_k/permissions/doc/permissions_admin.xml
+++ b/modules_k/permissions/doc/permissions_admin.xml
@@ -179,7 +179,7 @@
<para>
Addresses stored in cached database table can be grouped
together into one or more groups specified by a group
- identifier (unsigned integer). Group
+ identifier (positive integer value). Group
identifier is given as argument to allow_address and
allow_source_address functions.
</para>
Hello,
I was thinking of having an IRC meeting to discuss next steps within sip
router. Now that 3.0 branches are out for a while, would be good to plan
a bit 3.1. For me Friday (or even Thursday if not too early for others
to make arrangements) this week would be good, say 14:00 or 15:00UTC to
allow fair time for US.
If this date does not fit, please make proposals. The channel is
#sip-router on freenode.net.
Cheers,
Daniel
--
Daniel-Constantin Mierla
eLearning class for Kamailio 3.0.0
* http://www.asipto.com/