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

How to enable ARI and Connect with WebSocket on Asterisk on Oracle Linux 9.3

  • 00:40 cat /etc/os-release
  • 00:55 systemctl status asterisk.service
  • 01:16 cd /etc/asterisk/
  • 01:29 vim ari.conf
  • 02:54 vim http.conf
  • 03:23 asterisk -rvvvvvvvvvvvvv
  • 03:33 module load res_stasis.so
  • 03:58 module load res_ari
  • 04:15 ari show status
  • 04:30 http show status
7848

To Enable ARI And Connect With WebSocket On Asterisk On Oracle Linux 9.3

Introduction:

ARI is an asynchronous API that allows developers to build communications applications by exposing the raw primitive objects in Asterisk - channels, bridges, endpoints, media, etc. - through an intuitive REST interface. The state of the objects the user controls is conveyed via JSON events over a WebSocket.

Procedure Steps:

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: Now check the status of the Asterisk service by using the below command

[root@linuxhelp ~]# systemctl status asterisk.service
● asterisk.service - LSB: Asterisk PBX
     Loaded: loaded (/etc/rc.d/init.d/asterisk; generated)
     Active: active (running) since Mon 2024-02-19 04:02:05 IST; 2 months 23 days ago
       Docs: man:systemd-sysv-generator(8)
    Process: 1001 ExecStart=/etc/rc.d/init.d/asterisk start (code=exited, status=0/SUCCESS)
   Main PID: 1062
      Tasks: 37 (limit: 21739)
     Memory: 63.3M
        CPU: 6.710s
     CGroup: /system.slice/asterisk.service
             ├─1056 /bin/sh /usr/sbin/safe_asterisk
             └─5831 /usr/sbin/asterisk -f -vvvg -c

Feb 19 04:02:05 linuxhelp systemd[1]: Starting LSB: Asterisk PBX...
Feb 19 04:02:05 linuxhelp asterisk[1001]: Starting asterisk:
Feb 19 04:02:05 linuxhelp systemd[1]: asterisk.service: Can't open PID file /run/asterisk/asterisk.pid (yet?) after start: Operation not permitted
Feb 19 04:02:05 linuxhelp systemd[1]: asterisk.service: Supervising process 1062 which is not our child. We'll most likely not notice when it exits.
Feb 19 04:02:05 linuxhelp systemd[1]: Started LSB: Asterisk PBX.

Step 3: For enabling ARI, First move to the Asterisk directory by using the below command

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

Step 4: Edit ari.conf file by using the below command

[root@linuxhelp asterisk]# vim ari.conf
Check for the following line 
enabled=yes
Add the following lines in the ari.conf file
[asterisk]
type=user
read_only=no
password=Linuxc#4
password_format=plain

Step 5: Now ARI has been enabled, need to configure http on asterisk, edit http.conf file in the asterisk directory by using the below command

[root@linuxhelp asterisk]# vim http.conf
Check the following lines in the http.conf file and enter the values like below lines
[general]
enabled=yes
bindaddr=0.0.0.0
bindport=8088

Step 6: Now Login to the Asterisk CLI Mode by using the below command

[root@linuxhelp asterisk]# asterisk -rvvvvvvvvvvvvv
Asterisk 20.5.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 = 6223)
linuxhelp*CLI> 

Step 7: Check the ARI status by using the below command

linuxhelp*CLI> module load res_stasis.so
Loaded res_stasis.so
  == Message handler 'ari' registered.
 Loaded res_stasis.so => (Stasis application support)
linuxhelp*CLI> module load res_ari
Loaded res_ari
 Loaded res_ari.so => (Asterisk RESTful Interface)
linuxhelp*CLI> ari show status
ARI Status:
Enabled: Yes
Output format: compact
Auth realm: Asterisk REST Interface
Allowed Origins:
User count: 1

Step 8: Check the http status by using the below command

linuxhelp*CLI> http show status
HTTP Server Status:
Prefix:
Server: Asterisk
Server Disabled

Enabled URI's:
/httpstatus => Asterisk HTTP General Status
/ari/... => Asterisk RESTful API
/ws => Asterisk HTTP WebSocket

Enabled Redirects:
  None.

Step 9: Go to the browser and search with the following link http://enter-your-ip:8088/ari

Here I’m using my IP address http://192.168.6.140:8088/ari

Snap1

Step10: After enter the above link enter your Username and Password Snap2

Snap3

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to enable ARI and connect with Web Socket on Asterisk on Oracle Linux 9.3. Your feedback is much welcome.

Tags:
grayson
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

What is Asterisk API?

A

Asterisk API (aka Asterisk Manager API) is the Application Program Interface for/to the Asterisk Manager and allows for external systems to connect via TCP/IP to issue commands and read events.

Q

What is the default port of Asterisk ARI?

A

The default connection to Asterisk is set to localhost on port 8088

Q

How do you restart the Asterisk service?

A

By using the following command, you can restart the Asterisk
systemctl restart asterisk

Q

How to reload the SIP accounts?

A

pjsip reload command is used to reload the SIP accounts

Q

How to view endpoints in Asterisk?

A

By using the following command you can view endpoints
pjsip show endpoints

Related Tutorials in How to enable ARI and Connect with WebSocket on Asterisk on Oracle Linux 9.3

Related Tutorials in How to enable ARI and Connect with WebSocket on Asterisk on Oracle Linux 9.3

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 enable ARI and Connect with WebSocket on Asterisk on Oracle Linux 9.3

Related Forums in How to enable ARI and Connect with WebSocket on Asterisk on Oracle Linux 9.3

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 enable ARI and Connect with WebSocket on Asterisk on Oracle Linux 9.3

Related News in How to enable ARI and Connect with WebSocket on Asterisk on Oracle Linux 9.3

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 Sebastian ?
How to change non required to required field in SuiteCRM Custom/Default Modules

How to change not required to the required field in SuiteCRM Custom/Default Modules?

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.