Module: sip-router
Branch: 3.1
Commit: b4fae8b9eee6d893aa2591bcc9039ea53a142161
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b4fae8b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Sep 14 11:19:56 2011 +0200
rr(k): execute callbacks only for local route uri
- parameters callback are executed only if there is a list with
parameters in Route URI and for loose routing the URI has to match
myself condition
- should fix bogus value of Route URI params in callback function when
URI of top Route is not myself
- reported by Andreas Granig
(cherry picked from commit 10eac9b125ff2a13a2ae240897a3f17bc1243c71)
---
modules_k/rr/loose.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/modules_k/rr/loose.c b/modules_k/rr/loose.c
index a6d7e44..5c8b244 100644
--- a/modules_k/rr/loose.c
+++ b/modules_k/rr/loose.c
@@ -581,6 +581,11 @@ static inline int after_strict(struct sip_msg* _m)
rt = (rr_t*)hdr->parsed;
uri = rt->nameaddr.uri;
+ /* reset rr handling static vars for safety in error case */
+ routed_msg_id = 0;
+ routed_params.s = NULL;
+ routed_params.len = 0;
+
if (parse_uri(uri.s, uri.len, &puri) < 0) {
LM_ERR("failed to parse the first route URI\n");
return RR_ERROR;
@@ -734,8 +739,9 @@ static inline int after_strict(struct sip_msg* _m)
}
}
- /* run RR callbacks */
- run_rr_callbacks( _m, &routed_params );
+ /* run RR callbacks only if we have Route URI parameters */
+ if(routed_params.len > 0)
+ run_rr_callbacks( _m, &routed_params );
return RR_DRIVEN;
}
@@ -764,6 +770,11 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
rt = (rr_t*)hdr->parsed;
uri = rt->nameaddr.uri;
+ /* reset rr handling static vars for safety in error case */
+ routed_msg_id = 0;
+ routed_params.s = NULL;
+ routed_params.len = 0;
+
if (parse_uri(uri.s, uri.len, &puri) < 0) {
LM_ERR("failed to parse the first route URI\n");
return RR_ERROR;
@@ -889,8 +900,9 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
status = RR_DRIVEN;
done:
- /* run RR callbacks */
- run_rr_callbacks( _m, &routed_params );
+ /* run RR callbacks only if we have Route URI parameters */
+ if(routed_params.len > 0)
+ run_rr_callbacks( _m, &routed_params );
return status;
}
Module: sip-router
Branch: master
Commit: 10eac9b125ff2a13a2ae240897a3f17bc1243c71
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=10eac9b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Sep 14 11:19:56 2011 +0200
rr(k): execute callbacks only for local route uri
- parameters callback are executed only if there is a list with
parameters in Route URI and for loose routing the URI has to match
myself condition
- should fix bogus value of Route URI params in callback function when
URI of top Route is not myself
- reported by Andreas Granig
---
modules_k/rr/loose.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/modules_k/rr/loose.c b/modules_k/rr/loose.c
index 53a52d6..7d2c0e2 100644
--- a/modules_k/rr/loose.c
+++ b/modules_k/rr/loose.c
@@ -497,6 +497,11 @@ static inline int after_strict(struct sip_msg* _m)
rt = (rr_t*)hdr->parsed;
uri = rt->nameaddr.uri;
+ /* reset rr handling static vars for safety in error case */
+ routed_msg_id = 0;
+ routed_params.s = NULL;
+ routed_params.len = 0;
+
if (parse_uri(uri.s, uri.len, &puri) < 0) {
LM_ERR("failed to parse the first route URI\n");
return RR_ERROR;
@@ -651,8 +656,9 @@ static inline int after_strict(struct sip_msg* _m)
}
}
- /* run RR callbacks */
- run_rr_callbacks( _m, &routed_params );
+ /* run RR callbacks only if we have Route URI parameters */
+ if(routed_params.len > 0)
+ run_rr_callbacks( _m, &routed_params );
return RR_DRIVEN;
}
@@ -681,6 +687,11 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
rt = (rr_t*)hdr->parsed;
uri = rt->nameaddr.uri;
+ /* reset rr handling static vars for safety in error case */
+ routed_msg_id = 0;
+ routed_params.s = NULL;
+ routed_params.len = 0;
+
if (parse_uri(uri.s, uri.len, &puri) < 0) {
LM_ERR("failed to parse the first route URI\n");
return RR_ERROR;
@@ -807,8 +818,9 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
status = RR_DRIVEN;
done:
- /* run RR callbacks */
- run_rr_callbacks( _m, &routed_params );
+ /* run RR callbacks only if we have Route URI parameters */
+ if(routed_params.len > 0)
+ run_rr_callbacks( _m, &routed_params );
return status;
}
Hi all
The nightly builds of 3.1 branch failed tonight. Here's the log:
make[1]: se ingresa al directorio `/usr/src/kamailio/kamailiogitsrc-3.1'
CC (gcc) [M peering.so] peering.o
CC (gcc) [M peering.so] verify.o
make[3]: `libkcore.so.1.0' está actualizado.
LD (gcc) [M peering.so] peering.so
CC (gcc) [M acc_radius.so] acc_radius.o
LD (gcc) [M acc_radius.so] acc_radius.so
CC (gcc) [M auth_radius.so] authorize.o
authorize.c: In function ‘authenticate’:
authorize.c:176: error: ‘NONCE_REUSED’ undeclared (first use in this function)
authorize.c:176: error: (Each undeclared identifier is reported only once
authorize.c:176: error: for each function it appears in.)
authorize.c:178: error: ‘AUTH_NONCE_REUSED’ undeclared (first use in this
function)
authorize.c:180: error: ‘STALE_NONCE’ undeclared (first use in this
function)
authorize.c:182: error: ‘AUTH_STALE_NONCE’ undeclared (first use in
this function)
authorize.c:184: error: ‘NO_CREDENTIALS’ undeclared (first use
in this function)
authorize.c:186: error: ‘AUTH_NO_CREDENTIALS’ undeclared
(first use in this function)
make[2]: *** [authorize.o] Error 1
make[1]: *** [modules_s] Error 1
make[1]: se sale del directorio `/usr/src/kamailio/kamailiogitsrc-3.1'
make: *** [build-stamp] Error 2
dpkg-buildpackage: fallo: debian/rules build devolvió un estado de salida de
error 2
Hi, sip-router Via parser is not RFC compliant as it does not accept
any token in the transport (even if this does NOT occur in the top
Via). A real example: kamailio receives a REGISTER like this (removing
other headers):
REGISTER sip:domain,org SIP/2.0
Via: SIP/2.0/UDP 1.2.3.4:9090;branch=z9hG4bK3afb3d8e9ea4c4259f9d;rport
Via: SIP/2.0/WS 1.2.3.4:36638;branch=z9hG4bK5089;received=9.9.9.9;rport=36638
And it fails parsing so also processing the request:
ERROR: <core> [parser/parse_via.c:1677]: ERROR: parse_via: bad char
<W> on state 122
ERROR: <core> [parser/parse_via.c:2366]: ERROR: parse_via on:
<SIP/2.0/UDP 1.2.3.4:9090;branch=z9hG4bK3afb3d8e9ea4c4259f9d;rport
[...]>
ERROR: <core> [parser/parse_via.c:2370]: ERROR: parse_via parse error,
parsed so far:<SIP/2.0/>
ERROR: <core> [parser/msg_parser.c:139]: ERROR: get_hdr_field: bad via
INFO: <core> [parser/msg_parser.c:353]: ERROR: bad header field [Via:
SIP/2.0/WS 1.2.]
Please, make it possible for the Via transport to contain an unknown
token, at least when it does NOT occur in the top Via header. Why
should Kamailio care about the second Via transport field?
I strongly need it as, obviously I'm involved in SIP over an unknown
transport (yet), and this is a show-stopper.
Thanks a lot.
--
Iñaki Baz Castillo
<ibc(a)aliax.net>
Hello,
Any ideas why:
marius@marius:~/dev/sip-router$ git pull --rebase
ssh: connect to host git.sip-router.org port 22: Connection timed out
fatal: The remote end hung up unexpectedly
marius@marius:~/dev/sip-router$ ping git.sip-router.org
PING git.sip-router.org (78.46.218.34) 56(84) bytes of data.
^C
--- git.sip-router.org ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3025ms
Seems the host is down :(
Marius
--
Zbihlei Marius
Head of
Linux Development Services Romania
1&1 Internet Development srl Tel KA: 754-9512
Str Mircea Eliade 18 Tel RO: +40-31-223-9512
Sect 1, Bucuresti mailto: marius.zbihlei(a)1and1.ro
71295, Romania