[Asterisk-cvs] asterisk/channels chan_iax2.c,1.349,1.350

markster markster
Sun Sep 25 15:16:56 CDT 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv14012/channels

Modified Files:
	chan_iax2.c 
Log Message:
Handle authenticating *to* realtime peers (bug #5269)


Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.349
retrieving revision 1.350
diff -u -d -r1.349 -r1.350
--- chan_iax2.c	15 Sep 2005 02:25:06 -0000	1.349
+++ chan_iax2.c	25 Sep 2005 19:13:54 -0000	1.350
@@ -5166,6 +5166,15 @@
 			peer = peer->next;
 		}
 		ast_mutex_unlock(&peerl.lock);
+		if (!peer) {
+			/* We checked our list and didn't find one.  It's unlikely, but possible, 
+			   that we're trying to authenticate *to* a realtime peer */
+			if ((peer = realtime_peer(p->peer))) {
+				res = authenticate(p->challenge, peer->secret,peer->outkey, authmethods, &ied, sin, &p->ecx, &p->dcx);
+				if (ast_test_flag(peer, IAX_TEMPONLY))
+					destroy_peer(peer);
+			}
+		}
 	}
 	if (ies->encmethods)
 		ast_set_flag(p, IAX_ENCRYPTED | IAX_KEYPOPULATED);




More information about the svn-commits mailing list