[asterisk-commits] oej: branch 1.6.2 r227156 - in /branches/1.6.2: ./ Makefile channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Nov 3 07:51:21 CST 2009
Author: oej
Date: Tue Nov 3 07:51:17 2009
New Revision: 227156
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=227156
Log:
Merged revisions 227091 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r227091 | oej | 2009-11-03 12:11:15 +0100 (Tis, 03 Nov 2009) | 15 lines
Merged revisions 227088 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r227088 | oej | 2009-11-03 11:29:59 +0100 (Tis, 03 Nov 2009) | 7 lines
Use proper response code when violating Contact ACL's.
https://reviewboard.asterisk.org/r/415/
Thanks kpfleming for a quick review.
(EDVX-003)
........
................
Modified:
branches/1.6.2/ (props changed)
branches/1.6.2/Makefile
branches/1.6.2/channels/chan_sip.c
Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.2/Makefile
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/Makefile?view=diff&rev=227156&r1=227155&r2=227156
==============================================================================
--- branches/1.6.2/Makefile (original)
+++ branches/1.6.2/Makefile Tue Nov 3 07:51:17 2009
@@ -305,7 +305,7 @@
ifneq ($(findstring darwin,$(OSARCH)),)
_ASTCFLAGS+=-D__Darwin__
- SOLINK=-dynamic -bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
+ SOLINK=-dynamic -bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace /usr/lib/bundle1.o
else
# These are used for all but Darwin
SOLINK=-shared
Modified: branches/1.6.2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_sip.c?view=diff&rev=227156&r1=227155&r2=227156
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Tue Nov 3 07:51:17 2009
@@ -631,6 +631,7 @@
/*! \brief Results from the parse_register() function */
enum parse_register_result {
+ PARSE_REGISTER_DENIED,
PARSE_REGISTER_FAILED,
PARSE_REGISTER_UPDATE,
PARSE_REGISTER_QUERY,
@@ -12154,10 +12155,10 @@
memcpy(&testsin.sin_addr, hp->h_addr, sizeof(testsin.sin_addr));
if (ast_apply_ha(global_contact_ha, &testsin) != AST_SENSE_ALLOW ||
ast_apply_ha(peer->contactha, &testsin) != AST_SENSE_ALLOW) {
- ast_log(LOG_WARNING, "Host '%s' disallowed by rule\n", host);
+ ast_log(LOG_WARNING, "Host '%s' disallowed by contact ACL (violating IP %s)\n", host, ast_inet_ntoa(testsin.sin_addr));
ast_string_field_set(peer, fullcontact, "");
ast_string_field_set(pvt, our_contact, "");
- return PARSE_REGISTER_FAILED;
+ return PARSE_REGISTER_DENIED;
}
/*! \todo This could come before the checking of DNS earlier on, to avoid
@@ -12837,6 +12838,12 @@
/* We have a successful registration attempt with proper authentication,
now, update the peer */
switch (parse_register_contact(p, peer, req)) {
+ case PARSE_REGISTER_DENIED:
+ ast_log(LOG_WARNING, "Registration denied because of contact ACL\n");
+ transmit_response_with_date(p, "603 Denied", req);
+ peer->lastmsgssent = -1;
+ res = 0;
+ break;
case PARSE_REGISTER_FAILED:
ast_log(LOG_WARNING, "Failed to parse contact info\n");
transmit_response_with_date(p, "400 Bad Request", req);
@@ -12876,6 +12883,12 @@
if (sip_cancel_destroy(p))
ast_log(LOG_WARNING, "Unable to cancel SIP destruction. Expect bad things.\n");
switch (parse_register_contact(p, peer, req)) {
+ case PARSE_REGISTER_DENIED:
+ ast_log(LOG_WARNING, "Registration denied because of contact ACL\n");
+ transmit_response_with_date(p, "403 Forbidden (ACL)", req);
+ peer->lastmsgssent = -1;
+ res = 0;
+ break;
case PARSE_REGISTER_FAILED:
ast_log(LOG_WARNING, "Failed to parse contact info\n");
transmit_response_with_date(p, "400 Bad Request", req);
More information about the asterisk-commits
mailing list