[asterisk-commits] oej: branch 1.6.1 r148472 - in /branches/1.6.1: ./ channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Oct 13 10:36:44 CDT 2008
Author: oej
Date: Mon Oct 13 10:36:44 2008
New Revision: 148472
URL: http://svn.digium.com/view/asterisk?view=rev&rev=148472
Log:
Merged revisions 148471 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r148471 | oej | 2008-10-13 17:32:55 +0200 (MÃ¥n, 13 Okt 2008) | 4 lines
Sending a 403 after a 200 is considered very bad.
(found at SIPit)
........
Modified:
branches/1.6.1/ (props changed)
branches/1.6.1/channels/chan_sip.c
Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.1/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.1/channels/chan_sip.c?view=diff&rev=148472&r1=148471&r2=148472
==============================================================================
--- branches/1.6.1/channels/chan_sip.c (original)
+++ branches/1.6.1/channels/chan_sip.c Mon Oct 13 10:36:44 2008
@@ -10904,35 +10904,37 @@
if (sip_cancel_destroy(p))
ast_log(LOG_WARNING, "Unable to cancel SIP destruction. Expect bad things.\n");
- /* We have a successful registration attempt with proper authentication,
- now, update the peer */
- 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);
- peer->lastmsgssent = -1;
- res = 0;
- break;
- case PARSE_REGISTER_UPDATE:
- update_peer(peer, p->expiry);
- /* Say OK and ask subsystem to retransmit msg counter */
- transmit_response_with_date(p, "200 OK", req);
- if (!ast_test_flag((&peer->flags[1]), SIP_PAGE2_SUBSCRIBEMWIONLY))
- peer->lastmsgssent = -1;
- res = 0;
- break;
- }
-
if (check_request_transport(peer, req)) {
ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
transmit_response_with_date(p, "403 Forbidden", req);
res = AUTH_BAD_TRANSPORT;
+ } else {
+
+ /* We have a successful registration attempt with proper authentication,
+ now, update the peer */
+ 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);
+ peer->lastmsgssent = -1;
+ res = 0;
+ break;
+ case PARSE_REGISTER_UPDATE:
+ update_peer(peer, p->expiry);
+ /* Say OK and ask subsystem to retransmit msg counter */
+ transmit_response_with_date(p, "200 OK", req);
+ if (!ast_test_flag((&peer->flags[1]), SIP_PAGE2_SUBSCRIBEMWIONLY))
+ peer->lastmsgssent = -1;
+ res = 0;
+ break;
+ }
}
+
}
}
}
More information about the asterisk-commits
mailing list