[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 11:27:16 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 11:27 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.
====================================================================== 

---------------------------------------------------------------------- 
 (0109896) pherman (reporter) - 2009-09-01 11:27
 https://issues.asterisk.org/view.php?id=15801#c109896 
---------------------------------------------------------------------- 
It's maxed out on the top, but bits 3-8 seem to be free.  But yeah, if
these flags are independent of each other then enum would be better. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-09-01 11:27 pherman        Note Added: 0109896                          
======================================================================




More information about the asterisk-bugs mailing list