Pjsip - endpoint setting for Sip Pri

Hello,
I am trying to switch latest centos and asterisk 18.4 , but issue to setup Sip Pri with pjsip.
Please guide. username - +9111412123XX@ims.airtel.in

[AirtelTrunk]
type=registration
;outbound_auth=AirtelTrunk-auth
server_uri=sip:ims.airtel.in
client_uri=sip:+9111412123XX@ims.airtel.in
contact_user=+9111412123XX@ims.airtel.in
retry_interval=60
line=yes
endpoint=+9111412123XX@ims.airtel.in
auth_rejection_permanent=no

[+9111412123XX@ims.airtel.in]
type=endpoint
;transport=transport-udp-nat
context=default
disallow=all
allow=gsm,ulaw,alaw
;outbound_auth=AirtelTrunk-auth
aors=AirtelTrunkAor
;direct_media=no
;trust_id_outbound=yes
;device_state_busy_at=1
dtmf_mode=rfc4733
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
;from_user=+9111412123XX@ims.airtel.in
from_domain=ims.airtel.in

[AirtelTrunk-auth]
type=auth
auth_type=userpass
password=XXXXXXXX
username=+9111412123XX@ims.airtel.in
realm=ims.airtel.in

[AirtelTrunkAor]
type=aor
;contact=sip:+9111412123XX@ims.airtel.in:5060
contact=sip:ims.airtel.in
qualify_frequency=60
;max_contacts=10

[AirtelTrunk]
type=identify
endpoint=+9111412123XX@ims.airtel.in
match=ims.airtel.in

PRI normally means Primary Rate Interface, which is fundamentally incompatible with VoIP, and only applies to circuit switched connections.

These are almost certainly wrong. They are workarounds for when the endpoint is inside NAT, but doesn’t compensate for it, and asterisk is outside. You have no configuration for asterisk inside NAT, so I assume both you and the ITSP are on public addresses. (I think the same applies to Rewrite Contact, but I’m not so sure on that.)

Are you sure the username is not just +9111412123XX? @'s in URI users get messy, and do you really need an authentication user?

You are missing a transport section.

You are going to need the outbound authentication un-commenting.

I’d be surprised if you didn’t need the From user. Including @domain, in that, is inconsistent with your client URI in the registration.

The basic framework for ITSPs as end points is given in res_pjsip Configuration Examples - Asterisk Project - Asterisk Project Wiki but, as it says, details may vary, and only another user of your ITSP is likely to know the exact details.

What error messages do you get? If the REGISTER is sent, what does pjsip set logger on show as the response?

If you need to use outbound registration, you shouldn’t have it commented

Example taken from res_pjsip Configuration Examples - Asterisk Project - Asterisk Project Wiki

;==============TRANSPORTS

[simpletrans]

type=transport

protocol=udp

bind= 0.0 . 0.0

;===============TRUNK

[mytrunk]

type=registration

outbound_auth=mytrunk

server_uri=sip:sip.example.com

client_uri=sip: 1234567890 @sip .example.com

retry_interval= 60

[mytrunk]

type=auth

auth_type=userpass

password= 1234567890

username= 1234567890

[mytrunk]

type=aor

contact=sip:sip.example.com: 5060

[mytrunk]

type=endpoint

context=from-external

disallow=all

allow=ulaw

outbound_auth=mytrunk

aors=mytrunk

[mytrunk]

type=identify

endpoint=mytrunk

match=sip.example.com

thanks for reply. I applied guidelines but still unable to register.

myusername - +911141212300@ims.airtel.in@ims.airtel.in

following command belong to my old version asterisk 1.8, where it is working fine.
register => +911141212300:xxxxxxx:+911141212300@ims.airtel.in@ims.airtel.in/+911141212300

[transport-udp-nat]
type = transport
protocol = udp
bind = 0.0.0.0

[+911141212300@ims.airtel.in]
type=registration
outbound_auth=AirtelTrunk-auth
server_uri=sip:ims.airtel.in
client_uri=sip:+911141212300@ims.airtel.in
;contact_user=+911141212300@ims.airtel.in
retry_interval=60
;line=yes
;endpoint=+911141212300@ims.airtel.in
;auth_rejection_permanent=no

