Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to Decode E164 Address Type But its failing #201

Open
pandasachin opened this issue Aug 30, 2024 · 0 comments
Open

Trying to Decode E164 Address Type But its failing #201

pandasachin opened this issue Aug 30, 2024 · 0 comments

Comments

@pandasachin
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant