THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#264 - Sanity checks lets invalid RURI through
User who did this - Andrew Pogrebennyk (marduk)
----------
This is a script problem, as we do unescape after sanity check and after that the RURI becomes invalid.
I may post more suggestions once I know what can be improved here, but for now I'm closing this ticket.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=264#comment763
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: alexh/for4.0
Commit: 7fb865dc1e72d52b0c0fb58590ccb32cd4fb5620
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7fb865d…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: Thu Oct 11 18:43:07 2012 +0200
modules/rtpproxy: Add 'b' flag to add a branch specific string tot the call-id
In a forking call, sometimes it is needed that each branch uses different
options to the rtpproxy. This patch adds a parameter that makes each
rtpproxy session unique to a branch by appending the value of a PV to the
call-id rtpproxy parameter.
---
modules/rtpproxy/README | 123 +++++++++++++++++++------------
modules/rtpproxy/doc/rtpproxy_admin.xml | 37 +++++++++
modules/rtpproxy/rtpproxy.c | 56 ++++++++++++++-
3 files changed, 168 insertions(+), 48 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=7fb…
Module: sip-router
Branch: alexh/for4.0
Commit: b695cc4b6f0a3711edf05e4195fae60f4eeeb151
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b695cc4…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: Thu Oct 11 18:28:34 2012 +0200
modules/tm: Remember per-branch onreply_route and onfailure_route settings
The onreply and onfailure routes were set only per transaction. This means
that when the onreply and/or failure route is changed in failure route (serial
forking), late replies to earlier branches would use the new onreply and
failure route instead of the routes set for them.
This commit copies the transaction's onreply and failure routes to the branch,
so the route set when the request is sent out is always chosen, no matter
how late the reply arrives.
Because the per-branch setting is copied after running onbranch_route, it is
now also possible to set the routes per-branch instead of per-transaction.
---
modules/tm/h_table.h | 4 ++++
modules/tm/t_fwd.c | 6 +++++-
modules/tm/t_reply.c | 18 +++++++++---------
3 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/modules/tm/h_table.h b/modules/tm/h_table.h
index 8294001..f30bd45 100644
--- a/modules/tm/h_table.h
+++ b/modules/tm/h_table.h
@@ -247,6 +247,10 @@ typedef struct ua_client
*/
struct retr_buf *local_ack;
#endif
+ /* the route to take if no final positive reply arrived */
+ unsigned short on_failure;
+ /* the onreply_route to be processed if registered to do so */
+ unsigned short on_reply;
}ua_client_type;
diff --git a/modules/tm/t_fwd.c b/modules/tm/t_fwd.c
index 76fb451..9659f6f 100644
--- a/modules/tm/t_fwd.c
+++ b/modules/tm/t_fwd.c
@@ -416,7 +416,11 @@ static int prepare_new_uac( struct cell *t, struct sip_msg *i_req,
} /* else next_hop==0 =>
no dst_uri / empty dst_uri and initial next_hop==0 =>
dst is pre-filled with a valid dst => use the pre-filled dst */
-
+
+ /* Set on_reply and on_negative handlers for this branch to the handlers in the transaction */
+ t->uac[branch].on_reply = t->on_reply;
+ t->uac[branch].on_failure = t->on_failure;
+
/* check if send_sock is ok */
if (t->uac[branch].request.dst.send_sock==0) {
LOG(L_ERR, "ERROR: can't fwd to af %d, proto %d "
diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index 6fc7ee6..b79200b 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -986,19 +986,20 @@ int run_failure_handlers(struct cell *t, struct sip_msg *rpl,
struct sip_msg *shmem_msg = t->uas.request;
int on_failure;
+ on_failure = t->uac[picked_branch].on_failure;
+
/* failure_route for a local UAC? */
if (!shmem_msg) {
LOG(L_WARN,"Warning: run_failure_handlers: no UAC support (%d, %d) \n",
- t->on_failure, t->tmcb_hl.reg_types);
+ on_failure, t->tmcb_hl.reg_types);
return 0;
}
/* don't start faking anything if we don't have to */
- if (unlikely(!t->on_failure && !has_tran_tmcbs( t, TMCB_ON_FAILURE))) {
+ if (unlikely(!on_failure && !has_tran_tmcbs( t, TMCB_ON_FAILURE))) {
LOG(L_WARN,
- "Warning: run_failure_handlers: no negative handler (%d, %d)\n",
- t->on_failure,
- t->tmcb_hl.reg_types);
+ "Warning: run_failure_handlers: no failure handler (%d, %d)\n",
+ on_failure, t->tmcb_hl.reg_types);
return 1;
}
@@ -1013,11 +1014,10 @@ int run_failure_handlers(struct cell *t, struct sip_msg *rpl,
if (unlikely(has_tran_tmcbs( t, TMCB_ON_FAILURE)) ) {
run_trans_callbacks( TMCB_ON_FAILURE, t, &faked_req, rpl, code);
}
- if (t->on_failure) {
+ if (on_failure) {
/* avoid recursion -- if failure_route forwards, and does not
* set next failure route, failure_route will not be reentered
* on failure */
- on_failure = t->on_failure;
t->on_failure=0;
if (exec_pre_script_cb(&faked_req, FAILURE_CB_TYPE)>0) {
/* run a failure_route action if some was marked */
@@ -1290,7 +1290,7 @@ static enum rps t_should_relay_response( struct cell *Trans , int new_code,
replies_dropped = 0;
/* run ON_FAILURE handlers ( route and callbacks) */
if (unlikely(has_tran_tmcbs( Trans, TMCB_ON_FAILURE_RO|TMCB_ON_FAILURE)
- || Trans->on_failure )) {
+ || Trans->uac[picked_branch].on_failure )) {
extra_flags=
((Trans->uac[picked_branch].request.flags & F_RB_TIMEOUT)?
FL_TIMEOUT:0) |
@@ -2099,7 +2099,7 @@ int reply_received( struct sip_msg *p_msg )
goto done;
}
- onreply_route=t->on_reply;
+ onreply_route=uac->on_reply;
if ( msg_status >= 200 ){
#ifdef TM_ONREPLY_FINAL_DROP_OK
#warning Experimental tm onreply_route final reply DROP support active
Module: sip-router
Branch: alexh/for4.0
Commit: e7b058ae650e1c36f5daceef0c2c605100b88991
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e7b058a…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: Mon Aug 29 18:44:20 2011 +0200
modules/tm: add option to check callid when matching transactions
Use this if you don't want replies/requests from broken clients, which
send a mangled Call-ID, to match the transaction. For example when
the UAC won't recognise the response anyway because of changed
Call-ID, this setting will prevent accounting records to be created
or failure_route to be skipped.
---
modules/tm/README | 164 +++++++++++++++++++++++++-------------------
modules/tm/config.c | 3 +
modules/tm/config.h | 1 +
modules/tm/doc/params.xml | 32 +++++++++
modules/tm/t_lookup.c | 24 ++++++-
modules/tm/tm.c | 1 +
6 files changed, 150 insertions(+), 75 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=e7b…
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Andrew Pogrebennyk (marduk)
Attached to Project - sip-router
Summary - Sanity checks lets invalid RURI through
Task Type - Bug Report
Category - Module
Status - Unconfirmed
Assigned To -
Operating System - Linux
Severity - Low
Priority - Normal
Reported Version - 3.3
Due in Version - Undecided
Due Date - Undecided
Details - We are using message and URI checks in sanity module:
if(!sanity_check("1511", "7"))
{
xlog("L_WARN", "Malformed SIP message deteted - R=$ru ID=$ci\n");
sl_send_reply("483","Malformed SIP Message");
exit;
}
We've found that if the request comes in with broken RURI, the result of sanity check is still 1 which means passed:
Jan 8 12:31:26 sp2 /usr/sbin/kamailio[1121]: INFO: <script>: New request - M=INVITE R=sip:%3A03581313184:03581313184@192.168.51.16 F=sip:43991001@192.168.51.16 T=sip:%3A03581313184:03581313184@192.168.51.16 IP=192.168.51.1:39851 (127.0.0.1:5060) ID=vGo5pfQRI9hwaVUAhcc4gZcXgl5jIHDr
Jan 8 12:31:26 sp2 /usr/sbin/kamailio[1121]: DEBUG: maxfwd [mf_funcs.c:85]: value = 69
Jan 8 12:31:26 sp2 /usr/sbin/kamailio[1121]: DEBUG: sanity [mod_sanity.c:255]: sanity checks result: 1
Jan 8 12:31:26 sp2 /usr/sbin/kamailio[1121]: DEBUG: rr [loose.c:111]: No Route headers found
Jan 8 12:31:26 sp2 /usr/sbin/kamailio[1121]: DEBUG: rr [loose.c:835]: There is no Route HF
Jan 8 12:31:26 sp2 /usr/sbin/kamailio[1121]: DEBUG: <core> [strcommon.c:224]: unescaped string is <:03581313184>
Jan 8 12:31:26 sp2 /usr/sbin/kamailio[1121]: DEBUG: <core> [parser/parse_uri.c:1259]: parse_uri: bad char ':' in state 0 parsed: <sip:> (4) / <sip::03581313184:03581313184@192.168.51.16> (42)
Jan 8 12:31:26 sp2 /usr/sbin/kamailio[1121]: DEBUG: <core> [parser/parse_uri.c:1327]: ERROR: parse_sip_msg_uri: bad uri <sip::03581313184:03581313184@192.168.51.16>
Jan 8 12:31:26 sp2 /usr/sbin/kamailio[1121]: ERROR: pv [pv_core.c:300]: failed to parse the R-URI
Jan 7 15:39:24 sp2 /usr/sbin/kamailio[13257]: ERROR: <core> [lvalue.c:347]: non existing right pvar
Jan 7 15:39:24 sp2 /usr/sbin/kamailio[13257]: ERROR: <core> [action.c:777]: ERROR: do_action: bad uri <sip::03581313184:03581313184@192.168.51.16>, dropping packet
Jan 7 15:39:24 sp2 /usr/sbin/kamailio[13257]: ERROR: <core> [action.c:1525]: run action error at: :0
^^ Additionally the filename and line number in the above error message "run action error at .." is missing. Please check.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=264
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.