• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to create and connect PJSIP Endpoints using Asterisk on Rocky Linux 9.4

  • 00:36 Cat /etc/os-release
  • 00:57 systemctl status asterisk
  • 01:18 cd /etc/asterisk
  • 01:30 vim pjsip.conf
  • 02:19 vim extensions.conf
  • 02:47 systemctl stop firewalld
  • 03:05 asterisk -rvvvvvvvvvvvvvvvvv
  • 03:16 core reload
  • 03:29 pjsip show endpoints
  • 03:49 pjsip show auths
  • 04:05 pjsip show aors
  • 04:14 dialplan reload
  • 06:08 pjsip show endpoints
7871

To Create And Connect PJSIP Endpoints Using Asterisk On Rocky Linux 9.4

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="Rocky Linux"
VERSION="9.4 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.4"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.4 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.4"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.4"

Step 2: Verify the status of the Asterisk by using the below command

[root@Linuxhelp ~]# systemctl status asterisk
● asterisk.service - LSB: Asterisk PBX
     Loaded: loaded (/etc/rc.d/init.d/asterisk; generated)
     Active: active (running) since Sun 2024-06-23 23:24:59 IST; 2h 15min ago
       Docs: man:systemd-sysv-generator(8)
   Main PID: 1224
      Tasks: 38 (limit: 48597)
     Memory: 62.4M
        CPU: 3.305s
     CGroup: /system.slice/asterisk.service
             ├─1221 /bin/sh /usr/sbin/safe_asterisk
             └─5288 /usr/sbin/asterisk -f -vvvg -c

Jun 23 23:24:59 Linuxhelp systemd[1]: Starting LSB: Asterisk PBX...
Jun 23 23:24:59 Linuxhelp asterisk[1140]: Starting asterisk:
Jun 23 23:24:59 Linuxhelp systemd[1]: asterisk.service: Can't open PID file /run/asterisk/asterisk.pid (yet?) >
Jun 23 23:24:59 Linuxhelp systemd[1]: asterisk.service: Supervising process 1224 which is not our child. We'll>
Jun 23 23:24:59 Linuxhelp systemd[1]: Started LSB: Asterisk PBX.
Jun 23 23:25:54 Linuxhelp systemd[1]: /run/systemd/generator.late/asterisk.service:30: PIDFile= references a p>
Jun 23 23:26:17 Linuxhelp systemd[1]: /run/systemd/generator.late/asterisk.service:30: PIDFile= references a p>

Step 3: Change the directory to the Asterisk configuration location by using the below command

[root@Linuxhelp ~]# cd /etc/asterisk/

Step 4: Add the following lines in pjsip.conf file by using vim text editor

[root@Linuxhelp 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 5: Add the following lines in extensions.conf for dialplan by using the vim editor

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

Step 6: Stop the firewall service by using the below command

[root@Linuxhelp asterisk]# systemctl stop firewalld

Step 7: Login to Asterisk Console by using below command

[root@Linuxhelp asterisk]# asterisk -rvvvvvvvvvvvvvvvvv
Asterisk 20.8.1, 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.8.1 currently running on Linuxhelp (pid = 5288)
Linuxhelp*CLI> 

Step 8: Reload the pjsip by using below command

Linuxhelp*CLI> core reload
    -- Reloading module 'extconfig' (Configuration)
    -- Reloading module 'logger' (Logger)
 Asterisk Queue Logger restarted
    -- Reloading module 'cdr' (CDR Engine)
[Jun 24 01:47:29] NOTICE[6466]: 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)
[Jun 24 01:47:29] ERROR[6467]: res_pjsip/config_transport.c:992 transport_apply: Transport 'udp_transport' could not be started: Address already in use
[Jun 24 01:47:29] ERROR[6467]: res_sorcery_config.c:422 sorcery_config_internal_load: Could not create an object of type 'transport' with id 'udp_transport' from configuration file 'pjsip.conf'
[Jun 24 01:47:29] NOTICE[6467]: sorcery.c:1348 sorcery_object_load: Type 'system' is not reloadable, maintaining previous values
  == Endpoint dcs-endpoint is now Unreachable
  == Contact dcs-aor/sip:sip.digiumcloud.net has been deleted
    -- 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.000027 sec
        > Time to restore hints and swap in new dialplan: 0.000002 sec
        > Time to delete the old dialplan: 0.000031 sec
        > Total time merge_contexts_delete: 0.000060 sec
        > pbx_config successfully loaded 13 contexts (enable debug for details).
    -- Reloading module 'app_queue.so' (True Call Queueing)
[Jun 24 01:47:29] NOTICE[6466]: app_queue.c:9607 reload_queue_rules: queuerules.conf has not changed since it was last loaded. Not taking any action.

Step 9: Show the Endpoints details by using 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                                              Unavailable   0 of inf
     InAuth:  167/167
        Aor:  167                                                1

 Endpoint:  168/168                                              Unavailable   0 of inf
     InAuth:  168/168
        Aor:  168                                                1


Objects found: 2

Step 10: Show the Authendicaton details by using below command

Linuxhelp*CLI> pjsip show auths

  I/OAuth:  <AuthId/UserName.............................................................>
==========================================================================================

     Auth:  167/167
     Auth:  168/168

Objects found: 2

Step 11: Show the AORs (Address Of Records) Details by using below command

Linuxhelp*CLI> pjsip show aors

      Aor:  <Aor..............................................>  <MaxContact>
    Contact:  <Aor/ContactUri............................> <Hash....> <Status> <RTT(ms)..>
==========================================================================================

      Aor:  167                                                  1

      Aor:  168                                                  1


Objects found: 2

