diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-29 18:57:20 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-29 18:57:20 +0000 |
commit | 9eab847177ad5594d8ab43d6092460bec6db73b5 (patch) | |
tree | ec830298cb806d6a1e47be6181632f9002e7b6d9 /channels | |
parent | 284d5d2175159f94e53a2f5b8b9feb3e5ede6a84 (diff) |
Merged revisions 119010 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r119010 | russell | 2008-05-29 13:54:11 -0500 (Thu, 29 May 2008) | 24 lines
Merged revisions 119009 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r119009 | russell | 2008-05-29 13:49:12 -0500 (Thu, 29 May 2008) | 16 lines
Merged revisions 119008 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r119008 | russell | 2008-05-29 13:45:21 -0500 (Thu, 29 May 2008) | 7 lines
Merge changes from team/russell/iax2-another-fix-to-the-fix
As described in the following post to the asterisk-dev mailing list, only
enforce destination call numbers when processing an ACK.
http://lists.digium.com/pipermail/asterisk-dev/2008-May/033217.html
(closes issue #12631)
........
................
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@119011 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_iax2.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 7e1822557..3474ec98f 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -1463,13 +1463,13 @@ static struct iax_frame *iaxfrdup2(struct iax_frame *fr) #define NEW_ALLOW 1 #define NEW_FORCE 2 -static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short dcallno, const struct chan_iax2_pvt *cur, int full_frame) +static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short dcallno, const 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; } @@ -1581,7 +1581,7 @@ static void remove_by_peercallno(struct chan_iax2_pvt *pvt) /* * \note Calling this function while holding another pvt lock can cause a deadlock. */ -static int __find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int sockfd, int return_locked, int full_frame) +static int __find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int sockfd, int return_locked, int check_dcallno) { int res = 0; int x; @@ -1595,7 +1595,7 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s .callno = dcallno, .peercallno = callno, /* hack!! */ - .frames_received = full_frame, + .frames_received = check_dcallno, }; memcpy(&tmp_pvt.addr, sin, sizeof(tmp_pvt.addr)); @@ -1615,7 +1615,7 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s 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; } } @@ -1626,7 +1626,7 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s 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; } } @@ -7935,8 +7935,10 @@ static int socket_process(struct iax2_thread *thread) f.subclass = 0; } - if (!fr->callno) - fr->callno = find_callno(ntohs(mh->callno) & ~IAX_FLAG_FULL, dcallno, &sin, new, fd, ntohs(mh->callno) & IAX_FLAG_FULL); + if (!fr->callno) { + fr->callno = find_callno(ntohs(mh->callno) & ~IAX_FLAG_FULL, dcallno, &sin, new, fd, + (ntohs(mh->callno) & IAX_FLAG_FULL) && f.frametype == AST_FRAME_IAX && f.subclass == IAX_COMMAND_ACK); + } if (fr->callno > 0) ast_mutex_lock(&iaxsl[fr->callno]); |