• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to enable ARI and Connect with WebSocket on Asterisk

  • 00:45 lsb_release -a
  • 01:03 systemctl status asterisk
  • 01:21 cd /etc/asterisk/
  • 01:36 vim ari.conf
  • 03:20 vim http.conf
  • 04:25 systemctl restart asterisk
{{postValue.id}}

To Enable ARI And Connect With WebSocket On Asterisk

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 being controlled by the user is conveyed via JSON events over a WebSocket.

Procedure Steps:

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

root@linuxhelp:~# lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:    22.04
Codename:    jammy

Step 2: I have already installed Asterisk on Ubuntu machine, now check the status of the Asterisk service by using the below command

root@linuxhelp:~# systemctl status asterisk
● asterisk.service - LSB: Asterisk PBX
     Loaded: loaded (/etc/init.d/asterisk; generated)
     Active: active (running) since Thu 2023-09-14 10:24:21 IST; 2 months 7 days ago
       Docs: man:systemd-sysv-generator(8)
    Process: 1369 ExecStart=/etc/init.d/asterisk start (code=exited, status=0/SUCCESS)
      Tasks: 78 (limit: 4489)
     Memory: 83.7M
        CPU: 7min 11.930s
     CGroup: /system.slice/asterisk.service
             └─1391 /usr/sbin/asterisk

Sep 14 10:24:20 linuxhelp systemd[1]: Starting LSB: Asterisk PBX...
Sep 14 10:24:21 linuxhelp asterisk[1369]:  * Starting Asterisk PBX: asterisk
Sep 14 10:24:21 linuxhelp asterisk[1369]:    ...done.
Sep 14 10:24:21 linuxhelp systemd[1]: Started LSB: Asterisk PBX.
Sep 14 10:24:24 linuxhelp asterisk[1391]: radcli: rc_read_config: rc_read_config: can't open /etc/radiusclient-ng/radius>
Sep 14 10:24:24 linuxhelp asterisk[1391]: radcli: rc_read_config: rc_read_config: can't open /etc/radiusclient-ng/radius>

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

root@linuxhelp:~# cd /etc/asterisk/

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

root@linuxhelp:/etc/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:/etc/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: After changing the configuration file need to restart the asterisk service by using the below command

root@linuxhelp:/etc/asterisk# systemctl restart asterisk

Go to the browser and search with the following link http://enter-your-ip:8088/ari/endpoints?api_key=username:password

here I’m using my IP address http://192.168.6.113:8088/ari/endpoints?api_key=asterisk:password

SNAP 1

After enter the above link enter your Username and Password

SNAP 2

Now it will shows the status of the endpoints

SNAP 3

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. Your feedback is much welcome.

Tags:
jacob
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

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 to 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

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 Ganesh Konka ?
Zentya 6.1 http proxy configuration

please send link for creating zentyal 6.1 for http proxy and firewall as gateway.

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.