[svn-commits] russell: branch russell/iax2-another-fix-to-the-fix r118947 - /team/russell/i...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu May 29 11:13:29 CDT 2008


Author: russell
Date: Thu May 29 11:13:28 2008
New Revision: 118947

URL: http://svn.digium.com/view/asterisk?view=rev&rev=118947
Log:
Redefine an argument to match() and find_callno() as whether or not we are forcing
a check on the destination call number or not, instead of whether we're matching for
a full frame or not

Modified:
    team/russell/iax2-another-fix-to-the-fix/channels/chan_iax2.c

Modified: team/russell/iax2-another-fix-to-the-fix/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/russell/iax2-another-fix-to-the-fix/channels/chan_iax2.c?view=diff&rev=118947&r1=118946&r2=118947
==============================================================================
--- team/russell/iax2-another-fix-to-the-fix/channels/chan_iax2.c (original)
+++ team/russell/iax2-another-fix-to-the-fix/channels/chan_iax2.c Thu May 29 11:13:28 2008
@@ -1149,13 +1149,13 @@
 #define NEW_ALLOW 	1
 #define NEW_FORCE 	2
 
-static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short dcallno, struct chan_iax2_pvt *cur, int full_frame)
+static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short dcallno, struct chan_iax2_pvt *cur, int check_dcallno)
 {
 	if ((cur->addr.sin_addr.s_addr == sin->sin_addr.s_addr) &&
 		(cur->addr.sin_port == sin->sin_port)) {
 		/* This is the main host */
 		if ( (cur->peercallno == 0 || cur->peercallno == callno) &&
-			 (full_frame ? dcallno == cur->callno : 1) ) {
+			 (check_dcallno ? dcallno == cur->callno : 1) ) {
 			/* That's us.  Be sure we keep track of the peer call number */
 			return 1;
 		}
@@ -1230,7 +1230,7 @@
 	return res;
 }
 
-static int find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int lockpeer, int sockfd, int full_frame)
+static int find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int lockpeer, int sockfd, int check_dcallno)
 {
 	int res = 0;
 	int x;
@@ -1244,7 +1244,7 @@
  				.callno = dcallno,
  				.peercallno = callno,
  				/* hack!! */
- 				.frames_received = full_frame,
+ 				.frames_received = check_dcallno,
  			};
  
  			memcpy(&tmp_pvt.addr, sin, sizeof(tmp_pvt.addr));
@@ -1262,7 +1262,7 @@
 			ast_mutex_lock(&iaxsl[x]);
 			if (iaxs[x]) {
 				/* Look for an exact match */
-				if (match(sin, callno, dcallno, iaxs[x], full_frame)) {
+				if (match(sin, callno, dcallno, iaxs[x], check_dcallno)) {
 					res = x;
 				}
 			}
@@ -1272,7 +1272,7 @@
 			ast_mutex_lock(&iaxsl[x]);
 			if (iaxs[x]) {
 				/* Look for an exact match */
-				if (match(sin, callno, dcallno, iaxs[x], full_frame)) {
+				if (match(sin, callno, dcallno, iaxs[x], check_dcallno)) {
 					res = x;
 				}
 			}




More information about the svn-commits mailing list