Hello, I need your help. As I was trying to make my own voip system using freepbx digitalocean business app, I had a problem. Here is what I’ve tried on it.
curl -v -u username:password http://server_ip:8088/ari/endpoints
Here is the result (logs):
* Trying server_ip:8088...
* Connected to server_ip (server_ip) port 8088 (#0)
* Server auth using Basic with user 'username'
> GET /ari/endpoints HTTP/1.1
> Host: server_ip:8088
> Authorization: "token here"
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: Asterisk/18.6.0
< Date: Thu, 04 Jan 2024 13:48:33 GMT
< Cache-Control: no-cache, no-store
< Content-type: application/json
< Content-Length: 113
<
[
{
"technology": "PJSIP",
"resource": "anonymous",
"state": "offline",
"channel_ids": []
}
* Connection #0 to host server_ip left intact
sudo systemctl start asterisk
Here is the error log:
Asterisk is already running.
Can't open PID file /var/run/asterisk/asterisk.pid (yet?) after start: No such file or directory
Failed to start LSB: Asterisk PBX.
Unit asterisk.service entered failed state.
asterisk.service failed.
pam_unix(sudo:session): session closed for user root
How can I fix those issues? Hope to hear from you soon. Thank you.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hello Seymen,
The issue you’re encountering with Asterisk on your FreePBX DigitalOcean business app seems to be related to the way Linux handles the
/var/run
directory after a reboot. This directory, including/var/run/asterisk
, often gets cleared upon reboot on many Linux distributions.To resolve the “Asterisk is already running but can’t find PID file” issue, here are some steps you can take:
Create the Directory and Set Permissions:
/var/run/asterisk
directory and set the correct ownership. You can add these commands in the/etc/init.d/asterisk
script to automatically execute them when the system starts.$AST_USER
and$AST_GROUP
with the appropriate user and group names for your Asterisk setup.Check and Fix Permissions:
/var/run/asterisk/
directory and theasterisk.ctl
file within it..ctl
and.pid
files.Verify Asterisk is Running:
asterisk.ctl
file. If it’s not running or halts immediately due to an error, this file won’t be created.Consider SELinux Configuration:
Do try these steps and see if they resolve the issue!
Best,
Bobby