Pjsip trunk with @ in username

Hello,
i have start to move my trunks to pjsip.
One of my providers use the symbol @ in the username. So the username is like a email (for example [email protected])
However as far i have see in my tests in pjsip the @ is not allowed in username.
How i can solve this? It is any way to bypass this?
Thank you

Set up a PJ-SIP debug and see what the system is actually sending to the provider. It would be really unusual for a SIP provider to set up a system where the registration name had an additional @ in it (since the registration name normally gets one built like that).

My suspicion is that the the information in the PJ-SIP setting may not be completely set up to match. Without more information, though, it’s all conjecture.

Try escaping the @ by putting a \ character in front of it.

yes it is not usual but happen in the biger provider in my Country.
This is the error i have in the trunk:

[2020-04-24 14:09:29] ERROR[7599]: res_pjsip_outbound_registration.c:1377 sip_outbound_registration_regc_alloc: Invalid client URI ‘sip:+my_number@myprovider.com@myprovider.com:5060’ specified on outbound registration ‘+my_number

in plain sip trunk this is the working config:
PEER Details:
username=+my_number
type=peer
secret=xxxxxxxx
qualify=yes
keepalive=45
insecure=invite
host=myprovider.com
fromuser=+my_number
fromdomain=myprovider.com
dtmfmode=rfc2833
disallow=all
directmedia=no
context=from-trunk
allow=alaw

USER Details:
type=user
secret=xxxxxxxx
host=myprovider.com
context=from-trunk

Register String:
+my_number:xxxxxxxx:+my_number@myprovider.com@myprovider.com:5060/+my_number

If i want to register my provider direct to my phone i use this:
Authentication name:+my_number@myprovider.com
Username:+my_number

thank you

so the username can be like this?

48845458\@myprovider.com

here is the new error i have:

[2020-04-24 14:24:14] ERROR[10960]: res_pjsip_outbound_registration.c:1377 sip_outbound_registration_regc_alloc: Invalid client URI 'sip:+_my_number_\@[email protected]:5060' specified on outbound registration '+_my_number_'
[2020-04-24 14:24:14] ERROR[7599]: res_sorcery_config.c:408 sorcery_config_internal_load: Could not create an object of type 'registration' with id '+_my_number_' from configuration file 'pjsip.conf'

it is really a limit in the username field? Or it is a bug so i have to report a bug?
Also this limit is related to freepbx or to asterisk?

You just need to fill out the number before the @ symbol.
Thats the way a SIP registration is being made: loginname@provider_ip_or_dnsname, so right now you are doing it double:
[email protected]@sipprovider.com
instead of:
[email protected]

yes my provider use as username the [email protected] so in order to register in sip trunk need to do the registration in this way:
[email protected]@sipprovider.com
In sip trunk is working without any problem.
However in pjsip is not working, i have write the errors in the above posts.
is any way to doit? I have try the same with 3cx and is working fine so only in pjsip i have problem.
Thank you

Show your actually settings for this Chan_PJSIP trunk that you put in and don’t work. Screenshot all of it and post it. You clearly have a setting wrong.

RFC 3261 and RFC 2396 specify that @ sign in the user part of a URI should be encoded with % hex codes.

That would end up looking like mynumber%[email protected]

3 Likes

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