Menu

Trouble decoding H225

Help
Seth Keith
2014-07-25
2014-07-28
  • Seth Keith

    Seth Keith - 2014-07-25

    First off, let me thank Lev Walkin and all the other contributors to this awesome product. You guys rock!

    Now my problem: I cannot seem to decode H225 messages at all. I am using

    h2250v7.asn
    H235-SECURITY-MESSAGES.asn
    H245v15.asn
    

    I am compiling with then -gen-PER flag. I had to patch the compiler for one of the per_encode functions which was missing but I am not even trying encode, just decode which is failing. The input I am trying to decode is this:

    00000000 23 80 06 00 08 91 4a 00 03 22 c0 00 00 00 00 03 |#.....J.."......|
    00000010 33 31 30 69 00 52 01 50 c0 11 00 c0 fe f9 3e cd |310i.R.P......>.|
    00000020 9e d6 11 9a b2 00 04 76 22 20 17 01 00 01 00 08 |.......v" ......|
    00000030 80 01 00

    This current example is decoding an Aletering-UUIE. It seems to be failing on an optional section ( see H245Security below from h2250v7.asn ):

    Alerting-UUIE ::= SEQUENCE
    {
    protocolIdentifier ProtocolIdentifier,
    destinationInfo EndpointType,
    h245Address TransportAddress1 OPTIONAL,
    ...,
    callIdentifier CallIdentifier,
    h245SecurityMode H245Security OPTIONAL,
    tokens SEQUENCE OF ClearToken OPTIONAL,
    cryptoTokens SEQUENCE OF CryptoH323Token OPTIONAL,
    fastStart SEQUENCE OF OCTET STRING OPTIONAL,
    multipleCalls BOOLEAN,
    maintainConnection BOOLEAN,
    alertingAddress SEQUENCE OF AliasAddress OPTIONAL,
    presentationIndicator PresentationIndicator OPTIONAL,
    screeningIndicator ScreeningIndicator OPTIONAL,
    fastConnectRefused NULL OPTIONAL,
    serviceControl SEQUENCE OF ServiceControlSession OPTIONAL,
    capacity CallCapacity OPTIONAL,
    featureSet FeatureSet OPTIONAL,
    displayName SEQUENCE OF DisplayName OPTIONAL
    }

    Here is the output from the autogenerated decoder. NOTE: the input does not contain any H245Security options. Seems like it should just skip the optional section ( to me ), but it appears to fail...

    ~~~~Decoding H323UserInformation as SEQUENCE (UPER)
    [PER got 1<=408 bits => span 1 +0[1..408]:23 (407) => 0x0]
    [PER got 1<=407 bits => span 2 +0[2..408]:23 (406) => 0x0]
    Read in presence bitmap for H323UserInformation of 1 bits (0..)
    Decoding member h323-uu-pdu in H323UserInformation
    Decoding H323-UU-PDU as SEQUENCE (UPER)
    [PER got 1<=406 bits => span 3 +0[3..408]:23 (405) => 0x1]
    [PER got 1<=405 bits => span 4 +0[4..408]:23 (404) => 0x0]
    Read in presence bitmap for H323-UU-PDU of 1 bits (0..)
    Decoding member h323-message-body in H323-UU-PDU
    [PER got 1<=404 bits => span 5 +0[5..408]:23 (403) => 0x0]
    [PER got 3<=403 bits => span 8 +0[8..408]:23 (400) => 0x3]
    CHOICE h323-message-body got index 3 in range 3
    Discovered CHOICE h323-message-body encodes alerting
    Decoding Alerting-UUIE as SEQUENCE (UPER)
    [PER got 1<=400 bits => span 9 +1[1..400]:80 (399) => 0x1]
    [PER got 1<=399 bits => span 10 +1[2..400]:80 (398) => 0x0]
    Read in presence bitmap for Alerting-UUIE of 1 bits (0..)
    Decoding member protocolIdentifier in Alerting-UUIE
    PER Decoding non-extensible size 0 .. 0 bits -1
    [PER got 8<=398 bits => span 18 +1[10..400]:80 (390) => 0x0]
    Got PER length eb -1, len 0, once (ProtocolIdentifier)
    Expanding 0 characters into (0..255):8
    Decoding member destinationInfo in Alerting-UUIE
    Decoding EndpointType as SEQUENCE (UPER)
    [PER got 1<=390 bits => span 19 +2[3..392]:06 (389) => 0x0]
    [PER got 6<=389 bits => span 25 +2[9..392]:06 (383) => 0xc]
    Read in presence bitmap for EndpointType of 6 bits (30..)
    [PER got 1<= 6 bits => span 1 +8[1..6]:30 (5) => 0x0]
    Member EndpointType->nonStandardData is optional, p=0 (1->6)
    [PER got 1<= 5 bits => span 2 +8[2..6]:30 (4) => 0x0]
    Member EndpointType->vendor is optional, p=0 (2->6)
    [PER got 1<= 4 bits => span 3 +8[3..6]:30 (3) => 0x1]
    Member EndpointType->gatekeeper is optional, p=1 (3->6)
    Decoding member gatekeeper in EndpointType
    Decoding GatekeeperInfo as SEQUENCE (UPER)
    [PER got 1<=383 bits => span 26 +3[2..384]:00 (382) => 0x0]
    [PER got 1<=382 bits => span 27 +3[3..384]:00 (381) => 0x0]
    Read in presence bitmap for GatekeeperInfo of 1 bits (0..)
    [PER got 1<= 1 bits => span 1 +0[1..1]:00 (0) => 0x0]
    Member GatekeeperInfo->nonStandardData is optional, p=0 (1->1)
    [PER got 1<= 3 bits => span 4 +8[4..6]:30 (2) => 0x1]
    Member EndpointType->gateway is optional, p=1 (4->6)
    Decoding member gateway in EndpointType
    Decoding GatewayInfo as SEQUENCE (UPER)
    [PER got 1<=381 bits => span 28 +3[4..384]:00 (380) => 0x0]
    [PER got 2<=380 bits => span 30 +3[6..384]:00 (378) => 0x0]
    Read in presence bitmap for GatewayInfo of 2 bits (0..)
    [PER got 1<= 2 bits => span 1 +0[1..2]:00 (1) => 0x0]
    Member GatewayInfo->protocol is optional, p=0 (1->2)
    [PER got 1<= 1 bits => span 2 +0[2..2]:00 (0) => 0x0]
    Member GatewayInfo->nonStandardData is optional, p=0 (2->2)
    [PER got 1<= 2 bits => span 5 +8[5..6]:30 (1) => 0x0]
    Member EndpointType->mcu is optional, p=0 (5->6)
    [PER got 1<= 1 bits => span 6 +8[6..6]:30 (0) => 0x0]
    Member EndpointType->terminal is optional, p=0 (6->6)
    Decoding member mc in EndpointType
    [PER got 1<=378 bits => span 31 +3[7..384]:00 (377) => 0x0]
    BOOLEAN decoded as FALSE
    Decoding member undefinedNode in EndpointType
    [PER got 1<=377 bits => span 32 +3[8..384]:00 (376) => 0x0]
    BOOLEAN decoded as FALSE
    [PER got 1<= 1 bits => span 1 +8[1..1]:00 (0) => 0x0]
    Member Alerting-UUIE->h245Address is optional, p=0 (1->1)
    Getting normally small length
    [PER got 1<=376 bits => span 33 +4[1..376]:08 (375) => 0x0]
    [PER got 6<=375 bits => span 39 +4[7..376]:08 (369) => 0x4]
    l=5
    Extensions 5 present in Alerting-UUIE
    [PER got 5<=369 bits => span 44 +4[12..376]:08 (364) => 0x9]
    Read in extensions bitmap for Alerting-UUIE of 5 bits (48..)
    [PER got 1<= 5 bits => span 1 +8[1..5]:48 (4) => 0x0]
    [PER got 1<= 4 bits => span 2 +8[2..5]:48 (3) => 0x1]
    Decoding member h245SecurityMode in Alerting-UUIE (nil)
    Getting open type H245Security...
    [PER got 8<=364 bits => span 52 +5[12..368]:91 (356) => 0x14]
    [PER got 24<=356 bits => span 76 +6[28..360]:4a (332) => 0xa00032]
    [PER got 24<=332 bits => span 100 +9[28..336]:22 (308) => 0x2c0000]
    [PER got 24<=308 bits => span 124 +12[28..312]:00 (284) => 0x0]
    [PER got 24<=284 bits => span 148 +15[28..288]:03 (260) => 0x333313]
    [PER got 24<=260 bits => span 172 +2[28..264]:30 (236) => 0x69005]
    [PER got 24<=236 bits => span 196 +5[28..240]:52 (212) => 0x20150c]
    [PER got 16<=212 bits => span 212 +8[20..216]:c0 (196) => 0x110]
    Getting open type H245Security encoded in 20 bytes
    [PER got 1<=160 bits => span 1 +0[1..160]:a0 (159) => 0x1]
    [PER got 7<=159 bits => span 8 +0[8..160]:a0 (152) => 0x20]
    Failed to decode element H245Security
    Failed to decode alerting in h323-message-body (CHOICE) 2
    Failed decode h323-message-body in H323-UU-PDU
    Failed decode h323-uu-pdu in H323UserInformation
    Freeing H323UserInformation as SEQUENCE
    Freeing H323-UU-PDU as SEQUENCE
    Freeing h323-message-body as CHOICE
    Freeing Alerting-UUIE as SEQUENCE
    Freeing ProtocolIdentifier as a primitive type
    Freeing EndpointType as SEQUENCE
    Freeing GatekeeperInfo as SEQUENCE
    Freeing GatewayInfo as SEQUENCE
    Freeing H245Security as CHOICE
    ~~~~~

    I really like this compiler, it is exactly what I need. I feel close on this but I just cannot seem to make it work...

    Any ideas?

     
  • Seth Keith

    Seth Keith - 2014-07-28

    I am still at this, adding data to the topic. The only other questionable step I performed ( except for the aforementioned unused encode patch previously specified ) was to change the asn.1 files to remove multiply defined symbols. I think this might be the source of my troubles. If you just go and 'regen' the asn.1 files needed for h323, you get a bunch of multiply defined symbol errors such as this:

    FATAL: ASN.1 expression "Password" at line 2324 of module MULTIMEDIA-SYSTEM-CONTROL
    clashes with expression "Password" at line 14 of module H235-SECURITY-MESSAGES (specs/H235-SECURITY-MESSAGES.asn).
    Rename or remove either instance to resolve the conflict in specs/MULTIMEDIA-SYSTEM-CONTROL.asn

    My first try was to rename all the conflicts in each file. This compiled, but with the failure parsing h225 previously posted. My current speculation is here lies my problem. Some of the multiply defined types need to be imported instead of re-defined. Is there any validity to this idea?

    I am currently trying it by commenting out the redefs, and IMPORTing them instead, but now I have run into the following conflict:

    This is from MULTIMEDIA-SYSTEM-CONTROL.asn:

    NonStandardMessage ::= SEQUENCE {nonStandardData NonStandardParameter,
    ...
    }

    And this is from H323_MESSAGES.asn

    NonStandardMessage ::= SEQUENCE
    {
    requestSeqNum RequestSeqNum,
    nonStandardData NonStandardParameter,
    ...,
    tokens SEQUENCE OF ClearToken OPTIONAL,
    cryptoTokens SEQUENCE OF CryptoH323Token OPTIONAL,
    integrityCheckValue ICV OPTIONAL,
    featureSet FeatureSet OPTIONAL,
    genericData SEQUENCE OF GenericData OPTIONAL
    }

    This seems like it is intended to be a different structure. Does anyone know what should be done here?

    NOTE: I am using the asn set H235-SECURITY-MESSAGES.asn H323-MESSAGES.asn MULTIMEDIA-SYSTEM-CONTROL.asn here, but I have also tried this on h323 asn files from other sources such as http://www.packetizer.com/ipmc/h323/standards.html but I get the same conflict errors and same parse failure if I rename the conflicts...

    If anyone has made this work ( h323 decoding ) please post something. Is this even possible?

    Here is the full list of conflicts:

    FATAL: ASN.1 expression "NonStandardParameter" at line 692 of module H323-MESSAGES
    clashes with expression "NonStandardParameter" at line 21 of module H235-SECURITY-MESSAGES (specs/H235-SECURITY-MESSAGES.asn).
    Rename or remove either instance to resolve the conflict in specs/H323-MESSAGES.asn
    FATAL: ASN.1 expression "NonStandardMessage" at line 119 of module MULTIMEDIA-SYSTEM-CONTROL
    clashes with expression "NonStandardMessage" at line 2070 of module H323-MESSAGES (specs/H323-MESSAGES.asn).
    Rename or remove either instance to resolve the conflict in specs/MULTIMEDIA-SYSTEM-CONTROL.asn
    FATAL: ASN.1 expression "NonStandardParameter" at line 124 of module MULTIMEDIA-SYSTEM-CONTROL
    clashes with expression "NonStandardParameter" at line 21 of module H235-SECURITY-MESSAGES (specs/H235-SECURITY-MESSAGES.asn).
    Rename or remove either instance to resolve the conflict in specs/MULTIMEDIA-SYSTEM-CONTROL.asn
    FATAL: ASN.1 expression "NonStandardIdentifier" at line 129 of module MULTIMEDIA-SYSTEM-CONTROL
    clashes with expression "NonStandardIdentifier" at line 698 of module H323-MESSAGES (specs/H323-MESSAGES.asn).
    Rename or remove either instance to resolve the conflict in specs/MULTIMEDIA-SYSTEM-CONTROL.asn
    FATAL: ASN.1 expression "TransportAddress" at line 1533 of module MULTIMEDIA-SYSTEM-CONTROL
    clashes with expression "TransportAddress" at line 442 of module H323-MESSAGES (specs/H323-MESSAGES.asn).
    Rename or remove either instance to resolve the conflict in specs/MULTIMEDIA-SYSTEM-CONTROL.asn
    FATAL: ASN.1 expression "Password" at line 2324 of module MULTIMEDIA-SYSTEM-CONTROL
    clashes with expression "Password" at line 14 of module H235-SECURITY-MESSAGES (specs/H235-SECURITY-MESSAGES.asn).
    Rename or remove either instance to resolve the conflict in specs/MULTIMEDIA-SYSTEM-CONTROL.asn

    Also there is this warning:

    WARNING: GeneralString is not fully supported
    WARNING: GeneralString is not fully supported
    WARNING: GeneralString is not fully supported

     

    Last edit: Seth Keith 2014-07-28

Log in to post a comment.