[+911141212300@ims.airtel.in]
type=endpoint
transport=transport-udp-nat
context=default
disallow=all
allow=gsm,ulaw,alaw
outbound_auth=AirtelTrunk-auth
aors=AirtelTrunkAor
;direct_media=no
;trust_id_outbound=yes
;device_state_busy_at=1
dtmf_mode=rfc4733
;rtp_symmetric=yes
;force_rport=yes
rewrite_contact=yes
from_user=+911141212300
from_domain=ims.airtel.in
[AirtelTrunk-auth]
type=auth
auth_type=userpass
password=xxxxxxxxxx
username=+911141212300@ims.airtel.in
realm=ims.airtel.in

[AirtelTrunkAor]
type=aor
;contact=sip:+911141212300@ims.airtel.in:5060
contact=sip:ims.airtel.in:5060
qualify_frequency=60
;max_contacts=10

[AirtelTrunk]
type=identify
endpoint=+911141212300@ims.airtel.in
match=ims.airtel.in

If they are stupid enough to include an @ in the user field, I guess that would have to be:


client_uri=sip:+911141212300%40ims.airtel.in@ims.airtel.in

However, if they are doing silly things like including “@” in SIP userinfo fields, you should ask them what they actually want to see over the wire, rather than what has to be entered into your device. If they really say they need two @'s, there implementation is broken.

Did from user really work without the @ in chan_sip? Do they need from user at all?

Hello David, thanks for reply, I already implemented/tried same but result is same, not registered.
client_uri=sip:+911141212300%40ims.airtel.in@ims.airtel.in

[+911141212300@ims.airtel.in]
type=registration
outbound_auth=AirtelTrunk-auth
server_uri=sip:ims.airtel.in
;client_uri=sip:+911141212300@ims.airtel.in
client_uri=sip:+911141212300%40ims.airtel.in@ims.airtel.in
;contact_user=+911141212300@ims.airtel.in
retry_interval=60
;line=yes
;endpoint=+911141212300@ims.airtel.in
;auth_rejection_permanent=no

You haven’t provided logs of error messages or protocol.

As I said, you need to ask the provider what they expect over the wire. A typical example would be most useful.

pls check current log,
Yes I contacted service provider but no solution yet.

– Reloading module ‘res_pjsip_authenticator_digest.so’ (PJSIP authentication resource)
– Reloading module ‘res_pjsip_endpoint_identifier_ip.so’ (PJSIP IP endpoint identifier)
– Reloading module ‘res_pjsip_mwi.so’ (PJSIP MWI resource)
– Reloading module ‘res_pjsip_notify.so’ (CLI/AMI PJSIP NOTIFY Support)
– Reloading module ‘res_pjsip_outbound_publish.so’ (PJSIP Outbound Publish Support)
– Reloading module ‘res_pjsip_publish_asterisk.so’ (PJSIP Asterisk Event PUBLISH Support)
– Reloading module ‘res_pjsip_outbound_registration.so’ (PJSIP Outbound Registration Support)
localhost*CLI> pjsip list registrations

<Registration/ServerURI…> <Auth…> <Status…>

+911141212300@ims.airtel.in/sip:ims.airtel.in:5060 AirtelTrunk-auth Unregistered

Objects found: 1

[Jun 7 18:40:46] WARNING[2766]: res_pjsip_outbound_registration.c:894 schedule_retry: No response received from ‘sip:ims.airtel.in:5060’ on registration attempt to ‘sip:+911141212300%40ims.airtel.in@ims.airtel.in:5060’, retrying in ‘30’

+911141212300@ims.airtel.in/sip:ims.airtel.in:5060 AirtelTrunk-auth Rejected

Objects found: 1

[Jun 7 18:42:20] WARNING[2766]: res_pjsip_outbound_registration.c:894 schedule_retry: No response received from ‘sip:ims.airtel.in:5060’ on registration attempt to ‘sip:+911141212300%40ims.airtel.in@ims.airtel.in:5060’, retrying in ‘30’

