[asterisk-bugs] [Asterisk 0015684]: different 'ringt' timeout counting styles througout chan_dahdi/sig_analog code

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Aug 9 05:40:01 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15684 
====================================================================== 
Reported By:                alecdavis
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   15684
Category:                   Channels/chan_dahdi
Reproducibility:            N/A
Severity:                   text
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!): 211232 
Request Review:              
====================================================================== 
Date Submitted:             2009-08-09 05:29 CDT
Last Modified:              2009-08-09 05:40 CDT
====================================================================== 
Summary:                    different 'ringt' timeout counting styles througout
chan_dahdi/sig_analog code
Description: 
Below are the three styles I've found.
All trying to achive very close to the same thing, to timeout 'ringt'.
<pre>
<u>Style 1:</u>
if (analog_p->ringt) {
    analog_p->ringt--;
}
if (analog_p->ringt == 1) {
    return -1;
}

<u>Style 2:</u>
if (p->ringt)
   p->ringt--;
   if (p->ringt == 1) {
       res = -1;
       break;
   }
}

<u>Style 3:</u>
if (p->ringt == 1) {
    ast_mutex_unlock(&p->lock);
    return NULL;
}
else if (p->ringt > 0)
    p->ringt--;
</pre>

====================================================================== 

---------------------------------------------------------------------- 
 (0108824) alecdavis (reporter) - 2009-08-09 05:40
 https://issues.asterisk.org/view.php?id=15684#c108824 
---------------------------------------------------------------------- 
But if all we are trying to do is 'break' or 'return' if either 'just
timedout' or 'not yet set' then the code becomes; <pre>
if (p->ringt > 0) {
    p->ringt--;
}
if (p->ringt < 1) {
    res = -1;
    break;
}</pre> 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-08-09 05:40 alecdavis      Note Added: 0108824                          
======================================================================




More information about the asterisk-bugs mailing list