mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 03:50:31 +00:00
Merged revisions 69221 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r69221 | file | 2007-06-13 17:17:28 -0400 (Wed, 13 Jun 2007) | 2 lines Let's make chan_iax2 media only native transfers actually work. (issue #9376 reported by simone cittadini) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1224,7 +1224,7 @@ static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short
|
||||
if ((cur->transfer.sin_addr.s_addr == sin->sin_addr.s_addr) &&
|
||||
(cur->transfer.sin_port == sin->sin_port) && (cur->transferring)) {
|
||||
/* We're transferring */
|
||||
if (dcallno == cur->callno)
|
||||
if ((dcallno == cur->callno) || (cur->transferring == TRANSFER_MEDIAPASS && cur->transfercallno == callno))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -1326,6 +1326,7 @@ static int find_callno(unsigned short callno, unsigned short dcallno, struct soc
|
||||
int x;
|
||||
struct timeval now;
|
||||
char host[80];
|
||||
|
||||
if (new <= NEW_ALLOW) {
|
||||
for (x=1;(res < 1) && (x<maxnontrunkcall);x++) {
|
||||
ast_mutex_lock(&iaxsl[x]);
|
||||
@@ -6839,7 +6840,7 @@ static int socket_process(struct iax2_thread *thread)
|
||||
if (!fr->callno)
|
||||
fr->callno = find_callno(ntohs(mh->callno) & ~IAX_FLAG_FULL, dcallno, &sin, new, 1, fd);
|
||||
|
||||
if (fr->callno > 0)
|
||||
if (fr->callno > 0)
|
||||
ast_mutex_lock(&iaxsl[fr->callno]);
|
||||
|
||||
if (!fr->callno || !iaxs[fr->callno]) {
|
||||
@@ -7924,6 +7925,14 @@ retryowner2:
|
||||
break;
|
||||
case IAX_COMMAND_TXMEDIA:
|
||||
if (iaxs[fr->callno]->transferring == TRANSFER_READY) {
|
||||
AST_LIST_LOCK(&queue);
|
||||
AST_LIST_TRAVERSE(&queue, cur, list) {
|
||||
/* Cancel any outstanding frames and start anew */
|
||||
if ((fr->callno == cur->callno) && (cur->transfer)) {
|
||||
cur->retries = -1;
|
||||
}
|
||||
}
|
||||
AST_LIST_UNLOCK(&queue);
|
||||
/* Start sending our media to the transfer address, but otherwise leave the call as-is */
|
||||
iaxs[fr->callno]->transferring = TRANSFER_MEDIAPASS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user