i have this kind of test in my config:
if (lookup_domain("$fd", "$ad")) {
$var(lcr_id) = $fd.lcr_id;
} else {
xlog("L_WARN", "Domain $ad of authorized user $aU is not local!\n");
send_reply("404", "Not found");
exit;
};
the problem is that when request that has header
Proxy-Authorization: Digest username="test(a)test.fi"
arrives, sr prints to syslog
Oct 28 20:01:09 localhost /usr/sbin/sip-proxy[7248]: WARNING: Domain of authorized user test is not local!
i.e., $ad does not have test.fi as its value.
according to wiki it should work:
Auth username domain
$ad - domain part of username from Authorization or Proxy-Authorization
header
so this looks like a bug to me.
-- juha
Module: sip-router
Branch: master
Commit: 8b9ccd17e24054d734c12be2c2ae79bc864bf59f
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8b9ccd1…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed Oct 28 16:41:39 2009 +0100
Merge remote branch 'origin/sr_3.0'
* origin/sr_3.0:
htable(k): fix non-init act. ctx in event route execution
tm: fix/support changing r-uris and path in branch routes
tm: support for changing dst_uri in branch routes
registrar: Fix handling of cases where contacts > max_contacts
domain: Do not report errors when domain cannot be extracted from URI.
parse_sip_msg_uri: Log broken URIs only when debugging is enabled.
modules/lcr: documentation improvement
sctp: count rejects sent to the remote peer (stats)
avp_db: Removes a spurious error message.
ctl: missing ifdef (minor)
event parser: Add missing string boundary checks to event_parser func.
tm: Number of fixes in code and documentation for serial forking.
Implements function reset_path_vector.
---
Module: sip-router
Branch: sr_3.0
Commit: 610cb930bee937c744468c6781aeed8b17b4b7d0
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=610cb93…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed Oct 28 15:50:45 2009 +0100
tm: fix/support changing r-uris and path in branch routes
- changing the r-uri in a branch route is now safe and the change
will propagate to branches created due to dns failover.
- changing path in a branch route is now allowed and it will
propagate to possible dns failover branches.
- optimize the no branch route & no callback case.
- build the branch buffer directly into shm mem.
- s/prepare_uac_request/prepare_new_uac/
- prepare_new_uac() takes care now also of setting the branch
retr. buffer, uri and path (functionality moved from add_uac())
---
modules/tm/t_fwd.c | 417 +++++++++++++++++++++++++++++++---------------------
1 files changed, 247 insertions(+), 170 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=610…
Module: sip-router
Branch: sr_3.0
Commit: 44f7bf621476b18e5df5e45161305a3bce22d498
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=44f7bf6…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed Oct 28 08:36:47 2009 +0100
tm: support for changing dst_uri in branch routes
- dst_uri can now be changed in branch routes, if the branch
route is not called during dns failover (which never happens,
but might be enabled in the future).
- dst_uri can now be checked in branch routes. The
dst_uri on branch route entry will be the branch next hop
(initial next hop and not the dns resolved one) if a
t_relay() based on uri was used, or empty if a destination was
forced (e.g. t_relay_to_udp(127.0.0.1, 9)).
- s/print_uac_request/prepare_uac_request to better reflect what
is actually doing
- prepare_uac_request() will now perform the DNS lookups and directly
update the branch dst inside the transaction.
- add_uac() must now be called with a special flag during DNS
failover (UAC_DNS_FAILOVER).
---
modules/tm/t_fwd.c | 176 ++++++++++++++++++++++++++++++++++++----------------
modules/tm/t_fwd.h | 2 +
2 files changed, 125 insertions(+), 53 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=44f…
Module: sip-router
Branch: sr_3.0
Commit: 027c5888fcefe56006d6e6cf60335a5c35a45037
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=027c588…
Author: Jan Janak <jan(a)ryngle.com>
Committer: Jan Janak <jan(a)ryngle.com>
Date: Mon Oct 26 14:15:53 2009 +0100
parse_sip_msg_uri: Log broken URIs only when debugging is enabled.
Logging broken Request-URIs with LOG(L_ERR) generates too much traffic
in syslog by default. Broken Request-URIs are beyond our control and
we should not generate an error message each time we receive and parse
one. We log them only when debugging is enabled.
---
parser/parse_uri.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/parser/parse_uri.c b/parser/parse_uri.c
index 5b29710..741258e 100644
--- a/parser/parse_uri.c
+++ b/parser/parse_uri.c
@@ -1397,8 +1397,8 @@ int parse_sip_msg_uri(struct sip_msg* msg)
tmp_len=msg->first_line.u.request.uri.len;
}
if (parse_uri(tmp, tmp_len, &msg->parsed_uri)<0){
- LOG(L_ERR, "ERROR: parse_sip_msg_uri: bad uri <%.*s>\n",
- tmp_len, tmp);
+ DBG("ERROR: parse_sip_msg_uri: bad uri <%.*s>\n",
+ tmp_len, tmp);
msg->parsed_uri_ok=0;
return -1;
}
Revision: 5950
http://openser.svn.sourceforge.net/openser/?rev=5950&view=rev
Author: henningw
Date: 2009-10-27 15:24:12 +0000 (Tue, 27 Oct 2009)
Log Message:
-----------
- documentation improvements in tm
- add missing explanation for TMCB_REQUEST_BUILT
- add some informations about the conditions where a callback
returns the complete parsed SIP message
- fix a bunch of typos
- patch from Timo Reimann, timo dot reimann at 1und1 dot de
Modified Paths:
--------------
branches/1.5/modules/tm/t_hooks.h
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Compiling sip-router from clean checkout generates a lot of different
warnings. What's the policy about this in the project? SHould we just
forget or should we react?
In Asterisk we have a configuration flag for ./configure that is
called "dev-mode" which forces warnings to generate an error and stop
make. This helps motivating developers to fix warnings :-)
/O
gcc -g -O9 -funroll-loops -Wcast-align -m64 -minline-all-stringops -
falign-loops -ftree-vectorize -fno-strict-overflow -mtune=opteron -
Wall -DNAME='"ser"' -DVERSION='"2.99.99-pre3"' -DARCH='"x86_64"' -
DOS='darwin_' -DOS_QUOTED='"darwin"' -DCOMPILER='"gcc 4.2.1"' -
D__CPU_x86_64 -D__OS_darwin -DSER_VER=2099099 -DCFG_DIR='"/usr/local/
etc/ser/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_IPV6 -
DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE
-DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DDBG_QM_MALLOC -
DUSE_TLS -DTLS_HOOKS -DFAST_LOCK -DADAPTIVE_WAIT -
DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_SOCKADDR_SA_LEN -
DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -
DHAVE_MSGHDR_MSG_CONTROL -DUSE_ANON_MMAP -DNDEBUG -
DHAVE_CONNECT_ECONNRESET_BUG -DHAVE_TIMEGM -DUSE_SIGWAIT -DHAVE_KQUEUE
-DHAVE_SELECT -c parser/sdp/sdp.c -o parser/sdp/sdp.o
parser/sdp/sdp.c: In function 'parse_sdp':
parser/sdp/sdp.c:707: warning: dereferencing type-punned pointer will
break strict-aliasing rules
parser/sdp/sdp.c:729: warning: dereferencing type-punned pointer will
break strict-aliasing rules
g
Module: sip-router
Branch: sr_3.0
Commit: 1bf989c36a9972389c033b87df0e88c04e56b9c3
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1bf989c…
Author: Jan Janak <jan(a)ryngle.com>
Committer: Jan Janak <jan(a)ryngle.com>
Date: Mon Oct 26 16:25:02 2009 +0100
registrar: Fix handling of cases where contacts > max_contacts
Registrar should not report an error to syslog if a user exceeds the
maximum number of allowed contacts per user. The registrar module sends
a reply back with a description of what happened so there is no reason
to write this to syslog, max_contacts > 0 is a configuration choice
rather than an error.
This patch also changes all affected functions in registrar module to
indicate that the maximum number of allowed contacts was exceeded by
returning a positive number, instead of a negative number to indicate
that an error occurred.
---
modules_s/registrar/save.c | 38 +++++++++++++++++++++-----------------
1 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/modules_s/registrar/save.c b/modules_s/registrar/save.c
index 27d134c..fee4548 100644
--- a/modules_s/registrar/save.c
+++ b/modules_s/registrar/save.c
@@ -257,10 +257,11 @@ static int create_rcv_uri(str** uri, struct sip_msg* m)
/*
- * Message contained some contacts, but record with same address
- * of record was not found so we have to create a new record
- * and insert all contacts from the message that have expires
- * > 0
+ * Message contained some contacts, but record with same address of record was
+ * not found so we have to create a new record and insert all contacts from
+ * the message that have expires > 0. The function returns a negative number
+ * on error, a positive number if the number of contacts would exceed
+ * max_contacts and 0 on success.
*/
static inline int insert(struct sip_msg* _m, str* aor, contact_t* _c, udomain_t* _d, str* _u, str *ua, str* aor_filter, int sid)
{
@@ -289,7 +290,7 @@ static inline int insert(struct sip_msg* _m, str* aor, contact_t* _c, udomain_t*
if (max_contacts && (num >= max_contacts)) {
rerrno = R_TOO_MANY;
ul.delete_urecord(_d, _u);
- return -1;
+ return 1;
}
num++;
@@ -394,7 +395,7 @@ static int test_max_contacts(struct sip_msg* _m, urecord_t* _r, contact_t* _c)
_c = get_next_contact(_c);
}
- DBG("test_max_contacts: %d contacts after commit\n", num);
+ DBG("test_max_contacts: %d contacts after commit, max_contacts=%d\n", num, max_contacts);
if (num > max_contacts) {
rerrno = R_TOO_MANY;
return 1;
@@ -414,6 +415,11 @@ static int test_max_contacts(struct sip_msg* _m, urecord_t* _r, contact_t* _c)
* > 0, update the contact
* 3) If contact in usrloc exists and expires
* == 0, delete contact
+ *
+ * The function returns a negative number on error, a positive number if
+ * max_contacts is set and the number of contacts after the change would
+ * exceed that maximum number of allowed contacts. On success the function
+ * returns 0.
*/
static inline int update(struct sip_msg* _m, urecord_t* _r, str* aor, contact_t* _c, str* _ua, str* aor_filter, int sid)
{
@@ -434,8 +440,12 @@ static inline int update(struct sip_msg* _m, urecord_t* _r, str* aor, contact_t*
if (max_contacts) {
ret = test_max_contacts(_m, _r, _c);
if (ret != 0) {
+ /* test_max_contacts returns a negative number on error and a
+ * positive number if the number of contacts after the update
+ * exceeds the configured max_contacts. In both cases we return
+ * here. */
build_contact(_r->contacts, aor_filter);
- return -1;
+ return ret;
}
}
@@ -607,24 +617,18 @@ static inline int contacts(struct sip_msg* _m, contact_t* _c, udomain_t* _d, str
}
if (res == 0) { /* Contacts found */
- if (update(_m, r, aor, _c, _ua, aor_filter, sid) < 0) {
+ if ((res = update(_m, r, aor, _c, _ua, aor_filter, sid) < 0)) {
LOG(L_ERR, "contacts(): Error while updating record\n");
- build_contact(r->contacts, aor_filter);
- ul.release_urecord(r);
- ul.unlock_udomain(_d);
- return -3;
}
build_contact(r->contacts, aor_filter);
ul.release_urecord(r);
} else {
- if (insert(_m, aor, _c, _d, _u, _ua, aor_filter, sid) < 0) {
+ if ((res = insert(_m, aor, _c, _d, _u, _ua, aor_filter, sid) < 0)) {
LOG(L_ERR, "contacts(): Error while inserting record\n");
- ul.unlock_udomain(_d);
- return -4;
}
}
ul.unlock_udomain(_d);
- return 0;
+ return res;
}
#define UA_DUMMY_STR "Unknown"
@@ -684,7 +688,7 @@ static inline int save_real(struct sip_msg* _m, udomain_t* _t, char* aor_filt, i
if (no_contacts(_t, &uid, &aor_filter) < 0) goto error;
}
} else {
- if (contacts(_m, c, _t, &uid, &ua, &aor_filter) < 0) goto error;
+ if (contacts(_m, c, _t, &uid, &ua, &aor_filter) != 0) goto error;
}
if (doreply) {
eu is asking operators to provide all kinds of statistics about their
telephone service.
one of the attributes is routing time of sip request, i.e., in/out delay
of sip requests.
in order to be able to do something like that, we could have a pseudo
variable that provides ms timestamp value or, perhaps better, a way to
zero a ms counter and then store its current value to a pseudo variable
in onsend_route. the problems seems to be that according to core
cookbook, it is not possible to set pseudo variables in onsend_route.
comments?
-- juha