TIPS Incredible PBX 2027 - MOH errors

Gary Chisholm

New Member
Joined
Jan 19, 2015
Messages
1
Reaction score
0

On Hold Music - Adding:​

Type - Custom Application
Application - /usr/bin/mpg123 -q -r 8000 -f 8192 -b 1024 --mono -s http://live.leanstream.co/CIMJFM-MP3

Giving an error of:

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column `asterisk`.`music`.`random` at row 1
File:/var/www/html/admin/modules/music/Music.class.php:135

Debian 11 + install instructions from https://nerdvittles.com/happy-new-year-its-incredible-pbx-2027-for-debian-11/ - I did a clean install, made sure mpg123 was installed etc...
 
Guys, I am so sorry to bug you with all my issues today.
This might again be a trivial one, but I can't figure it out.
Also, as I searched for a possible match on this forum, I found that about a month ago someone brought up the exact same issue, but it was left unanswered/unresolved here.
In a nutshell, I'm trying to create a live stream for MOH.
1682808192544.png
The string I am trying to enter in the application field is rejected with a pop up error message as soon as I press the "Submit" button.
Actually, no matter what I enter in that field it gets rejected. Then the following message shows up:
1682808090442.png
 
mysql asterisk -e 'describe music' ;select * from music' ?
 
@dicko : could you elaborate on what you suspect that's happening with that sql message? I tried to run the line that you provided but it resulted in error messages (syntax I believe). I tried to fiddle it but couldn't make it work.
I also reinstalled the VPS instance from ground up (for unrelated reasons), and on the new instance the exact same issue (error message and not able to enter a live stream command string in the application field) appeared.
 
'describe' lists the types and any indices on the database , the 'select' just shows the content of the database, your error suggests that something is amiss with the query or the table itself , there is no datetime in that database and the asterisk, user, random defaults to 0. I did typo , one set of quotes . . .


mysql asterisk -e 'describe music ;select * from music'

?
 
Last edited:
mysql asterisk -e 'describe music ;select * from music'
That doesn't doesn't work on my systems. This does:
Code:
mysql asterisk -u root -ppassw0rd
describe music;
select * from music;
 
I'd say its a FreePBX issue. The screen is not filling in the "random" column when you attempt to save. I tried manually adding the stream to the musiconhold_additional.conf file and that didn't work either.

If I manually enter you stream string into the database, the result is loud static only. I think if you get the format of the stream correct, manually adding it to the database might work. The instructions in this article format the stream differently from what you have: https://www.freepbx.org/how-to-add-a-remote-mp3-stream-for-music-on-hold/
 
Last edited:
@kenn10 : Thanks for checking. There may be more than one issue. The GUI code is definitely broken. I've compared multiple versions of the code from different sources the changes make little sense. It looks as if during some cut-and-paste operation something fell through the cracks.

There may also be an issue with the asterisk version used (a parsing issue), but I can't confirm.

As for the application command line differences, I only saw -b 0 in mine compared to the ones used by FreePBX. That's actually the default for mpg123 thus not really needed. It sets a buffer size in kilobytes so that if the internet connection is jittery or close to saturation you still get a smooth playback. I sometime use -b 1024 (like a 1 megabyte buffer), but often it's not needed so I set it to 0.
 
@Gary Chisholm : Hi Gary! Welcome to the forum.
Sorry that nobody was able to provide you with any help on the issue that you reported.
I've been testing the same version and ran into the same problem. So far I made no progress, but now that more eyes are looking into it a fix might come up.
In the meantime I wanted to check if you were able to figure out a fix or workaround on your own.
Thanks for any feedback.
 
@kenn10 : Thanks for checking. There may be more than one issue. The GUI code is definitely broken. I've compared multiple versions of the code from different sources the changes make little sense. It looks as if during some cut-and-paste operation something fell through the cracks.

There may also be an issue with the asterisk version used (a parsing issue), but I can't confirm.

As for the application command line differences, I only saw -b 0 in mine compared to the ones used by FreePBX. That's actually the default for mpg123 thus not really needed. It sets a buffer size in kilobytes so that if the internet connection is jittery or close to saturation you still get a smooth playback. I sometime use -b 1024 (like a 1 megabyte buffer), but often it's not needed so I set it to 0.
You need to log a ticket with FreePBX support at https://issues.freepbx.org/secure/Dashboard.jspa. Searching the FreePBX tickets, I see issues with streaming going all the way back to the early days of FreePBX and continue through the versions. I don't remember when it last worked but somewhere around FreePBX 13 it used to work.

