O'Reilly logo

Asterisk: The Future of Telephony by Leif Madsen, Jared Smith, Jim Van Meggelen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

MP3Player() — Plays an MP3 file or stream

Synopsis

    MP3Player(location)

Uses the mpg123 program to play the given location to the caller. The specified location can be either a filename or a valid URL. The caller can exit by pressing any key.

Tip

The correct version of mpg123 must be installed for this application to work properly. Asterisk currently works best with mpg123-0.59r.

Returns -1 on hangup; otherwise, returns 0.

    exten => 123,1,Answer()
    exten => 123,2,MP3Player(test.mp3)

    exten => 123,1,Answer()
    exten => 123,2,MP3Player(http://server.tld/test.mp3)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required