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

Support Wildcard Contact #12

Open
autoexpect opened this issue Oct 22, 2020 · 6 comments
Open

Support Wildcard Contact #12

autoexpect opened this issue Oct 22, 2020 · 6 comments

Comments

@autoexpect
Copy link

autoexpect commented Oct 22, 2020

The following message parsing failed: Error in SIP message at line 0 offset 0:

Thanks!

SIP Message ( does not contain [ and ] ):

[REGISTER sip:34020000002000000001@1.2.3.4:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.1.36:5060;rport;branch=z9hG4bK1585760165
From: sip:34020000001320000360@172.16.1.36:5060;tag=1882859352
To: sip:34020000001320000360@172.16.1.36:5060
Call-ID: f3g4h5366947196@172.16.1.36
CSeq: 3 REGISTER
Contact: *
Authorization: Digest username="34020000001320000360", realm="3402000000", nonce="MTYwMzM2NDU0MA==", uri="sip:34020000002000000001@1.2.3.4:5060", response="39c7240195630f0b26124c00db7cfa5c", algorithm=MD5, cnonce="0a4f113b", qop=auth, nc=00000002
Max-Forwards: 70
User-Agent: VCP MWARE
Expires: 0
RegMode: DEVICE;Describe=IPC-S642-IR;Register;DevVer=CIPC-B2301.5.21.200528
ReplaceDescribe: IPC-S642-IR;ProductId=defaultProductId;RegionCode=NONE;Vendor=UNIVIEW;Resolve=HIC1080P;Ptzfg=1;;SnmpVer=v3;DescribeAssy=PAU-X5;ReplaceNameAssy=PAU-X5
Ability: UCSStore=0
Content-Length: 0

]

@negbie
Copy link
Collaborator

negbie commented Oct 22, 2020

Look at your contact header.

@negbie
Copy link
Collaborator

negbie commented Oct 22, 2020

It's not a valid URI.

Edit: It's valid

@negbie
Copy link
Collaborator

negbie commented Oct 22, 2020

Oh just checked the abnf and seems to be valid

Contact = ( "Contact" | "m" ) ":" ( "*" | ( 1#( ( name-addr | addr-spec ) *( ";" contact-params ) ) ) )

@negbie
Copy link
Collaborator

negbie commented Oct 22, 2020

Related to this:

Registrations expire as described above or may be removed explicitly
by setting the expires parameter for an existing registration to zero
or including an Expires: 0 header field. Registrations are matched
based on the user, host, port and maddr parameters. A client can
remove all registrations by including a single Contact header field
with the wildcard address "*". This usage is only allowed in REGISTER
requests when a Expires header with value of zero is present.

@negbie
Copy link
Collaborator

negbie commented Oct 22, 2020

Since Expire is 0 in your case Contact: * is correct.

@jart jart changed the title The following message parsing failed: Error in SIP message at line 0 offset 0 Support Wildcard Contact Oct 22, 2020
@jart
Copy link
Owner

jart commented Oct 22, 2020

Indeed. Thanks for the report @umbrellary. This sounds like a simple fix. Would you like to send us a pull request adding a special case for star contact? We should be able to merge that right away. Otherwise we can fix it for you in the next round of changes.

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

No branches or pull requests

3 participants