Skip to content

Trying to Decode E164 Address Type But its failing #201

@pandasachin

Description

@pandasachin

Hi ,
Can some one help us to understand why the decode for Address Family is not happening as expected.

We have SMSC-Address , which is of Address Family and of type E164, when we define "Address" in our dictionary and try to Decode this it adds the Type value at the front of the parsed value as this "\x00\b436990071301" instead of "436990071301".

SMSC_Addres

Example Parsed RAW value:

SMSC-Address {Code:2017,Flags:0xc0,Length:28,VendorId:10415,Value:Address{datatype.Address{0x34, 0x33, 0x36, 0x39, 0x39, 0x30, 0x30, 0x37, 0x31, 0x33, 0x30, 0x31}}, Type{datatype.Address{0x0, 0x8}} Padding:2},

func TestDecodeAddressE164(t *testing.T) {
b := []byte{0x00, 0x08, 0x34, 0x33, 0x36, 0x39, 0x39, 0x30, 0x30, 0x37, 0x31, 0x33, 0x30, 0x31}
address, err := DecodeAddress(b)
if err != nil {
t.Fatal(err)
}
if address.Padding() != 3 {
t.Fatalf("Unexpected padding. Want 3, have %d",
address.Padding())
}
}

Result : --- FAIL: TestDecodeAddressE164 (1.87s)
address_test.go:206: Unexpected padding. Want 3, have 2
FAIL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions