I have Cenots 8 with Asterisk 17.X, Mp3Player issue

Hello team,
I have running Centos 8 and 17.X Asterisk, Mp3Player is not working
mpg123 already installed.
pls guide to run mp3 files through dialplan.

exten => s,n,MP3Player(/var/lib/asterisk/test.mp3)
exten => s,n,MP3Player(/var/lib/asterisk/test2.mp3)

0x7fdad000d120 – Strict RTP switching to RTP target address 192.168.1. 9:29512 as source
– Executing [s@QuizIVR:10] MP3Player(“SIP/demo-bob-00000000”, “/var/lib/asterisk/test.mp3”) in new stack
– Executing [s@QuizIVR:11] MP3Player(“SIP/demo-bob-00000000”, “/var/lib/asterisk/test2.mp3”) in new stack
> 0x7fdad000d120 – Strict RTP learning complete - Locking on source address

try removing extension name from the file

Looking at the log, I see no positive indication that anything has failed. The only real hint is that RTP hasn’t fully stabilised until after the second MP3Player call. As this has been scraped from the screen, rather than taken form log files, there is no information as to how long the commands ran for.

The code passes filename as received, so I think the “.mp3” extension is needed, if it exists on the file.

The application doesn’t seem to answer the call, so will play as early media, if the call isn’t already answered.

I’m not sure if comedia will be honoured before RTP learning is complete.

Any error associated with launching mpeg123 will be output to standard error, so you are likely to have to run Asterisk in -c mode, to see it.

I would point out that, for static MP3 files, the sensible way of using Asterisk is to convert them to the codec(s) in use, offline, and then Playback the converted files.

Thanks for reply.
Yes I tried with extension and without also but still no progress.
I am using with mp3 file conversion but would be better if direct mp3 files can play without error.

Pls suggest best audio format to dependency and compatible with all asterisk versions.
wav / alaw / ulaw or other.
and what is best tool to convert audio.

As I told above that my mp3 is not working with asterisk 17.x

The best formats are all the codecs that will be used by the phones and network providers, although if you don’t provide them all, .wav (16 bit, signed linear, mono, 8kHz) is the least costly to convert on the fly into other formats. It is also slightly better than any landline public network and significantly better than public mobile phone network codecs, and doesn’t introduce any degradations that are not in those codecs.

The choice between mu-law and A-law depends on where in the world you connect to the PSTN. North America and Japan use one; the rest of the world uses the other.

sox is the de facto choice for all formats that it supports. I think mp3 may need converting to a linear format first. Asterisk has commands to offline convert between formats it supports automatically, which I think exclude MP3.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.