How to configure PJSIP Endpoint and Dialplan on Oracle Linux 9.3

To Create And Connect PJSIP Endpoints On Asterisk On Oracle Linux 9.3

Introduction:

A SIP endpoint is simply a configuration profile for a device such as a phone or a remote server. Asterisk Dialplan context, which handles calls originating from the endpoint, and the audio codecs allowed for the endpoint are defined here.

Procedure:

Step 1: Check the OS version by using the below command

[root@linuxhelp ~]# cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="9.3"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="9.3"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Oracle Linux Server 9.3"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:9:3:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://github.com/oracle/oracle-linux"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 9"
ORACLE_BUGZILLA_PRODUCT_VERSION=9.3
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=9.3

Step 2: Go to the Following location by using the below command

root@linuxhelp:-# cd /etc/asterisk

Step 3: Edit and Make endpoint configuration on pjsip.conf file by using the below command

root@linuxhelp:/etc/asterisk# vim pjsip.conf
[tcp_transport]
type=transport ; Must be of type 'transport'
protocol=tcp
bind=0.0.0.0
tos=cs3
cos=3
allow_reload=false
[udp_transport]
type=transport ; Must be of type 'transport'
protocol=udp
bind=0.0.0.0
tos=cs3
cos=3
allow_reload=false

[167]
auth_type=userpass
type=auth
username=167
password=123456

[167]
type=aor
qualify_frequency=60
max_contacts=1
remove_existing=yes
qualify_timeout=3.0
authenticate_qualify=no

[167]
context=internal
language=en
deny=0.0.0.0/0.0.0.0
trust_id_inbound=yes
send_rpid=no
rtcp_mux=no
call_group=
pickup_group=
disallow=all
allow=ulaw,alaw,g722,gsm,vp9,vp8,h264,opus
;dtls_auto_generate_cert=yes
;webrtc=yes
permit=0.0.0.0/0.0.0.0
ice_support=no
use_avpf=no
dtls_cert_file=
dtls_private_key=
dtls_ca_file=
dtls_setup=actpass
dtls_verify=no
media_encryption=no
message_context=
subscribe_context=
allow_subscribe=yes
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
direct_media=no
media_use_received_transport=no
auth=167
aors=167
type=endpoint
mailboxes=63121@63
callerid="User" <167>

[168]
auth_type=userpass
type=auth
username=168
password=123456

[168]
type=aor
qualify_frequency=60
max_contacts=1
remove_existing=yes
qualify_timeout=3.0
authenticate_qualify=no


[168]
context=internal
language=en
deny=0.0.0.0/0.0.0.0
trust_id_inbound=yes
send_rpid=no
rtcp_mux=no
call_group=
pickup_group=
disallow=all
allow=ulaw,alaw,g722,gsm,vp9,vp8,h264,opus
;dtls_auto_generate_cert=yes
;webrtc=yes
permit=0.0.0.0/0.0.0.0
ice_support=no
use_avpf=no
dtls_cert_file=
dtls_private_key=
dtls_ca_file=
dtls_setup=actpass
dtls_verify=no
media_encryption=no
message_context=
subscribe_context=
allow_subscribe=yes
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
direct_media=no
media_use_received_transport=no
auth=168
aors=168
type=endpoint
mailboxes=63121@63
callerid="User" <168>

Step 4: Edit and Make Dialplan Configuration on extensions.conf file by using the below command

root@linuxhelp:/etc/asterisk# vim extensions.conf
[internal]
exten => 167,1,Dial(PJSIP/167)
exten => 168,1,Dial(PJSIP/168)

Step 5: Login to Asterisk Console by using the below command

root@linuxhelp:~# asterisk -rvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Asterisk 20.4.0, Copyright (C) 1999 - 2022, Sangoma Technologies Corporation and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 20.5.0 currently running on linuxhelp (pid = 910)
linuxhelp*CLI>

Step 6: Reload the pjsip by using following command

linuxhelp*CLI> core reload
    -- Reloading module 'extconfig' (Configuration)
    -- Reloading module 'logger' (Logger)
 Asterisk Queue Logger restarted
    -- Reloading module 'cdr' (CDR Engine)
[Feb 20 01:08:08] NOTICE[7614]: cdr.c:4568 cdr_toggle_runtime_options: CDR simple logging enabled.
    -- Reloading module 'cel' (CEL Engine)
    -- CEL logging disabled.
    -- Reloading module 'dnsmgr' (DNS Manager)
    -- Reloading module 'dsp' (DSP)
    -- Reloading module 'enum' (ENUM Support)
    -- Reloading module 'features' (Call Features)
    -- Reloading module 'http' (Built-in HTTP Server)
    -- Reloading module 'indications' (Indication Tone Handling)
    -- Reloading module 'acl' (Named ACL system)
    -- Reloading module 'manager' (Asterisk Manager Interface)
    -- Reloading module 'plc' (PLC)
    -- Reloading module 'udptl' (UDPTL)
    -- Reloading module 'res_pjproject.so' (PJPROJECT Log and Utility Support)
    -- Reloading module 'res_pjsip.so' (Basic SIP resource)
