[asterisk-commits] mmichelson: branch group/CCSS r240314 - /team/group/CCSS/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 14 18:06:59 CST 2010


Author: mmichelson
Date: Thu Jan 14 18:06:57 2010
New Revision: 240314

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=240314
Log:
Add a call to __sip_ack so that we stop retransmitting 401's once a PUBLISH is authenticated.


Modified:
    team/group/CCSS/channels/chan_sip.c

Modified: team/group/CCSS/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/chan_sip.c?view=diff&rev=240314&r1=240313&r2=240314
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Thu Jan 14 18:06:57 2010
@@ -24126,7 +24126,7 @@
 	return res;
 }
 
-static int handle_request_publish(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, const char *uri)
+static int handle_request_publish(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, const int seqno, const char *uri)
 {
 	const char *etag = get_header(req, "SIP-If-Match");
 	const char *event = get_header(req, "Event");
@@ -24149,6 +24149,7 @@
 
 	auth_result = check_user(p, req, SIP_PUBLISH, uri, XMIT_RELIABLE, sin);
 	if (auth_result == AUTH_CHALLENGE_SENT) {
+		p->lastinvite = seqno;
 		return 0;
 	} else if (auth_result < 0) {
 		if (auth_result == AUTH_FAKE_AUTH) {
@@ -24161,6 +24162,9 @@
 		sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
 		ast_string_field_set(p, theirtag, NULL);
 		return 0;
+	} else if (auth_result == AUTH_SUCCESSFUL && p->lastinvite) {
+		/* We need to stop retransmitting the 401 */
+		__sip_ack(p, p->lastinvite, 1, 0);
 	}
 
 	publish_type = determine_sip_publish_type(req, event, etag, expires_str, &expires_int);
@@ -24815,7 +24819,7 @@
 		res = handle_request_message(p, req);
 		break;
 	case SIP_PUBLISH:
-		res = handle_request_publish(p, req, sin, e);
+		res = handle_request_publish(p, req, sin, seqno, e);
 		break;
 	case SIP_SUBSCRIBE:
 		res = handle_request_subscribe(p, req, sin, seqno, e);




More information about the asterisk-commits mailing list