Review Board 1.7.16


IAX2 Transfer Fix

Review Request #140 - Created Feb. 3, 2009 and submitted

David Vossel
1.6.0
0013468
Reviewers
asterisk-dev
russell
Asterisk
Fixes issue with IAX2 transfers not taking place.  As it was, a call that was being transfered would never be handed off correctly to the call ends because of how call numbers were stored in a hash table.  The hash table, "iax_peercallno_pvt", storing all the current call numbers did not take into account the complications associated with transferring a call, so a separate hash table was required.  This second hash table "iax_transfercallno_pvt" handles calls being transfered, once the call transfer is complete the call is removed from the transfer hash table and added to the peer hash table resuming normal operations. Addition functions were created to handle storing, removing, and comparing items in the iax_transfercallno_pvt table. 
this patch has been tested on both 1.6.0 and 1.4.  1.6.1 and trunk have issues of there own that must be fixed before this patch can be applied to them. 
Review request changed
Updated (Feb. 3, 2009, 8:02 a.m.)
Added remove_by_transfercallno(pvt) to destructor. fixed white space issues. 
Ship it!
Posted (Feb. 3, 2009, 9:59 a.m.)
After these couple of minor changes, this can be committed to 1.4 and 1.6.0.  As we discussed, we will hold off on merging this code into trunk and 1.6.1, since in those branches, the changes needed are more complicated due to additional transfer related changes that have been made there.

Nice work, David!
/branches/1.6.0/channels/chan_iax2.c (Diff revision 3)
 
 
Minor nitpick ... add a space after if
/branches/1.6.0/channels/chan_iax2.c (Diff revision 3)
 
 
Just below this, you'll see where the code handled the case of a memory allocation failure of iax_peercallno_pvts.

You should move this allocation to be after that block and also add similar error handling after that.

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.