[asterisk-bugs] [Asterisk 0015801]: chan_sip.c : SIP_PAGE2_CALL_ONHOLD* flags missing a bit

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Sep 1 10:51:18 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15801 
====================================================================== 
Reported By:                pherman
Assigned To:                dvossel
====================================================================== 
Project:                    Asterisk
Issue ID:                   15801
Category:                   Channels/chan_sip/General
Reproducibility:            N/A
Severity:                   tweak
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.6.1.5 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-08-31 08:31 CDT
Last Modified:              2009-09-01 10:51 CDT
====================================================================== 
Summary:                    chan_sip.c : SIP_PAGE2_CALL_ONHOLD*  flags missing a
bit
Description: 
here's an easy one.  In chan_sip.c, we have:

#define SIP_PAGE2_CALL_ONHOLD           (3 << 23)       /*!< D: Call hold
states: */
#define SIP_PAGE2_CALL_ONHOLD_ACTIVE    (1 << 23)       /*!< D: Active
hold */
#define SIP_PAGE2_CALL_ONHOLD_ONEDIR    (2 << 23)       /*!< D: One
directional hold */
#define SIP_PAGE2_CALL_ONHOLD_INACTIVE  (3 << 23)       /*!< D: Inactive
hold */

I'm not aware of any bugs this may cause, but this can't be correct, can
it?  I suggest:

#define SIP_PAGE2_CALL_ONHOLD           (7 << 22)       /*!< D: Call hold
states: */
#define SIP_PAGE2_CALL_ONHOLD_ACTIVE    (1 << 22)       /*!< D: Active
hold */
#define SIP_PAGE2_CALL_ONHOLD_ONEDIR    (2 << 22)       /*!< D: One
directional hold */
#define SIP_PAGE2_CALL_ONHOLD_INACTIVE  (4 << 22)       /*!< D: Inactive
hold */

and moving the other flags down one bit.
====================================================================== 

---------------------------------------------------------------------- 
 (0109892) dvossel (administrator) - 2009-09-01 10:51
 https://issues.asterisk.org/view.php?id=15801#c109892 
---------------------------------------------------------------------- 
Yes, this is a silly bug.  Your purposed fix would work, but we can't
expand the bits on that flags variable because its already maxed out.  I'll
just strip those flags out and place them in an enum on the sip_pvt. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-09-01 10:51 dvossel        Note Added: 0109892                          
======================================================================




More information about the asterisk-bugs mailing list