This sounds like a connectivity problem (e.g. NAT or firewall), rather than an authentication one. I notice that your transport section mentions nat in its name but has no information that would allow it to work properly from behind NAT.

firewall is already off, can you guide for nat issue.

asterisk]# sestatus
SELinux status: disabled

[root@localhost asterisk]# systemctl disable firewalld.service

If you are behind NAT, you need to tell Asterisk how to find its public IP address.

https://wiki.asterisk.org/wiki/display/AST/Configuring+res_pjsip+to+work+through+NAT#Configuringres_pjsiptoworkthroughNAT-AsteriskandPhonesConnectingThroughNATtoanITSP

[transport-udp-nat]
type = transport
protocol = udp
bind = 0.0.0.0
local_net=192.168.1.0/24
external_media_address=10.232.130.170
external_signaling_address=10.232.130.170

CLI> pjsip reload
Module ‘res_pjsip.so’ reloaded successfully.
Module ‘res_pjsip_authenticator_digest.so’ reloaded successfully.
Module ‘res_pjsip_endpoint_identifier_ip.so’ reloaded successfully.
Module ‘res_pjsip_mwi.so’ reloaded successfully.
Module ‘res_pjsip_notify.so’ reloaded successfully.
Module ‘res_pjsip_outbound_publish.so’ reloaded successfully.
Module ‘res_pjsip_publish_asterisk.so’ reloaded successfully.
Module ‘res_pjsip_outbound_registration.so’ reloaded successfully.
– Reloading module ‘res_pjsip.so’ (Basic SIP resource)
[Jun 7 19:21:00] NOTICE[2766]: sorcery.c:1348 sorcery_object_load: Type ‘system’ is not reloadable, maintaining previous values
– Reloading module ‘res_pjsip_authenticator_digest.so’ (PJSIP authentication resource)
– Reloading module ‘res_pjsip_endpoint_identifier_ip.so’ (PJSIP IP endpoint identifier)
– Reloading module ‘res_pjsip_mwi.so’ (PJSIP MWI resource)
– Reloading module ‘res_pjsip_notify.so’ (CLI/AMI PJSIP NOTIFY Support)
– Reloading module ‘res_pjsip_outbound_publish.so’ (PJSIP Outbound Publish Support)
– Reloading module ‘res_pjsip_publish_asterisk.so’ (PJSIP Asterisk Event PUBLISH Support)
– Reloading module ‘res_pjsip_outbound_registration.so’ (PJSIP Outbound Registration Support)
localhost*CLI> pjsip list registrations

<Registration/ServerURI…> <Auth…> <Status…>

+911141212300@ims.airtel.in/sip:ims.airtel.in:5060 AirtelTrunk-auth Rejected

These are not public addresses. You are going to need to tell us a lot more about the structure of your network, as some ITSPs do use a dedicated private network for VoIP services, but we need to know more to know whether these can be treated as extensions of your private LAN, are better treated as public, or you have a fundamental conflict between real public addresses and pseudo ones.

Also, please use the forum </>, pre-formatted text, button, to prevent parts of your logs, etc., being treated as mark-up.

PS. There is no logging of a registration failure, so it may not have tried a re-registration, yet.

Dear David, Is that possible for you to spare 5 minutes to access my system through remote.

One more thing that in this unregistered situation, inbound calls are coming but disconnecting in few seconds.
this is my network provided by service provider - Airtel
P Address 10.204.55.22
Network Address: 10.204.55.20 / 30
gateway - 10.232.130.170

David, Can i use Sip instead of pjsip in my asterisk 18.4

as sip is working fine with current settings.
pls help to resolve issue.

chan_sip has not been removed from the source code, yet. However, I believe it is either not built, or not loaded, by default.

Can you pls guide to implement/restore Sip in asterisk 18.4 and make disabled PjSip to start using my Pri line functioning as working now fine with old version.
thanks

GitHub - asterisk/asterisk at 18.4 and in particular step 3 in NEW INSTALLATIONS.

So it means , we can not use sip in this version.
this is your mean, or do you have some solution for my problem.