[asterisk-commits] branch 1.2 r26760 - /branches/1.2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu May 11 01:52:47 MST 2006


Author: kpfleming
Date: Thu May 11 03:52:46 2006
New Revision: 26760

URL: http://svn.digium.com/view/asterisk?rev=26760&view=rev
Log:
ensure that we send a response to REGISTER requests that are successfully authenticated but contain invalid Contact URIs

Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?rev=26760&r1=26759&r2=26760&view=diff
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Thu May 11 03:52:46 2006
@@ -6415,6 +6415,9 @@
 				switch (parse_register_contact(p, peer, req)) {
 				case PARSE_REGISTER_FAILED:
 					ast_log(LOG_WARNING, "Failed to parse contact info\n");
+					transmit_response_with_date(p, "400 Bad Request", req);
+					peer->lastmsgssent = -1;
+					res = 0;
 					break;
 				case PARSE_REGISTER_QUERY:
 					transmit_response_with_date(p, "200 OK", req);
@@ -6437,11 +6440,13 @@
 		peer = temp_peer(name);
 		if (peer) {
 			ASTOBJ_CONTAINER_LINK(&peerl, peer);
-			peer->lastmsgssent = -1;
 			sip_cancel_destroy(p);
 			switch (parse_register_contact(p, peer, req)) {
 			case PARSE_REGISTER_FAILED:
 				ast_log(LOG_WARNING, "Failed to parse contact info\n");
+				transmit_response_with_date(p, "400 Bad Request", req);
+				peer->lastmsgssent = -1;
+				res = 0;
 				break;
 			case PARSE_REGISTER_QUERY:
 				transmit_response_with_date(p, "200 OK", req);



More information about the asterisk-commits mailing list