Pjsip trunk and @ in the username

Hello everyone, I just cannot find a solution in this! The provider requires @ in the username (+255xxxx@www.xxx.com), but pjsip keeps rejecting the URI with error:

How can I use “@” in the username?

how it can accept:
server_uri=sip:+255xxxx@www.xxx.com@ ???

It can’t, because that’s not valid SIP. What that usually means is either the realm is “www.xxx.com” or they’re using an outbound proxy where the proxy is “” and the target URI is “www.xxx.com”.

Isn’t this just another way of asking the same question you already asked here: IMS domain via Proxy IP using PJSIP

1 Like

The usual way of including special characters in URI’s is by using URI encoding.

I was tempted to request a thread merge here.

I think the real problem is that the OP is insisting that the information they have given is correct, and is failing to provide anything that would allow us to work out what the provider really wants. Their current interpretation amounts to that the provider is violating the protocol, which reduces the likelihood that it is correct, but Joshua’s interpretation may be right. Also, before they started the new thread for the same issue, the possibility of this just being a case of assuming the user agent URI encoded transparently, was also suggested, so I would have assumed they had tried that, and it had failed.

I asked for the, working, sip.conf settings, which would have given a clue as to what was wanted, although I’d have to check the code to see if chan_sip transparently URI encodes.

There are two fields that might be called user name fields in SIP: the URI user part; and the authentication user name. The former definitely doesn’t allow @. The latter might. They are set in different places.

1 Like

Correct, however, in most cases, these are treated equally. At least every single case I’ve seen in the real world.

I’m going to give the example from my pjsip conf:

type = registration
transport = transport-udp
outbound_auth = voipms
client_uri = sip:UID_asterisk@washington2.voip.ms:5060
server_uri = sip:washington2.voip.ms:5060

Server_uri shouldn’t have the user@ prefix.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.