TIPS MOH streaming seems to have issues on Debian 12 + IncrediblePBX-2025

Halea

Well-Known Member
Joined
Aug 12, 2016
Messages
1,164
Reaction score
917
It might not be an IncrediblePBX problem strictly speaking as the issue seams to emanate from mpg123 as far as I can tell.
But strangely when I was able to handpick a version of mpg123 that worked with the MOH line parameters in a terminal window on Debian 12, it still did not work when it was called from iPBX.
Can anyone confirm that this specific combination of OS (Debian 12) and IncrediblePBX (stock 2025 from last month) indeed works when it comes to MOH streaming?
TIA

Update:
I was able to make it work with a wrapped up player of my own vintage which I originally developed to ensure that if/when a stream cease broadcasting a substitute is picked from a list. Making MOH streaming work shouldn't be this complicated though!
 
Last edited:
I've never gotten streaming to work correctly since late versions of FreePBX-16. I'm just using stored mp3 files.
 
Have you checked syslogs, or tried running a stream from the command line to see what it will present?

The reason some of my streams fail is because the service is no longer available, or IP address changed
 
It seems like the issue might be related to mpg123 rather than IncrediblePBX itself, especially if it works fine when you manually run it from the terminal but not through iPBX. It's definitely odd. As for the combination of Debian 12 and IncrediblePBX, I haven't personally tested it, but maybe there’s a setting or version mismatch causing it.
 
Maybe the path is set differently in Debian 12?
 
I'm using Ubuntu 24.04 and FreePBX expects default MOH files in /var/lib/asterisk/moh/default, but Ubuntu's deb package places them in /usr/share/asterisk/moh/

You can check the /etc/asterisk/asterisk.conf to see where Debian 12 expects them?

My FreePBX installation on Ubuntu process is to `ln -s /usr/share/asterisk/moh /var/lib/asterisk/moh/asterisk-moh-opsound` to make the default files available, but still gives me the option to add my own recordings without interfering with the default files.
 
FYI: At least with Debian 12, there is no /usr/share/asterisk directory in Incredible PBX 2025.
 
there is no /usr/share/asterisk directory in Incredible PBX 2025.
Correct. Various distributions of FreePBX may install in other directories. However, FreePBX-17 and Asterisk-22 on IncrediblePBX-2025 do not specify a MOH location in the /etc/asterisk/asterisk.conf file so it defaults to /var/lib/asterisk/moh/.

I don't know what FreePBX and Asterisk versions @rajanpatel is running or how he installed it, but his file location does not apply on the latest FreePBX and Asterisk that we use. Therefore, the issue remains open until someone using the current release is able to figure it out. A fix can be pushed out from @wardmundy once he knows what it is.
 
Last edited:
do not specify a MOH location in the /etc/asterisk/asterisk.conf file so it defaults to /var/lib/asterisk/moh/
You can't specify the MOH location in asterisk.conf, you specify it in musiconhold.conf. MOH assumes that all relative directory paths are subdirectories of what is set by astdatalibdir in asterisk.conf.

So the default MOH class used in musiconhold.conf is:

[default]
method=files
directory=moh

Since the directory path isn't a full path, it assumes the path is relative to astdatalibdir. If you set directory= to a full path on the system, it will read it from there.
 
I've had streaming MOH work, but you really need to monitor what it does to your CPU - can eat it up.
 
I've had streaming MOH work, but you really need to monitor what it does to your CPU - can eat it up.
That's the problem with the way the streams are called by FreePBX/Asterisk. If a stream fails while it's in progress the MOH function goes crazy and within seconds it starts issuing tons of DNS lookup requests. That can push the CPU utilization to over 70% on my test system.
On the same test system, when without MOH the CPU use is 4%, it goes to just under 8% when I run 29 streaming channels simultaneously. The issue is really not with the streams, it's with the way they are handled by the MOH call.
So, I created a bash script which ensures that it never actually exits, no matter what. It is called with a mnemonic name of the channel which is properly defined in the script body. If the source ever fails (to start or in the middle of playing) the script immediately connects to another feed just to ensure that MOH is not aware of the failure.
In FreePBX the MOH stream call is defined as "PlayStream KTHO" for instance, All parameters including the actual player for the source are defined in the script file.
 
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top