Summary:ASTERISK-00615: [patch] IAX2 native bridge - two trivial (though critical) fixes
Reporter:blackfire (blackfire)Labels:
Date Opened:2003-12-03 13:11:21.000-0600Date Closed:2004-09-25 02:49:15
Versions:Frequency of
Environment:Attachments:( 0) iax2-transfer.diff
Description:IAX2 native transfers are not working with stock libiax2 (cvs from somewhere last month). I've found the cause to be two-fold:

* iax_send_txready() is in fact duplicated iax_send_txacc() that when called, issues an endless flood of TXACC's between the connecting parties instead of notifying the server that they can see each other with a TXREADY.

* iax_header_to_event(), case IAX_EVENT_TXREQ doesn't fill the session->transfer sockaddr_in structure, which makes the peer address equal to


Patch attached, though the fixes are obvious for anybody who looks at the code. Feel free to use it anywhere you wish.

One thing that bugs me is *why did it go unnoticed?* It must have broken calls between two IAX2 clients, when one of them isn't Asterisk. Expecting to see a flood of "DIAX 0.9.5 broken" mails since it switched to IAX2 only recently? :)
Comments:By: adam (adam) 2003-12-03 18:37:55.000-0600

Did I ever tell you you're my hero. Seriously though, thanks. I'm about to go live with a network of libiax2 clients and this would have caused pain. I also found iax_get_event in blocking mode doesn't work, I submitted a patch but I'm concerned about how many people are actually using this lib.

By: blackfire (blackfire) 2003-12-04 04:38:33.000-0600

Hmm I don't know really... I thought it was quite popular (you can set a single #define in libiaxclient and it uses IAX2). Apparently people use only IAX2->other transports where it seems fine. It would also help (IMHO) to cut out the iax_do_event() - it seems to come from IAX1 and is enclosed by #if 0/#endif, while having a body of the order of 10KB, making the code difficult to read (scroll n+1 lines up to check where the line you found comes from just to find an #if 0...).

On a side note, what clients are you going to use? libiaxclient based ones? Or something developed by you?

Also, miniphone.c in iax2 seems to be copied raw from iax1 (references to e->event.xxx fields) and doesn't even compile under iax2 (for me, at least).

By: Mark Spencer (markster) 2003-12-04 15:54:27.000-0600