Mod shout

From FreeSWITCH Wiki

Jump to: navigation, search

Contents

Overview

Play Capabilities

Local MP3 Files

Can play local mp3 files at any sample rate (8khz, 16khz, 44.5khz) in mono/stereo, re-sampling happens on the fly. (note: re-sampling can be expensive for the CPU)

Remote MP3 Files

session.play_file("shout://some.server.com/file.mp3", "")

Icecast Streams

Can play icecast streams. TODO: example

Shoutcast Streams


<extension name="shout">
  <condition field="destination_number" expression="^750$">
    <action application="playback" data="shout://scfire-dll-aa02.stream.aol.com:80/stream/1074"/>
  </condition>
</extension>


<extension name="moh_for_bridges">
  <condition field="destination_number" expression="^(15145555555)$">
   <action application="set" data="hold_music=shout://scfire-dll-aa01.stream.aol.com:80/stream/1018"/>
   <action application="bridge" data="sofia/default/$1@1.2.3.4"/>
  </condition>
</extension>

Record Capabilities

Can record to local MP3 files.

Can record to icecast and/or shoutcast streams.

Caveats

Fast Forwarding / Rewind Bugs

Certain things like fast-forwarding and rewinding might not work especially if the mp3 is "badly encoded". If you need those features, one thing to try is to decode the mp3 to a wave, and re-encode it back to an mp3 in order to cleanse it of errors. If this still does not work, consider converting it to a wave and using it in that format.

Building

Install Dependencies

  • libvorbis
  • libogg
  • development libraries for both

On Debian Etch:


apt-get install libvorbis0a libogg0 libogg-dev libvorbis-dev 

Enable module in build

Edit modules.conf in source directory to add mod_shout.


formats/mod_sndfile
formats/mod_shout    <--- NEW
#languages/mod_perl

Configure/Make


./configure && make install

Enable module in runtime

Edit modules.conf.xml in install directory to add mod_shout to the list.


    <load module="mod_native_file"/>
    <!--For icecast/mp3 streams/files-->
    <load module="mod_shout"/>          <------- NEW

Restart Freeswitch

Ctl-c current instance and restart. View output and make sure you see [mod_shout] being loaded without errors.

Verifying

See Playing/Recording External Media for instructions on how to play an MP3 file into a conference call.

Debugging Problems

If its not working, try the following:

Configure libshout directly

Rather than relying on the overall configure script to invoke this, go to the src/lib/libshout directory and run configure directly. If you get an error like:


checking for libogg... not found
checking for VORBIS... checking for libvorbis... not found
configure: error: requisite Ogg Vorbis library not found

Delete lib directories

Also, try deleting both the libs/libshout-2.2.2 and libs/lame-3.97 directory and rerunning make.

Personal tools
Community