Step 12: 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.000002 sec
        > Time to restore hints and swap in new dialplan: 0.000002 sec
        > Time to delete the old dialplan: 0.000002 sec
        > Total time merge_contexts_delete: 0.000006 sec
        > pbx_config successfully loaded 1 contexts (enable debug for details).

Step 13: Open Zoiper Software and click continue as a free user as shown in below image

Snap1

Step 14: Enter Username and Password which is configured in the pjsip.cof file then Click Login as shown in below image

Snap2

Step 15: Here enter the server ip address as shown in below image

Snap3

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

Snap4

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

Snap5

Step 18: After configured two endpoint on Zoiper and Microsip then go to asterisk cli and again view the Endpoints details by using below command. It shows the endpoint is in available state

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:50415;transport= 2d06f1f119 Avail         3.338

 Endpoint:  168/168                                              Not in use    0 of inf
     InAuth:  168/168
        Aor:  168                                                1
      Contact:  168/sip:168@192.168.6.102:64058;ob         0af434c468 Avail         0.397


Objects found: 2

Step 19: Finally make a call from one extension to another extension as shown in below image

Snap6 Snap8 Snap7

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to create and connect PJSIP Endpoints using Asterisk on Rocky Linux 9.4. Your feedback is much welcome.

Tags:
michael
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

What is an Asterisk call?

A

Asterisk is a powerful tool for building call center systems and solutions.

Q

What is PJSIP in Asterisk?

A

PJSIP is a SIP (Session Initiation Protocol) stack that integrates with Asterisk to provide functionality for voice, video, presence, and instant messaging communications.

Q

What is SIP in an Asterisk?

A

The SIP Channel Module enables Asterisk to communicate via VoIP with SIP telephones and exchanges.

Q

How do I dial from the CLI?

A

You’ll need chan_oss for that. chan_oss provides a “dial” command from the CLI that connects the soundcard (via chan_oss) to the outgoing line. By including the module chan_oss, you’ll find a new “dial” command on the CLI.

Q

What is RTP in Asterisk?

A

The rtp.conf file controls the Real-time Transport Protocol (RTP) ports that Asterisk uses to generate and receive RTP traffic.

Related Tutorials in How to create and connect PJSIP Endpoints using Asterisk on Rocky Linux 9.4

Related Tutorials in How to create and connect PJSIP Endpoints using Asterisk on Rocky Linux 9.4

How to install Xrdp Server (Remote Desktop) on Oracle Linux 8.5
How to install Xrdp Server (Remote Desktop) on Oracle Linux 8.5
Oct 17, 2022
How to install and update OpenSSL on Debian 11.3
How to install and update OpenSSL on Debian 11.3
Oct 21, 2022
How to Install and Configure Mega in Linux
How to Install and Configure Mega in Linux
Jul 19, 2016
How to use Aureport command on Linux
How to use Aureport command on Linux
Nov 28, 2017
How to install and configure Asterisk in CentOS
How to install and configure Asterisk in CentOS
Jul 19, 2016
How to install Development tools on Linux
How to install Development tools on Linux
Jun 12, 2018
How to Install mod_ssl and SSL certificate on Oracle Linux
How to Install mod_ssl and SSL certificate on Oracle Linux
Dec 30, 2021
How to install Nextcloud on Ubuntu 22.04 version
How to install Nextcloud on Ubuntu 22.04 version
Jun 23, 2023

Related Forums in How to create and connect PJSIP Endpoints using Asterisk on Rocky Linux 9.4

Related Forums in How to create and connect PJSIP Endpoints using Asterisk on Rocky Linux 9.4

Linux
jayce class=
shasum command not found
May 5, 2017
Linux
stephan class=
How to list all samba users
Jan 12, 2018
pv command
muhammad class=
pvcreate command not found error
May 9, 2017
Linux
henry class=
Starting NFS daemon: rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)
Apr 25, 2017
ifconfig command
jackbrookes class=
what is the location of the ifconfig program on your machine?
Jan 4, 2018
Linux
baseer class=
single command to apply setfacl for multiple user at a time
Jan 23, 2018
Linux
beulah class=
What does mean by 0 0 value in fstab file
Jan 2, 2018
CentOS
mason class=
Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)
Nov 20, 2018

Related News in How to create and connect PJSIP Endpoints using Asterisk on Rocky Linux 9.4

Related News in How to create and connect PJSIP Endpoints using Asterisk on Rocky Linux 9.4

Anbox, the Android-to-Linux tool the developers have been waiting for
Anbox, the Android-to-Linux tool the developers have been waiting for
Apr 17, 2017
Linus Torvalds stops signing Linux kernel RC tarballs
Linus Torvalds stops signing Linux kernel RC tarballs
May 17, 2017
Capsule8 Launches Linux-Based Container Security Platform
Capsule8 Launches Linux-Based Container Security Platform
Feb 14, 2017
Symantec updates Management console product
Symantec updates Management console product
Nov 22, 2017
Latest Linux driver release feature seven AMD Vega
Latest Linux driver release feature seven AMD Vega
Mar 23, 2017
A Newer and a Faster Window Manager for Tina (Linux Mint 19.2)
A Newer and a Faster Window Manager for Tina (Linux Mint 19.2)
Apr 9, 2019
Microsoft makes its Azure App service now available on Linux Systems
Microsoft makes its Azure App service now available on Linux Systems
Sep 7, 2017
Docker friendly Alpine Linux gets hardened Node.js
Docker friendly Alpine Linux gets hardened Node.js
Apr 19, 2017
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help keel johnston ?
Unhide the folders on windows Explorer

Give any solutions to unhide folder using command prompt?

forum3

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.