Module: sip-router
Branch: master
Commit: c9448d9657f0e5792072c6803643c8d9075d711a
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c9448d9…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Mon May 20 18:33:52 2013 +0100
modules/rr: completely reverted after_strict() to its pre-outbound form
---
modules/rr/loose.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/modules/rr/loose.c b/modules/rr/loose.c
index c1b669c..bf0080e 100644
--- a/modules/rr/loose.c
+++ b/modules/rr/loose.c
@@ -578,7 +578,6 @@ static inline int after_strict(struct sip_msg* _m)
char* rem_off;
str uri;
struct socket_info *si;
- int next_is_strict;
hdr = _m->route;
rt = (rr_t*)hdr->parsed;
@@ -594,12 +593,9 @@ static inline int after_strict(struct sip_msg* _m)
return RR_ERROR;
}
- next_is_strict = is_strict(&puri.params);
-
- if (enable_double_rr && is_2rr(&puri.params) && is_myself(&puri)) {
+ if ( enable_double_rr && is_2rr(&puri.params) && is_myself(&puri)) {
/* double route may occure due different IP and port, so force as
* send interface the one advertise in second Route */
-
si = grep_sock_info( &puri.host, puri.port_no, puri.proto);
if (si) {
set_force_socket(_m, si);
@@ -634,8 +630,7 @@ static inline int after_strict(struct sip_msg* _m)
LM_ERR("failed to parse URI\n");
return RR_ERROR;
}
- next_is_strict = is_strict(&puri.params);
- }
+ }
/* set the hooks for the param
* important note: RURI is already parsed by the above function, so
@@ -643,7 +638,7 @@ static inline int after_strict(struct sip_msg* _m)
routed_msg_id = _m->id;
routed_params = _m->parsed_uri.params;
- if (next_is_strict) {
+ if (is_strict(&puri.params)) {
LM_DBG("Next hop: '%.*s' is strict router\n", uri.len, ZSW(uri.s));
/* Previous hop was a strict router and the next hop is strict
* router too. There is no need to save R-URI again because it
@@ -707,7 +702,7 @@ static inline int after_strict(struct sip_msg* _m)
if (res < 0) {
LM_ERR("searching for last Route URI failed\n");
return RR_ERROR;
- } else if (res > 0) {
+ } else if (res > 0) {
/* No remote target is an error */
return RR_ERROR;
}
@@ -731,7 +726,7 @@ static inline int after_strict(struct sip_msg* _m)
if (prev) {
rem_off = prev->nameaddr.name.s + prev->len;
rem_len = rt->nameaddr.name.s + rt->len - rem_off;
- } else {
+ } else {
rem_off = hdr->name.s;
rem_len = hdr->len;
}
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#296 - tm:branch-failure event_route is not executed on all branch failures
User who did this - Juha Heinanen (jh)
----------
i don't use append_branch and i don't have corex module in my config and thus cannot test with it. i tested a simpler case, where only $ru and $du are set similar to this:
request_route {
xlog("===== main route block\n");
$ru = "sip:foo@bar.com";
$du = "sip:127.0.0.1:9;transport=tcp";
t_on_failure("x");
t_on_branch_failure("x");
set_forward_no_connect();
t_relay();
$var(rc) = $rc;
xlog("===== t relay return code: $rc\n");
exit;
}
and got:
May 20 19:21:56 siika /usr/sbin/sip-proxy[20734]: INFO: activating failure and branch failure routes
May 20 19:21:56 siika /usr/sbin/sip-proxy[20734]: ERROR: <core> [tcp_main.c:2781]: tcpconn_1st_send(): connect 127.0.0.1:9 failed (RST) Connection refused
May 20 19:21:56 siika /usr/sbin/sip-proxy[20734]: ERROR: <core> [tcp_main.c:2791]: tcpconn_1st_send(): 127.0.0.1:9: connect & send for 0x7ff2f7b63030 failed: Connection refused (111)
May 20 19:21:56 siika /usr/sbin/sip-proxy[20734]: ERROR: tm [../../forward.h:216]: msg_send(): msg_send: ERROR: tcp_send failed
May 20 19:21:56 siika /usr/sbin/sip-proxy[20734]: ERROR: tm [t_fwd.c:1592]: t_send_branch(): ERROR: t_send_branch: sending request on branch 0 failed
May 20 19:21:56 siika /usr/sbin/sip-proxy[20734]: ERROR: tm [t_fwd.c:1595]: t_send_branch(): putting branch 0 on hold
May 20 19:21:56 siika /usr/sbin/sip-proxy[20734]: INFO: t_relay() failed
can you test with the above simpler config and see what you get?
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=296#comment881
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.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#296 - tm:branch-failure event_route is not executed on all branch failures
User who did this - Daniel-Constantin Mierla (miconda)
----------
I tested again - t_relay() returns 1. I have two invalid branches -- here is my config:
<code>
request_route {
xlog("===== main route block\n");
t_on_failure("x");
t_on_branch_failure("x");
set_forward_no_connect();
# t_relay_to("tcp:127.0.0.1:9");
$du = "sip:127.0.0.1:9;transport=tcp";
append_branch();
$du = "sip:127.0.0.1:10;transport=tcp";
t_relay();
$var(rc) = $rc;
xlog("===== t relay return code: $rc\n");
exit;
}
failure_route[x] {
xlog("==== failure route block\n");
exit;
}
event_route[tm:branch-failure:x] {
xlog("==== branch failure route block\n");
}
</code>
And the logs I get:
1(72046) ERROR: tm [../../forward.h:216]: msg_send(): msg_send: ERROR: tcp_send failed
1(72046) DEBUG: tm [t_fwd.c:1573]: t_send_branch(): t_send_branch: send to 127.0.0.1:10 (2) failed
1(72046) ERROR: tm [t_fwd.c:1592]: t_send_branch(): ERROR: t_send_branch: sending request on branch 0 failed
1(72046) ERROR: tm [t_fwd.c:1595]: t_send_branch(): putting branch 0 on hold
1(72046) ERROR: tm [../../forward.h:216]: msg_send(): msg_send: ERROR: tcp_send failed
1(72046) DEBUG: tm [t_fwd.c:1573]: t_send_branch(): t_send_branch: send to 127.0.0.1:9 (2) failed
1(72046) ERROR: tm [t_fwd.c:1592]: t_send_branch(): ERROR: t_send_branch: sending request on branch 1 failed
1(72046) ERROR: tm [t_fwd.c:1595]: t_send_branch(): putting branch 1 on hold
1(72046) DEBUG: tm [t_funcs.c:384]: t_relay_to(): SER: new transaction fwd'ed
1(72046) ERROR: <script>: ===== t relay return code: 1
1(72046) DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list 0x0
1(72046) DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list 0x0
1(72046) DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list 0x0
1(72046) DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list 0x0
1(72046) DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list 0x0
1(72046) DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list 0x0
1(72046) DEBUG: <core> [xavp.c:448]: xavp_destroy_list(): destroying xavp list 0x0
1(72046) DEBUG: <core> [receive.c:293]: receive_msg(): receive_msg: cleaning up
...
3(72048) DEBUG: tm [t_reply.c:1289]: t_should_relay_response(): ->>>>>>>>> T_code=100, new_code=408
3(72048) DEBUG: tm [t_reply.c:1806]: relay_reply(): DEBUG: relay_reply: branch=0, save=1, relay=-1 icode=908
3(72048) DEBUG: tm [t_reply.c:1289]: t_should_relay_response(): ->>>>>>>>> T_code=100, new_code=408
3(72048) ERROR: <script>: ==== failure route block
3(72048) DEBUG: tm [t_reply.c:1806]: relay_reply(): DEBUG: relay_reply: branch=1, save=0, relay=0 icode=908
3(72048) DEBUG: <core> [msg_translator.c:204]: check_via_address(): check_via_address(127.0.0.1, 192.168.178.8, 0)
----------
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=296#comment880
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.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#296 - tm:branch-failure event_route is not executed on all branch failures
User who did this - Juha Heinanen (jh)
----------
i added xlog info after t_relay() and got:
May 20 09:08:02 siika /usr/sbin/sip-proxy[15173]: INFO: activating contact_failure failure route
May 20 09:08:02 siika /usr/sbin/sip-proxy[15173]: INFO: activating contact branch_failure route
May 20 09:08:02 siika /usr/sbin/sip-proxy[15173]: INFO: Routing INVITE <sip:jh@192.98.102.10:5044;transport=tcp> to contact via <sip:192.98.102.10:43560;transport=TCP>
May 20 09:08:02 siika /usr/sbin/sip-proxy[15173]: ERROR: tm [../../forward.h:216]: msg_send(): msg_send: ERROR: tcp_send failed
May 20 09:08:02 siika /usr/sbin/sip-proxy[15173]: ERROR: tm [t_fwd.c:1592]: t_send_branch(): ERROR: t_send_branch: sending request on branch 0 failed
May 20 09:08:02 siika /usr/sbin/sip-proxy[15173]: ERROR: tm [t_fwd.c:1595]: t_send_branch(): putting branch 0 on hold
May 20 09:08:02 siika /usr/sbin/sip-proxy[15173]: INFO: t_relay() failed
that explains why 408 comes immediately, because i send it from script if t_relay() fails and there are no more contacts left.
what i understood from this commit. t_relay() should not anymore fail if failure and branch failure routes are set when tcp destination is dead, but it does.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=296#comment879
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.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#296 - tm:branch-failure event_route is not executed on all branch failures
User who did this - Juha Heinanen (jh)
----------
i re-build kamailio from latest master and still in my test branch and normal failure route is not executed by t_relay() to dead tcp destination. i get
May 20 08:05:21 siika /usr/sbin/sip-proxy[14415]: INFO: activating contact_failure failure route
May 20 08:05:21 siika /usr/sbin/sip-proxy[14415]: INFO: activating contact branch_failure route
May 20 08:05:21 siika /usr/sbin/sip-proxy[14415]: INFO: Routing INVITE <sip:jh@192.98.102.10:5044;transport=tcp> to contact via <sip:192.98.102.10:43368;transport=TCP>
May 20 08:05:21 siika /usr/sbin/sip-proxy[14415]: ERROR: tm [../../forward.h:216]: msg_send(): msg_send: ERROR: tcp_send failed
May 20 08:05:21 siika /usr/sbin/sip-proxy[14415]: ERROR: tm [t_fwd.c:1592]: t_send_branch(): ERROR: t_send_branch: sending request on branch 0 failed
May 20 08:05:21 siika /usr/sbin/sip-proxy[14415]: ERROR: tm [t_fwd.c:1595]: t_send_branch(): putting branch 0 on hold
the branch is put on hold, but never released from there. using the same config and same destination that registered over udp and then died, both branch and normal failure routes do get executed after fr_timer fires. in tcp case, calling party gets 408 immediately, i.e., kamailio does not wait for fr_timer to fire.
i don't know what the difference could be. i call t_on_failure(), t_on_branch() and "if (t_relay()) exit;" in route block and t_on_branch_failure() in branch route block.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=296#comment878
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: master
Commit: f0ae598a3e63e62d12a143c6cd42b698ad1f2eed
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f0ae598…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Sun May 19 23:56:06 2013 +0100
modules/websocket: Improved module_loaded() check for nathelper and outbound so it only fires when the SIP subprotocol is enabled
---
modules/websocket/ws_mod.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/modules/websocket/ws_mod.c b/modules/websocket/ws_mod.c
index ea1e23a..ec5e07c 100644
--- a/modules/websocket/ws_mod.c
+++ b/modules/websocket/ws_mod.c
@@ -278,7 +278,9 @@ static int mod_init(void)
return -1;
}
- if (!module_loaded("nathelper") && !module_loaded("outbound"))
+ if (((ws_sub_protocols & SUB_PROTOCOL_SIP) == SUB_PROTOCOL_SIP)
+ && !module_loaded("nathelper")
+ && !module_loaded("outbound"))
{
LM_WARN("neither \"nathelper\" nor \"outbound\" modules are"
" loaded. At least one of these is required for correct"
Hello,
This occurs on code built from master as of last night (18 May).
#0 crcitt_string_array (dst=0x7fb402426e21 "", src=0x7fffc1b901f0,
size=<value optimized out>) at crc.c:239
#1 0x00007fb4021f5e45 in generate_fromtag (tag=0x7fffc1b901e0,
callid=<value optimized out>) at uac.c:142
#2 0x00007fb4021fb17e in request (uac_r=0x7fffc1b90290, ruri=0x7fb3fd6166e0,
to=0x7fb3fd6166e0, from=<value optimized out>, next_hop=0x7fb3ff822a80)
at uac.c:769
#3 0x00007fb3ff6042ce in ds_check_timer (ticks=<value optimized out>,
param=<value optimized out>) at dispatch.c:2430
#4 0x000000000053b437 in compat_old_handler (ti=<value optimized out>,
tl=<value optimized out>, data=<value optimized out>) at timer.c:1017
#5 0x000000000053d753 in slow_timer_main () at timer.c:1151
#6 0x000000000046b045 in main_loop () at main.c:1674
#7 0x000000000046cf0c in main (argc=<value optimized out>,
argv=<value optimized out>) at main.c:2547
Regards,
Peter
--
Peter Dunkley
Technical Director
Crocodile RCS Ltd
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#296 - tm:branch-failure event_route is not executed on all branch failures
User who did this - Daniel-Constantin Mierla (miconda)
----------
Commenting here because it's easier to follow the discussion. You said:
> i have xlog info statement in the beginning of both and neither was executed:
The failure route is executed by timer process after fr_timer. Here is what I get:
1(70905) DEBUG: tm [t_fwd.c:1573]: t_send_branch(): t_send_branch: send to 127.0.0.1:10 (2) failed
1(70905) ERROR: tm [t_fwd.c:1592]: t_send_branch(): ERROR: t_send_branch: sending request on branch 0 failed
1(70905) ERROR: tm [t_fwd.c:1595]: t_send_branch(): putting branch 0 on hold
...
3(70907) ERROR: <script>: ==== failure route block
3(70907) DEBUG: tm [t_reply.c:1806]: relay_reply(): DEBUG: relay_reply: branch=0, save=0, relay=0 icode=908
The log error realated to 'putting branch 0 on hold' is for debugging purposes, should be made info or dbg -- I added to see that the branch is put on timer.
----------
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=296#comment877
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.