OpenSIPS and MariaDB/MySQL on OPNSense

Started by kumba, June 12, 2025, 11:38:51 PM

Previous topic - Next topic
I am looking at having an OPNSense box setup as a sort of SBC using OpenSIPS. I don't want to run a VM as SIP's audio component is realtime and needs 20ms to always be 20ms in order to operate at scale. This also seems like a decent fit since OpenSIPS is a proxy and would blend in with the other proxy components already built into OPNSense. OpenSIPS is a fairly fat application that would need a database service like MariaDB/MySQL on the backend. I'd probably also try to include an RTP proxy like RTPEngine for anchoring and NAT traversal.

So this leads to my first problem, getting MariaDB or MySQL installed for the backend and CDRs. I know the database client libs are installable but the server side is not. Is there a method to get MySQL/MariaDB installed on OPNSense in a way that future updates won't nuke it or disable the service? I looked and there's no plugins for either database in the baked in repos which I kind of expected.

The second issue would be getting opensips compiled and installed. It looks like it doesn't exist in the FreeBSD ports but the OpenSIPS project has a pkg for it at https://github.com/OpenSIPS/opensips/tree/master/packaging/freebsd. I come from the land of Linux and have very little clue what I need to do to get this installable for FreeBSD.

After that, it should be a 'simple' matter of making the plugin </s>. But before I can bother with that I need the underlying software in place first.

Any feedback or pointing me in the right direction would be much appreciated. Thank you!

A fully fledged database on a firewall?! You do what you want with your machine but there's no way anyone is going to commit to verify it and its dependencies are satisfied on upgrades, that is on you.
So yes you can. I imagine doing it on an OPN VM would be better for your tests. You'll need to enable the freeBSD repo (which is disabled for a very good reason), the dependencies nightmares are for you to deal with. Then is a simple case of first search for a package #pkg update then #pkg search mysql. At the time of writing I think the versions are 8, 8.4 and 9 (there'll be minor version i.e. 8.a.b). Same for opensips.