Module: sip-router
Branch: master
Commit: 5af7ae813ca63452c571ea7528754dd0b759c019
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5af7ae8…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Fri May 28 15:54:51 2010 +0300
modules/lcr: Simpler implementation of next_gw() function
- Based on recent changes related to Request-URI handling.
---
modules/lcr/lcr_mod.c | 54 ++++++++++++------------------------------------
1 files changed, 14 insertions(+), 40 deletions(-)
diff --git a/modules/lcr/lcr_mod.c b/modules/lcr/lcr_mod.c
index add81d9..95d6c12 100644
--- a/modules/lcr/lcr_mod.c
+++ b/modules/lcr/lcr_mod.c
@@ -79,7 +79,6 @@
#include "../../resolve.h"
#include "../../mod_fix.h"
#include "../../socket_info.h"
-#include "../../modules/tm/tm_load.h"
#include "../../pvar.h"
#include "../../mod_fix.h"
#include "hash.h"
@@ -149,9 +148,6 @@ static void free_shared_memory(void);
* Type definitions
*/
-/* TMB Structure */
-struct tm_binds tmb;
-
struct gw_grp {
unsigned int grp_id;
unsigned int first; /* index to first gw of group in gw table */
@@ -242,7 +238,6 @@ struct gw_info **gwtp = (struct gw_info **)NULL;
/* Pointer to lcr hash table pointer table */
struct lcr_info ***lcrtp = (struct lcr_info ***)NULL;
-
/*
* Functions that are defined later
*/
@@ -403,6 +398,7 @@ static int mod_init(void)
unsigned short avp_flags;
unsigned int i;
+ /* Register RPC commands */
if (rpc_register_array(lcr_rpc)!=0) {
LM_ERR("failed to register RPC commands\n");
return -1;
@@ -1869,22 +1865,20 @@ static int defunct_gw(struct sip_msg* _m, char *_defunct_period, char *_s2)
/*
- * When called first time in route block, rewrites scheme, host, port, and
+ * When called first time, rewrites scheme, host, port, and
* transport parts of R-URI based on first gw_uri_avp value, which is then
* destroyed. Saves R-URI user to ruri_user_avp for later use.
*
- * On other calls appends a new branch to request, where scheme, host, port,
+ * On other calls, rewrites R-URI, where scheme, host, port,
* and transport of URI are taken from the first gw_uri_avp value,
- * which is then destroyed. URI user is taken either from R-URI (first
- * call in failure route block) or from ruri_user_avp value saved earlier.
+ * which is then destroyed. URI user is taken either from ruri_user_avp
+ * value saved earlier.
*
* Returns 1 upon success and -1 upon failure.
*/
static int next_gw(struct sip_msg* _m, char* _s1, char* _s2)
{
int_str ruri_user_val, val;
- struct action act;
- struct run_act_ctx ra_ctx;
struct usr_avp *ru_avp;
int rval;
str uri_str;
@@ -1899,6 +1893,7 @@ static int next_gw(struct sip_msg* _m, char* _s1, char* _s2)
/* First invocation either in route or failure route block.
* Take Request-URI user from Request-URI and generate Request
* and Destination URIs. */
+
if (parse_sip_msg_uri(_m) < 0) {
LM_ERR("parsing of R-URI failed\n");
return -1;
@@ -1910,48 +1905,27 @@ static int next_gw(struct sip_msg* _m, char* _s1, char* _s2)
/* Save Request-URI user into uri_user_avp for use in subsequent
* invocations. */
+
val.s = _m->parsed_uri.user;
add_avp(ruri_user_avp_type|AVP_VAL_STR, ruri_user_avp, val);
LM_DBG("added ruri_user_avp <%.*s>\n", val.s.len, val.s.s);
} else {
- /* Subsequent invocation either in route or failure route block. */
-
- /* Take Request-URI user from ruri_user_avp and generate Request
+ /* Subsequent invocation either in route or failure route block.
+ * Take Request-URI user from ruri_user_avp and generate Request
* and Destination URIs. */
+
if (generate_uris(r_uri, &(ruri_user_val.s), &r_uri_len, dst_uri,
&dst_uri_len, &addr, &flags) != 1) {
return -1;
}
}
- if ((is_route_type(REQUEST_ROUTE)) && (ru_avp == NULL)) {
-
- /* First invocation in route block => Rewrite Request URI. */
- memset(&act, '\0', sizeof(act));
- act.type = SET_URI_T;
- act.val[0].type = STRING_ST;
- act.val[0].u.string = r_uri;
- init_run_actions_ctx(&ra_ctx);
- rval = do_action(&ra_ctx, &act, _m);
- if (rval != 1) {
- LM_ERR("do_action failed with return value <%d>\n", rval);
- return -1;
- }
-
- } else {
-
- /* Subsequent invocation in route block or any invocation in
- * failure route block => append new branch. */
- uri_str.s = r_uri;
- uri_str.len = r_uri_len;
- LM_DBG("appending branch <%.*s>\n", uri_str.len, uri_str.s);
- if (append_branch(_m, &uri_str, 0, 0, Q_UNSPECIFIED, 0, 0) == -1) {
- LM_ERR("when appending branch <%.*s>\n", uri_str.len, uri_str.s);
- return -1;
- }
- }
+ /* Rewrite Request URI */
+ uri_str.s = r_uri;
+ uri_str.len = r_uri_len;
+ rewrite_uri(_m, &uri_str);
/* Set Destination URI if not empty */
if (dst_uri_len > 0) {
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Savolainen Dmitri (snen)
Attached to Project - sip-router
Summary - acc report_ack doesn't work
Task Type - Bug Report
Category - Module
Status - Unconfirmed
Assigned To -
Operating System - Linux
Severity - Medium
Priority - Normal
Reported Version - Development
Due in Version - Undecided
Due Date - Undecided
Details - in 3.0.2 kamailio revision.
Trying to use modparam("acc", "report_ack", 1) and modparam("acc", "db_flag", 1)
ACK records absent in acc table after dialog established...
modules/tm/t_lookup.c:1464
unmatched_totag(t_ack, p_msg)
return false;
after changing defination of
int unmatched_totag(struct cell *t, struct sip_msg *ack)
from modules/tm/t_reply.c to old version (openser-1.2.0-notls for example)
all work fine again
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=74
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Module: sip-router
Branch: andrei/tcp_tls_changes
Commit: bdc512a7e5416fa30d9760f50cc949281d0e71a1
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bdc512a…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed May 26 15:53:33 2010 +0200
tls: added tls_info rpc
The tls_info rpc should print various internal tls informations
and statistics. For now it prints the overall amount of write-queued
clear text.
---
modules/tls/tls_rpc.c | 26 +++++++++++++++++++++-----
modules/tls/tls_rpc.h | 14 ++++----------
2 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/modules/tls/tls_rpc.c b/modules/tls/tls_rpc.c
index 542500d..8351439 100644
--- a/modules/tls/tls_rpc.c
+++ b/modules/tls/tls_rpc.c
@@ -23,11 +23,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/*!
- * \file
- * \brief SIP-router TLS support :: management interface
- * \ingroup tls
- * Module: \ref tls
+/** tls module management interface (rpc).
+ * @file tls_rpc.c
+ * @ingroup tls
+ * Module: @ref tls
*/
@@ -40,6 +39,7 @@
#include "tls_config.h"
#include "tls_util.h"
#include "tls_server.h"
+#include "tls_ct_wrq.h"
#include "tls_rpc.h"
static const char* tls_reload_doc[2] = {
@@ -140,8 +140,24 @@ static void tls_list(rpc_t* rpc, void* c)
+static const char* tls_info_doc[2] = {
+ "Returns internal tls related info.",
+ 0 };
+
+static void tls_info(rpc_t* rpc, void* c)
+{
+ void* handle;
+ rpc->add(c, "{", &handle);
+ rpc->struct_add(handle, "d",
+ "clear_text_write_queued_bytes", tls_ct_wq_total_bytes());
+}
+
+
+
+
rpc_export_t tls_rpc[] = {
{"tls.reload", tls_reload, tls_reload_doc, 0},
{"tls.list", tls_list, tls_list_doc, RET_ARRAY},
+ {"tls.info", tls_info, tls_info_doc, 0},
{0, 0, 0, 0}
};
diff --git a/modules/tls/tls_rpc.h b/modules/tls/tls_rpc.h
index d7154f2..b292de1 100644
--- a/modules/tls/tls_rpc.h
+++ b/modules/tls/tls_rpc.h
@@ -14,11 +14,6 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version
*
- * For a license to use the sip-router software under conditions
- * other than those described here, or to purchase support for this
- * software, please contact iptel.org by e-mail at the following addresses:
- * info(a)iptel.org
- *
* sip-router is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -28,11 +23,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/*!
- * \file
- * \brief SIP-router TLS support :: Management interface
- * \ingroup tls
- * Module: \ref tls
+/** tls module management interface (rpc).
+ * @file tls_rpc.h
+ * @ingroup tls
+ * Module: @ref tls
*/
#ifndef _TLS_RPC_H
Module: sip-router
Branch: andrei/tcp_tls_changes
Commit: 4f247030923dbb8e433441a66c557d9438316ddc
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4f24703…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Thu May 27 20:00:00 2010 +0200
tls: doc - removed handshake_timeout and send_timeout
---
modules/tls/README | 26 +++++++++++---------------
modules/tls/doc/params.xml | 23 ++++++++++++-----------
2 files changed, 23 insertions(+), 26 deletions(-)
diff --git a/modules/tls/README b/modules/tls/README
index e2b0866..1532c9f 100644
--- a/modules/tls/README
+++ b/modules/tls/README
@@ -397,36 +397,32 @@ modparam("tls", "cipher_list", "HIGH")
1.8.9. send_timeout (int)
- Sets the maximum interval of time after which SIP-router will give up
- trying to send a message over TLS (time after a TLS send will be
- aborted and the corresponding TLS connection closed). The value is in
- seconds.
-
- The default value is 120 s.
+ This parameter is obsolete and cannot be used in newer TLS versions (>
+ sip-router 3.0). In these versions the send_timeout is replaced by
+ tcp_send_timeout (common with all the tcp connections).
Example 10. Set send_timeout parameter
...
-modparam("tls", "send_timeout", 1)
+tls_send_timeout = 10
...
1.8.10. handshake_timeout (int)
- Sets the maximum interval of time after which SIP-router will give up
- trying to accept a TLS connection or connect to a TLS peer. The value
- is in seconds.
-
- The default value is 120 s.
+ This parameter is obsolete and cannot be used in newer TLS versions (>
+ sip-router 3.0). In these versions the handshake_timeout is replaced by
+ tcp_connect_timeout (common with all the tcp connections).
Example 11. Set handshake_timeout parameter
...
-modparam("tls", "handshake_timeout", 1)
+tcp_connect_timeout = 60
...
1.8.11. connection_timeout (int)
Sets the amount of time after which an idle TLS connection will be
- closed. This is similar to tcp_connection_lifetime. The value is
- expressed in seconds.
+ closed, if no I/O ever occured after the initial open. If an I/O event
+ occurs, the timeout will be extended with tcp_connection_lifetime. The
+ value is expressed in seconds.
The default value is 10 min.
diff --git a/modules/tls/doc/params.xml b/modules/tls/doc/params.xml
index b898dc5..a489243 100644
--- a/modules/tls/doc/params.xml
+++ b/modules/tls/doc/params.xml
@@ -201,16 +201,15 @@ modparam("tls", "cipher_list", "HIGH")
<section id="send_timeout">
<title><varname>send_timeout</varname> (int)</title>
<para>
- Sets the maximum interval of time after which SIP-router will give up trying to send a message over TLS (time after a TLS send will be aborted and the corresponding TLS connection closed). The value is in seconds.
- </para>
- <para>
- The default value is 120 s.
+ This parameter is obsolete and cannot be used in newer TLS versions
+ (> sip-router 3.0). In these versions the send_timeout is
+ replaced by tcp_send_timeout (common with all the tcp connections).
</para>
<example>
<title>Set <varname>send_timeout</varname> parameter</title>
<programlisting>
...
-modparam("tls", "send_timeout", 1)
+tls_send_timeout = 10
...
</programlisting>
</example>
@@ -219,16 +218,15 @@ modparam("tls", "send_timeout", 1)
<section id="handshake_timeout">
<title><varname>handshake_timeout</varname> (int)</title>
<para>
- Sets the maximum interval of time after which SIP-router will give up trying to accept a TLS connection or connect to a TLS peer. The value is in seconds.
- </para>
- <para>
- The default value is 120 s.
+ This parameter is obsolete and cannot be used in newer TLS versions
+ (> sip-router 3.0). In these versions the handshake_timeout is
+ replaced by tcp_connect_timeout (common with all the tcp connections).
</para>
<example>
<title>Set <varname>handshake_timeout</varname> parameter</title>
<programlisting>
...
-modparam("tls", "handshake_timeout", 1)
+tcp_connect_timeout = 60
...
</programlisting>
</example>
@@ -237,7 +235,10 @@ modparam("tls", "handshake_timeout", 1)
<section id="connection_timeout">
<title><varname>connection_timeout</varname> (int)</title>
<para>
- Sets the amount of time after which an idle TLS connection will be closed. This is similar to tcp_connection_lifetime. The value is expressed in seconds.
+ Sets the amount of time after which an idle TLS connection will be
+ closed, if no I/O ever occured after the initial open. If an I/O event
+ occurs, the timeout will be extended with tcp_connection_lifetime.
+ The value is expressed in seconds.
</para>
<para>
The default value is 10 min.