[asterisk-dev] q931 decoding question

Klaus Darilion klaus.mailinglists at pernau.at
Thu Jan 10 12:52:55 CST 2008


Hans Petter Selasky wrote:
> On Thursday 10 January 2008, Klaus Darilion wrote:
>> Hi!
>>
>> Please take a look at the following incoming SETUP message:
>>
>> < Protocol Discriminator: Q.931 (8)  len=42
>> < Call Ref: len= 2 (reference 5566/0x15BE) (Originator)
>> < Message type: SETUP (5)
>> < [04 02 88 90]
>> < Bearer Capability (len= 4) [ Ext: 1  Q.931 Std: 0  Info transfer
>> capability: Unrestricted digital information (8)
>> <                              Ext: 1  Trans mode/rate: 64kbps,
>> circuit-mode (16)
>> <                              Ext: 0  User information layer 1: Unknown
>> (24)
>>
>> lets decode it:
>>
>>        bearer capability IE
>>       /
>>      /  length
>>
>>     |  /
>>     |
>>     |  |   ext=1, coding standard=0 0=ITU, information tranfer
>>
>> capability=0 1 0 0 0=Unrestricted digital information
>>
>>     |  |  /
>>     |  |
>>     |  |  |    ext=1, transfer mode=0 0=circuit mode, information
>>     |  |  |    transfer rate=0 0 0 0 0
>>     |  |  |  /
>>
>> < [04 02 88 90]
>>
>> this means the bearer capability IE does not include the user
>> information layer 1 octet. Nevertheless it gets parsed.
>>
>> <                     Ext: 0  User information layer 1: Unknown (24)
>>
>> My questions: Why does it gets parsed? Why is it set to 24? I checked
>> libpri source code but could not find the relevant code. Maybe someone
>> can point to the corresponding code.
> 
> Hi,
> 
> Maybe there is a decoding error in libpri, for example a missing length check 
> or missing extension (mask=0x80) check. If the second byte has the 7th bit 
> set, then there should be no fifth byte.


[04 02 88 90]
           ^ ext=1,

but I think this is ok according to Q.931 specification.

regards
Klaus

> If this is repeatable you could try decoding the package using "isdndecode" 
> from FreeBSD:
> 
> http://www.selasky.org/hans_petter/isdn4bsd/sources/src/usr.sbin/i4b/isdndecode/
> 
> --HPS




More information about the asterisk-dev mailing list