Summary:ASTERISK-07372: [patch][post 1.4] IAX2 Native Bridge Enhancements
Reporter:tjd (tjd)Labels:
Date Opened:2006-07-20 21:49:21Date Closed:2008-05-17 14:34:28
Versions:Frequency of
Environment:Attachments:( 0) bug_7567_update_v2.diff
( 1) bug_7567_update.diff
( 2) chan_iax2_v2.diff
( 3) chan_iax2.diff
Description:A patch to improve the success rate of IAX2 native bridging.

It deals with multiple intermediate peers, media bridging and it
also allows retries of the native bridge in certain circumstances.

It supercedes bug 7348 which can be cancelled.


Here's a summary of what I've done (I hope I've included it all):

- Shift the media-only bridge out of the way.  It was using the
"transfer" host, which is fine until you need to try a subsequent
transfer.  This involved creating a "media" host and associated
send_command_media function, as well as "if" conditions all over the place.

- Add the transferid to all transfer packets.  Not strictly necessary in
all cases (except where needed to resolve which transfer the peer is
dealing with).  It could also help with packet injection attacks, but
breaks backwards compatibility.  All received transfer packets are
compared to the current transferid and ignored if they don't match.

- Allow the peer to retry a transfer later (when a "collision" occurs
with a transfer request from an adjacent peer).  The "collision" is
resolved by who has the higher transferid.

- Changed some of the logic, especially regarding the TXREJ.  A peer may
be doing two independent transfers initiated by the adjacent hosts, or
it may be doing a transfer initiated by itself.  It uses transferids of
the bridgepeer to determine what to do.

- A few small things: like if a channel has been media-only released, it
will always send transfer packets to the media host, and will only try a
media transfer (not a full transfer).  Also when a TXCNT is received, we
set the transfer host to its source address, and send the TXACC back
(like in libiax).

I think that is it.  I wrote it a few weeks ago, so I might have missed

I guess this would need to go into libiax as well, and I have noticed
that libiax has a few differences already (like some packet payloads
differ etc).

It would also need a lot of testing, if it is deemed a worthy solution.
Comments:By: Serge Vecher (serge-v) 2006-07-21 08:30:06

tdj: ok, I'll close the 7348 bug in favor of this one. Question: is there a reason you've set 'disclaimer' to no? In 7348 you've indicated that you've filed the disclaimer. Can you please confirm your disclaimer status?

By: tjd (tjd) 2006-07-21 08:46:25

Yes, I have filed the disclaimer.  I just forgot to check the box... and couldn't change it after submitting the bug.

By: Serge Vecher (serge-v) 2006-07-21 08:47:35

no problem, thanks for quick follow up

By: jmls (jmls) 2006-10-31 14:24:31.000-0600

tjd, would you be able to supply a patch that is updated to the latest svn trunk ? Thanks

By: tjd (tjd) 2006-11-02 20:14:49.000-0600

Okay, here it is - chan_iax2_v2.diff

By: Serge Vecher (serge-v) 2006-11-09 09:16:47.000-0600

file: would you please look at this one ...

By: Serge Vecher (serge-v) 2007-02-26 16:01:11.000-0600


By: Michiel van Baak (mvanbaak) 2007-09-12 11:05:11

Can you provide a patch against current trunk?
This one fails in many places.

By: Brandon Kruse (bkruse) 2008-01-27 23:19:19.000-0600


If no one responses, I will close this issue and can re-open if the reporter responds.


By: snuffy (snuffy) 2008-01-28 00:50:49.000-0600

I thought i'd update the patch to latest trunk still has some issues..
del the patch will try to fix up (forgot to compile first)

By: snuffy (snuffy) 2008-01-28 01:07:28.000-0600

I fixed up the patch (missed culling something)
Also had to change one other part to remove the MEDIAPASS and replace with TRANSFER_NONE.
It now compiles fine

By: Joshua C. Colp (jcolp) 2008-04-21 11:19:39

Okay, I'm going to devote some time to looking at this patch/understanding it/hopefully getting it merged. Sorry it has taken so long.

By: Digium Subversion (svnbot) 2008-05-12 10:04:24

Repository: asterisk
Revision: 115651

A   team/file/7567/

r115651 | file | 2008-05-12 10:04:23 -0500 (Mon, 12 May 2008) | 2 lines

Add branch for issue ASTERISK-7372.



By: Digium Subversion (svnbot) 2008-05-17 14:33:33

Repository: asterisk
Revision: 116884

U   trunk/channels/chan_iax2.c
U   trunk/channels/iax2-parser.h

r116884 | file | 2008-05-17 14:33:33 -0500 (Sat, 17 May 2008) | 6 lines

Improve native transfers when a chain of IAX2 connections are in use.
(closes issue ASTERISK-7372)
Reported by: tjd
     bug_7567_update_v2.diff uploaded by snuffy (license 35)



By: Digium Subversion (svnbot) 2008-05-17 14:34:28

Repository: asterisk
Revision: 116885

_U  branches/1.6.0/

r116885 | file | 2008-05-17 14:34:27 -0500 (Sat, 17 May 2008) | 13 lines

Blocked revisions 116884 via svnmerge

r116884 | file | 2008-05-17 16:39:35 -0300 (Sat, 17 May 2008) | 6 lines

Improve native transfers when a chain of IAX2 connections are in use.
(closes issue ASTERISK-7372)
Reported by: tjd
     bug_7567_update_v2.diff uploaded by snuffy (license 35)