[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:30:02 CDT 2009


The following issue has been CLOSED 
====================================================================== 
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:                     closed
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:              
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-08-31 08:31 CDT
Last Modified:              2009-09-01 11:30 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.
====================================================================== 

---------------------------------------------------------------------- 
 (0109897) dvossel (administrator) - 2009-09-01 11:30
 https://issues.asterisk.org/view.php?id=15801#c109897 
---------------------------------------------------------------------- 
actually, this isn't a bug.  They test for the flags in a way that makes
this correct.

/* testing the CALL_ONHOLD flags is this way is correct.  ONHOLD is just
used as a mask for 2 bits.  Those 2 bits can be one of three values. */

if (ast_test_flag(flag, ONHOLD) == ONHOLD_INACTIVE) {
    /* blah */
} 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-09-01 11:30 dvossel        Note Added: 0109897                          
2009-09-01 11:30 dvossel        Status                   assigned => closed  
======================================================================




More information about the asterisk-bugs mailing list