By Seymen Pek
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!
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.if ! [ -d /var/run/asterisk ] ; then
mkdir /var/run/asterisk
chown $AST_USER:$AST_GROUP /var/run/asterisk
fi
$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 the asterisk.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.asterisk -cvvvvv
Consider SELinux Configuration:
Do try these steps and see if they resolve the issue!
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.