[Feb 20 01:08:08] NOTICE[7394]: 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_musiconhold.so' (Music On Hold Resource)
    -- Reloading module 'res_rtp_asterisk.so' (Asterisk RTP Stack)
    -- Reloading module 'res_pjsip_outbound_publish.so' (PJSIP Outbound Publish Support)
    -- Reloading module 'res_pjsip_mwi.so' (PJSIP MWI resource)
    -- Reloading module 'res_pjsip_publish_asterisk.so' (PJSIP Asterisk Event PUBLISH Support)
    -- Reloading module 'res_pjsip_notify.so' (CLI/AMI PJSIP NOTIFY Support)
    -- Reloading module 'res_pjsip_outbound_registration.so' (PJSIP Outbound Registration Support)
    -- Reloading module 'app_confbridge.so' (Conference Bridge Application)
    -- Reloading module 'cdr_custom.so' (Customizable Comma Separated Values CDR Backend)
    -- Reloading module 'app_playback.so' (Sound File Playback Application)
    -- Reloading module 'app_voicemail.so' (Comedian Mail (Voicemail System))
    -- Reloading module 'pbx_config.so' (Text Extension Configuration)
    -- Time to scan old dialplan and merge leftovers back into the new: 0.000004 sec
    -- Time to restore hints and swap in new dialplan: 0.000004 sec
    -- Time to delete the old dialplan: 0.000004 sec
    -- Total time merge_contexts_delete: 0.000012 sec
    -- pbx_config successfully loaded 1 contexts (enable debug for details).
    -- Reloading module 'app_queue.so' (True Call Queueing)
[Feb 20 01:08:08] NOTICE[7614]: app_queue.c:9576 reload_queue_rules: queuerules.conf has not changed since it was last loaded. Not taking any action.

Step 7: Show the Endpoints details by using the below command

linuxhelp*CLI> pjsip show endpoints
 Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
    I/OAuth:  <AuthId/UserName...........................................................>
        Aor:  <Aor............................................>  <MaxContact>
      Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
  Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
   Identify:  <Identify/Endpoint.........................................................>
        Match:  <criteria.........................>
    Channel:  <ChannelId......................................>  <State.....>  <Time.....>
        Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
==========================================================================================
 Endpoint:  167/167                                              Not in use    0 of inf
     InAuth:  167/167
        Aor:  167                                                1
      Contact:  167/sip:167@192.168.6.102:52377;transport= 6efe417199 Avail         8.366
 Endpoint:  168/168                                              Not in use    0 of inf
     InAuth:  168/168
        Aor:  168                                                1
      Contact:  168/sip:168@192.168.6.102:65374;ob         0e009f1274 Avail         4.676
Objects found: 2

Step 8: Show the Authendicaton details by using following command

linuxhelp*CLI> pjsip show auths
  I/OAuth:  <AuthId/UserName.............................................................>
==========================================================================================
     Auth:  167/167
     Auth:  168/168
Objects found: 2

Step 9: Show the aor (Address Of Records) Details by using following command

linuxhelp*CLI> pjsip show aors
      Aor:  <Aor..............................................>  <MaxContact>
    Contact:  <Aor/ContactUri............................> <Hash....> <Status> <RTT(ms)..>
==========================================================================================
      Aor:  167                                                  1
    Contact:  167/sip:167@192.168.6.102:52377;transport=TC 6efe417199 Avail         4.640
      Aor:  168                                                  1
    Contact:  168/sip:168@192.168.6.102:65374;ob           0e009f1274 Avail         1.257
Objects found: 2

Step 10: Reload the dialplan by using the below command

linuxhelp*CLI> dialplan reload
Dialplan reloaded.
    -- Time to scan old dialplan and merge leftovers back into the new: 0.000004 sec
    -- Time to restore hints and swap in new dialplan: 0.000006 sec
    -- Time to delete the old dialplan: 0.000003 sec
    -- Total time merge_contexts_delete: 0.000013 sec
    -- pbx_config successfully loaded 1 contexts (enable debug for details)

Step 11: Open Zoiper Software by click continue as a free user as shown in below image

Step 12: Give the Username, Password and Click Login as shown in below image

Step 13: Fill in Server Hostname as shown in below image

Step 14: Zoiper5 Dashboard Will Open as shown in below image

Step 15: Open Microsip and configure endpoint details as shown in below image

Step 16: Make call from one extension to another extension as shown in below image

Conclusion

We have reached the end of this article. In this guide, we have walked you through the steps required to create PJSIP endpoint and Dialplan on Oracle Linux 9.3. Your feedback is much welcome.

FAQ
Q
How to reload the extensions.conf file?
A
By running the following command dialplan reload
Q
How do reload the pjsip.conf file?
A
By running the following command pjsip reload
Q
What is an Asterisk call?
A
Asterisk is a powerful tool for building call center systems and solutions.
Q
What is an SIP endpoint?
A
A SIP endpoint is a device that makes and receives calls through your gateway.
Q
What is Dialplan in Asterisk?
A
The Asterisk dialplan is responsible for routing calls, often called the heart of an Asterisk system.