I'm not sure whether there have been any changes to mpg123 but I didn't see anything different in the man pages.
 
Last edited:
@kenn10 : My experience with MOH has been very positive over the years and many versions. Actually, I don't recall having this type of issue until now. My workhorse for business has been:
Incredible PBX 2021 15.0.37 'iPBX-2021.01_Deb-10.13_Ast-18.14.0_GUI-15.0.22.22'
For home I still use version 13 dot something.
MOH work well on those.
I'm about to install the iPBX-2027-U on Ubuntu 22.04 (same hardware). I wonder if that will work any better as far as MOH goes.

Edit: By MOH I mean MOH with live streaming as opposed to static files.

Edit #2: I can confirm that the exact same MOH problem shows up when iPBX-2027-U is installed on Ubuntu 22.04. Not surprisingly as they probably share the exact same code base.
 
Last edited:
Yeah. I tried your stream string on both Ubuntu 2204 and Debian 11. This may be just a FreePBX-16 issue.
 
@kenn10 & @wardmundy :
I went to check FreePBX's issue tracker for the problem that I mentioned above (MOH custom app not taking the command) and found out that this is something that many people reported over many versions and each time it was rejected as a support issue.
In one of those there is mention that this is a SQL compatibility issue and apparently at least in one case spoofing the version number (of the database if I understand correctly) was enough to fix it!
The whole thing is beyond my comprehension so I'll simply provide you the material below (I didn't open a bug report):
The following depictions are from this link.
1683397936329.png
1683397974495.png
Hopefully the same or a similar trick vould save the day for FreePBX version 16 too.
 
Yes. But that ticket was last updated 4 years ago and did not relate to FreePBX-16. It showed FreePBX 13, 14 and 15. FreePBX 16 did not exist at that point. I'd suggest you submit a new one anyway. Even their ancient SNG repos must have updated MariaDB by now.

Keep in mind that current MariaDB has its own MYSQL connector. The older versions had a separate install of a MYSQL daemon and repo. They'll have to fix it sooner or later since they are currently working on FreePBX-17.
 
I understand that. But among the bug reports filed and closed with similar rejection there are some for FreePBX 13 and 15. And I know that the MOH thing works on both versions since I currently use both versions actively. Whether FreePBX actually fixed those issues or by some miracle the database engines turned out to be a better fit - I don't know, but somehow that happened apparently outside of Sangoma's involvement (otherwise they would have proudly told the whole world that they fixed the issue).
The reason for which I picked the 4 year old case related to FreePBX v14 is that it indicated a possible solution.
 
Also, try to manually insert your music stream into the database and manually set the "random" field to zero. I suspect that will solve the sloppy coding issue.
 
In the asterisk database, you have the music table and the columns. I created a new MOH source call "Stream" for giggles. I have not added your string into the application column but I did add the zero to the random column using MySQL and it let me pull it up and resave without error in FreePBX-16. Give it a shot and reply back.

Code:
MariaDB [asterisk]> select * from music;
+----+-------------+--------+--------+-------------+--------+
| id | category    | type   | random | application | format |
+----+-------------+--------+--------+-------------+--------+
|  1 | default     | files  |      1 |             |        |
|  4 | Queues      | files  |      0 |             |        |
|  5 | Park        | files  |      0 |             |        |
|  6 | RecordStart | files  |      1 |             |        |
|  7 | RecordStop  | files  |      1 |             |        |
|  8 | Christmas   | files  |      1 |             |        |
|  9 | stream      | custom |      0 | NULL        | NULL   |
+----+-------------+--------+--------+-------------+--------+
 
Last edited:
@Halea: Let's try this. If it worked in Asterisk 15, I've attached the music.tar.gz file from there which was 15.0.33. Use Module Admin to upload this file from your desktop under Asterisk 16. Then backrev in Module Admin to 15.0.33 and see if that works. It let me backrev it without an error, but I didn't test streaming.
 

Attachments

@wardmundy using the old module gives the same error in FreePBX-16. I took a string for the mpg123 player and manually inserted it into the database with both the old and new module with the same results. It will play but my version of the stream is distorted and sounds more like white noise but it does play and I may have incorrect parameters.

I used: /usr/bin/mpg123 -q -r 8000 -f 8192 -b 1024 --mono -s http://stream.live.vc.bbcmedia.co.uk/bbc_world_service but may have incorrect parameters.

Either module absolutely gives the same error if you try to add a stream. Manually adding the stream name to the MOH screen first and then manually inputting the stream into the database works.
 

Members online

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
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