baresip: From URI does not match AoR
My account is like this:
--- sip:test%401@foo.bar ---
nrefs: 1
cuser: test%401-0x55ab26979e70
pub-gruu:
Supported: gruu,path,outbound,replaces,norefersub
Account:
address: <sip:test%401@foo.bar>;audio_codecs=PCMU,PCMA;regint=0;pubint=0;...
luri: sip:test%401@foo.bar
aor: sip:test%401@foo.bar
When the UA makes a call, From header looks like this:
INVITE sip:bar@test.tutpro.com SIP/2.0
Via: SIP/2.0/TCP 192.168.188.215:5020;branch=z9hG4bK986088d8c51fb5b6;rport
Contact: <sip:test%401-0x55ab26979e70@192.168.188.215:5020;transport=tcp>
Max-Forwards: 70
To: <sip:bar@test.tutpro.com>
From: <sip:test%25401@foo.bar>;tag=e0f802f01da481de
The AoR has character @ that according to RFC 3261 needs to be escaped and written as %40.
Why is the escape prefix % escaped?
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 32 (10 by maintainers)
@juha-h I had another discussion with @cspiel1, we agreed to revert my recent URI escaping commits to restore the old behavior. We will make sure to enter escaped URIs into BareSIP.
I apologize for causing breaks, we were not fully aware of how others used BareSIP.
Maximilian Fridrich writes:
My understanding is that each line in accounts file is a SIP URI that follows SIP URI syntax. If it is not a SIP URI, then accounts file could be, for example, an xml file.
But it would be fine with me to have a config variable that tells if AoR user follows RFC3261 syntax or follows some other syntax that is described in the Wiki. The “some other syntax” must also allow @ character in AoR user.
Due to the complexity of URI escaping we should at least offer an UTF-8 compatible
uanewcommand and account file parsing in moduleaccount. Maybe activate/deactivate the escaping via a config option?Again, we interpreted the text in the accounts file or the string received by the command
uanewas raw, unescaped strings. Your interpretation is probably valid too, and maybe would be better/easier.Keep in mind though that this means your application needs to know the RFC quite well too, and the BNF is not trivial. Further, it needs to know exactly how the URIs are assembled and sent if there are different fields for user, host, display name etc - e.g. if the display name is sent with double quotes around it or not. See:
I am not sure what the correct interpretation of the accounts file and
uanewargument is. Could someone else chime in? @alfredh @sreimers