Asterisk MulticastRTP channels


Asterisk 1.8: A new RTP engine and channel driver have been added which supports Multicast RTP.
The channel driver can be used with the Page application to perform multicast RTP paging. The dial string format is:

MulticastRTP/<type>/<destination>/<control address>

Type can be either basic or linksys.
Destination is the IP address and port for the RTP packets. Control address is specific to the linksys type and is used for sending the control packets unique to them.

exten => 8997,1,Dial(MulticastRTP/basic/
exten => 8998,1,Page(MulticastRTP/basic/


Patch to set the codec (missing in Asterisk 1.8.7) by John R. Covert (Sep 2011)

Snom phones support multicast streaming audio for paging, which makes it theoretically possible to have a paging extension which speaks out of every single phone in a facility. I have a possible client who currently has a Meridian system which does just this, which is very important to him, and I need to make this work in Asterisk. Multicast RTP is the way to go — the "Page" application with unicast and autoanswer doesn't scale to a large number of phones: bringing 50-100 phones into a MeetMe conference would be a very bad idea.

As currently implemented in 1.8, a simple Dial(MulticastRTP/...) command doesn't set the codec to something negotiated as the "least common denominator" of all the listening phones, and I wouldn't expect it to — that's precisely what doesn't scale. It will even leave the channel in signed linear in some cases.

The patch below (to svn head in trunk) makes the Dialplan example given below in the trace do what's needed, as long as the call comes in from a SIP or IAX2 channel. You set MULTICAST_RTP_CODEC to ulaw (or whatever your phones support), and away you go.

However, there's another thing that needs to be set when the call isn't from a SIP or IAX2 channel. If you want to page using a canned announcement, you need to be able to set the RTP packet size. I haven't figured out how to easily set it in the MulticastRTP channel yet. Given a hint, I'll add that to my patch as "MULTICAST_RTP_PAYLOAD_SIZE" and submit it along with the codec patch below to the issue tracker.


Multicast app_rtppage (Asterisk 1.6 or later, backport for Asterisk 1.4)

Patch 11797 contains the application RTPPage() that can page multicast capable receivers (e.g. Snom, Linksys, Cisco, Barix devices); app_rtpstream reads the input channel's voice frames and does rtp stream them to either unicast or multicast addresses defined as groups in the config file.

Attention: Make sure you have your IP routing set up correctly! Check with "route -n" so that you do not try to stream out to the Internet instead of to the LAN. Something like "route add dev eth1" might help - but that of course depends on your system setup.


mast_filecast -p PCMU -z 300 /var/lib/asterisk/sounds/YourUlawFile.wav >/dev/null 2>&1

See also

Go back to Asterisk channels technologies

Created by: JustRumours, Last modification: Wed 02 of Jan, 2013 (17:32 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+