[asterisk-bugs] [Asterisk 0019062]: [patch] PRI party subaddress odd_even_indicator inconsitency / undocumented

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Apr 6 11:16:51 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=19062 
====================================================================== 
Reported By:                festr
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   19062
Category:                   Channels/chan_dahdi
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     confirmed
Asterisk Version:           SVN 
JIRA:                       SWP-3302 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 311931 
Request Review:              
====================================================================== 
Date Submitted:             2011-04-04 06:35 CDT
Last Modified:              2011-04-06 11:16 CDT
====================================================================== 
Summary:                    [patch] PRI party subaddress odd_even_indicator
inconsitency / undocumented
Description: 
I'm playing with party subaddress -> Call(DAHDI/g1/1234:u0a23a4)

this syntax should set party subaddress to user specified and
odd_even_indicator to 0. Unfortunatly, odd_even_indicator is overwritten in
channels/sig_pri.c in function sig_pri_party_subaddress_from_ast:
pri_subaddress->odd_even_indicator = (length & 1); 

So you cannot set your own odd_even_indicator specified by prefix 'u' or
'U' as it depends always on string length. I've hecked it by uncommenting
"pri_subaddress->odd_even_indicator = (length & 1);" 
====================================================================== 

---------------------------------------------------------------------- 
 (0133447) rmudgett (administrator) - 2011-04-06 11:16
 https://issues.asterisk.org/view.php?id=19062#c133447 
---------------------------------------------------------------------- 
The received subaddress is always converted to an ASCII hex string if the
type is user specified.  The ASCII hex string can then be easily
manipulated by the dialplan.

The odd/even flag can be determined using the ASCII hex string length.  If
the ASCII hex string length is odd then the odd/even flag needs to indicate
odd.  The original code is just wrong because it is using the filled length
of the BCD buffer to determine the odd/even flag.

The sig_pri_party_subaddress_from_ast() function is called by several
places to convert from Asterisk to PRI representation.  Dialed subaddress,
Caller ID subaddress, and redirecting to/from subaddresses.

There are a few ways to fix this issue.
1) Calculate the odd/even flag correctly from the ASCII hex string and
ignore the odd/even indication from the uU setting.
2) Calculate the odd/even flag correctly from the ASCII hex string and
then make an exception to always use the odd/even indication from the uU
setting for the dialed subaddress.
3) Always trust the source odd/even flag.

Option one is the safest.  The odd/even flag will never be wrong.
Option two is a hybrid between one and three.
Option three leaves it up to the user to either get it right or allow him
to play games with the odd/even flag.

Your patch fixes the incorrect code by trusting the setting of the
odd_even_indicator flag. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-04-06 11:16 rmudgett       Note Added: 0133447                          
======================================================================




More information about the asterisk-bugs mailing list