OPNsense Forum

English Forums => General Discussion => Topic started by: lever123 on May 04, 2021, 03:43:28 pm

Title: Asterisk16 Config
Post by: lever123 on May 04, 2021, 03:43:28 pm
I'm migrating from my OpenWRT firewall (which also runs my Asterisk PBX) to an OPNsense appliance installed on an old machine I had lying around.

I installed the asterisk16 (16.17.0) package on my OPNSense using the web interface.  I see that it is available via ports, as well.

Quote
$ pkg search asterisk
asterisk16-16.17.0             Open Source PBX and telephony toolkit

and that the asterisk18 version is in the ports tree but not available for pkg installation.

When I first tried to start asterisk, I got the following:

Quote
$ sudo /usr/local/etc/rc.d/asterisk start
install: unknown group %%ASTERISK_GROUP%%
Starting asterisk.
Unable to create socket file directory.  Remote consoles will not be able to connect! (Input/output error)
Unable to chown run directory to 931 (asterisk)

I tried manually creating the /var/run/asterisk directory and chown'ing it to 931:931 and that reported that it started but the PID in the file doesn't exist and the socket (.ctl) file doesn't get created.

Quote
$ sudo /usr/local/etc/rc.d/asterisk start
Starting asterisk.
$ ls -ld asterisk
drwxr-xr-x  2 asterisk  asterisk  0 May  4 09:10 asterisk
$ ls -l asterisk/
total 4
-rw-r--r--  1 asterisk  asterisk  6 May  4 09:35 asterisk.pid

I'm from a Linux background so the rc startup system is a little foreign to me and it seems that the OPNSense implementation is even a bit different that the standard FreeBSD version.

It seems that I need to create a simple config file in /etc/rc.conf.d and the actual startup file is found in /usr/local/etc/rc.d.  That's what I've done for SNMP, tftpd and Bird, anyway, and it seems to work over reboots.

Is there something fundamental that I'm missing here?  Maybe just a newbie error?

Would it be better to manually do a make install from with the ports tree?  Would asterisk18 be a better choice (that's what I'm running on my OpenWRT box)?

I understand that some will say that the Firewall is no place to be running a PBX but it's been fine for me for many years now.

Any pointers will be appreciated.

Thanks for your help,

Mark
Title: Re: Asterisk16 Config
Post by: lfirewall1243 on May 06, 2021, 02:05:38 pm
You have Asterisk installed on the same system which is running OPNsense?
If yes. Delete it!

There is no enviroment where this procedure is fine. Too many security risks, bad performance, .... tons of reasons why thats a bad idea

If you only have 1 Appliance install something like Proxmox and create different VMs for OPNsense and Asterisk