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

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Apr 6 12:32:47 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 12:32 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);" 
====================================================================== 

---------------------------------------------------------------------- 
 (0133460) rmudgett (administrator) - 2011-04-06 12:32
 https://issues.asterisk.org/view.php?id=19062#c133460 
---------------------------------------------------------------------- 
This whole discussion has been dealing with the user specified format of
the subaddress.  The NSAP format has its own handling rules and has NOT
been discussed in this issue.

Lets say you receive this user specified BCD subaddress: 0x12 0x34 0x50
with the odd flag set.

This is converted to an odd length ASCII hex string "12345" because that
is the number of BCD digits encoded and the odd flag saying that the
trailing pad digit is not used.  You can then easily manipulate the digits
without worrying about the presence of a pad digit.

You could simply append another digit to the subaddress ASCII hex string
so it becomes "123456" which is then converted to BCD: 0x12 0x34 0x56 with
the odd flag cleared.

The purpose of the odd/even flag is to indicate if the last nybble in the
last byte is used.

way 1) The odd/even flag is automatically calculated based upon the length
of the ASCII hex string as shown in the example.  There is no pad character
in the string to always make the string an even length.

way 2) Correct.  The odd/even flag is automatically calculated as in way
1.  The Dial() application then overrides the calculated odd/even flag
based upon the user specified uU odd/even indication.

way 3) Of course there is a source.  You are the source when you use the
uU prefix in the Dial application. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-04-06 12:32 rmudgett       Note Added: 0133460                          
======================================================================




More information about the asterisk-bugs mailing list