[Home]

Summary:ASTERISK-05176: priority in zt_bridge main loop doesn't swap
Reporter:Daniel Collins (dancollins)Labels:
Date Opened:2005-09-28 14:27:34Date Closed:2008-01-15 15:49:27.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_zap
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:In reading through the zaptel channel driver, I noticed that in zt_bridge (at chan_zap.c line 3200 or so) there is a bug in how the priority is handled in the main loop.  The priority is supposed to be swapped every time through the loop, but since the priority variable is declared within the loop, it is reinitialized at every pass (never swapping).

****** ADDITIONAL INFORMATION ******

from chan_zap.c:
3201: for (;;;) {
3202:    struct ast_channel *co_priority[2] = {c0, c1};
3203:    struct ast_channel *co_priority[2] = {c1, c0};
3204:    int priority = 0;
...
3250:    ast_waitfor_n(priority ? c0_priority : c1_priority, 2 &to);
...
3276:    /* swap who gets priority */
3277:    priority = !priority;
3278: }
Comments:By: Russell Bryant (russell) 2005-09-28 15:22:12

fixed in cvs head, thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:49:27.000-0600

Repository: asterisk
Revision: 6675

U   trunk/channels/chan_zap.c

------------------------------------------------------------------------
r6675 | russell | 2008-01-15 15:49:27 -0600 (Tue, 15 Jan 2008) | 3 lines

don't declare the priority inside of the for loop so that the priority
can actually be switched at each iteration (issue ASTERISK-5176)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=6675