[Asterisk-cvs] asterisk/channels chan_sip.c,1.368,1.369

markster at lists.digium.com markster at lists.digium.com
Wed May 5 21:24:47 CDT 2004


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

Modified Files:
	chan_sip.c 
Log Message:
If user fails host access, search for peers too


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.368
retrieving revision 1.369
diff -u -d -r1.368 -r1.369
--- chan_sip.c	5 May 2004 01:56:03 -0000	1.368
+++ chan_sip.c	6 May 2004 01:33:24 -0000	1.369
@@ -4492,6 +4492,12 @@
 					p->noncodeccapability &= ~AST_RTP_DTMF;
 			}
 		}
+		if (user && sip_debug_test_addr(sin))
+			ast_verbose("Found user '%s'\n", user->name);
+	} else {
+		if (user && sip_debug_test_addr(sin))
+			ast_verbose("Found user '%s', but fails host access\n", user->name);
+		user = NULL;
 	}
 	ast_mutex_unlock(&userl.lock);
 	if (!user) {
@@ -4504,6 +4510,8 @@
 		/* peer = find_peer(NULL, sin); */
 		ast_mutex_unlock(&peerl.lock);
 		if (peer) {
+				if (sip_debug_test_addr(sin))
+					ast_verbose("Found peer '%s'\n", peer->name);
 				/* Take the peer */
 				p->nat = peer->nat;
 				if (p->rtp) {
@@ -4547,7 +4555,10 @@
 				}
 				free(peer);
 			}
-		}
+		} else
+			if (sip_debug_test_addr(sin))
+				ast_verbose("Found no matching peer or user for '%s:%d'\n", inet_ntoa(p->recv.sin_addr), ntohs(p->recv.sin_port));
+
 	}
 	return res;
 }




More information about the svn-commits mailing list