[asterisk-commits] branch oej/peermatch r10664 - /team/oej/peermatch/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Feb 21 12:34:04 MST 2006


Author: oej
Date: Tue Feb 21 13:34:02 2006
New Revision: 10664

URL: http://svn.digium.com/view/asterisk?rev=10664&view=rev
Log:
Adding peer match algorithm

Modified:
    team/oej/peermatch/channels/chan_sip.c

Modified: team/oej/peermatch/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/channels/chan_sip.c?rev=10664&r1=10663&r2=10664&view=diff
==============================================================================
--- team/oej/peermatch/channels/chan_sip.c (original)
+++ team/oej/peermatch/channels/chan_sip.c Tue Feb 21 13:34:02 2006
@@ -7215,16 +7215,17 @@
 	}
 
 	if (!user) {
-		/* If we didn't find a user match, check for peers */
-		if (sipmethod == SIP_SUBSCRIBE)
-			/* For subscribes, match on peer name only */
-			peer = find_peer(of, NULL, 1);
-		else
+		/* Secondly, match on peer name */
+		peer = find_peer(of, NULL, 1);
+
+		/* Thirdly match on IP/port */
+		if (!peer) {
 			/* Look for peer based on the IP address we received data from */
 			/* If peer is registered from this IP address or have this as a default
 			   IP address, this call is from the peer 
 			*/
 			peer = find_peer(NULL, &p->recv, 1);
+		}
 
 		if (peer) {
 			if (debug)



More information about the asterisk-commits mailing list