Multicast?

Been searching for a bit today and haven’t came up with anything so far.

I’m looking to connect via a sip channel and have any audio received on that channel output to a multicast stream.

Any suggestions?

hmmm an interesting problem. Presumably for some kind of online radio?

Asterisk itself won’t deal with anything multicast, so you will need another application to do this. I can think of two ways for it-

  1. LiveAGI, is a way that an application can interface with * and actually deal with the audio stream rather than just sending * commands. If your multicast was a LiveAGI application, or a LiveAGI app would send the audio to the multicast app, this would be one way to do it. The SIP channel would call an exten with the LiveAGI app. IE-

exten => 1234,1,Answer()
exten => 1234,2,LiveAGI(youragiscript) (I think, i’ve never used liveagi)

  1. write your own application for *. This will probably be the hardest, it means writing an Asterisk dialplan app that will take the audio and do whatever to it. IE-

exten => 1234,1,Answer()
exten => 1234,2,YourAppHere()

  1. The other way would be to use your system’s soundcard. This would require some creative mixer settings, but the idea is that you send the call to the console (I think it’s Dial(console/DSP) but I could be wrong) and have the console set to auto answer in alsa.conf/oss.conf. Then have your app listen to the speaker output…

Actually, it’s for a paging interface for a bunch of Cisco 7960’s. Unicasting to 100+ phones (later more phones) would be out of the question and using the idle-url in the phones to have them join and listen to a multicast stream while there not in use is just too simple. There is also some network security provisions in place that make paging between locations impossible with multicast (for good reason though, all video-over-ip is transmitted multicast and if it was allowed to transmit multicast “upstream” from the customer locations, they could potentially interfere with other customer’s service). But anyway, I’m diverging. There are other applications for this, online radio being a possibility.

Thanks for the info. I had been researching a bit more while waiting and had come up and am now researching how to use EAGI (I think this is what your #1 answer was referring to.) I saw an example perl script that can take and record the audio stream (as the EAGI launched “scripts” take the audio stream in as standard input on file descriptor 3). I am possibly looking at modifying this script or righting something from scratch in python (python libraries for RTP streams are rather lacking though).

#2 Is probably out of the question. I’m not familiar with the methodologies used by the * programming group and I’m not sure if I would have time to be. I’m also not familiar with programming in C.

#3 I’m not too interested in because of scalability issues.

I do very much appreciate the answers. If I come up with a decent AGI script or solution to this I’ll try to post it to voip-info.org wiki’s on asterisk and/or this board.

I may be completly off center but if you have networking issues that will restric you from paging everyone how about using meetme and using the manager to call them and join them to meet me. As far as getting developer help see the asterisk dev. list. Lots of good coders out there.

yeah it sounds like agi would be your best bet.

dovid- the problem is a bandwidth problem. He has a number of phones which all need to be paged. Problem is, even w/ meetme he still has to set up an individual audio channel to each phone. This presumably will overwhelm one of his links.
Generally the way to get around this is to fragment the network and deploy * sub servers where needed, but his solution would be to multicast- spread a special stream that apparently his phones can read, which the * server sends once. Each listener phone is given a copy by the routers.

IronHelix: I have never used an SPA 9000 but do you think it would work for him ?

I’ve made some good progress on my EAGI script so far, right now all I’m doing is taking a file and pumping it out as a multicast stream, the phones seem to play the stream about 1/2 of the time so I’m trying to figure out what I’m doing wrong there, then I’ll get to taking the input from * and pumping it out instead.

I’ve saw previous posts (not necessarily in this forum but while googling) of people asking similar questions and others came back with the “meet me conference” answer. There are several problems with this that I have with this. The first problem is, everyone has to answer the phone, do they not? If you’re wanting to get a page out to 100+ people, do you want to wait for X minutes while people pick up. You have to keep paging as simple and as close to what people are currently using or they’ll complain and complain and complain. The second problem I could argue is bandwidth (as mentioned above in a previous reply), although we just try to use the bandwidth intelligently.

I do appreciate the input so far.

As IronHelix mentioned you can have “sub servers” in all locations so there is one stream going to each location and then all the users at that location will feed off te “sub server”.

As far as calling 100+ peope you should not have a problem as long as your box can handle it.

Yes, calling 100+ phones is not a problem… waiting for an unknown number of those 100+ phones to answer is. This involves interaction from the end-user that is needing to receive the page, in order to receive the page. The end-user receiving the page should not have this “option”. Paging is meant as a broadcast designed for everyone, whether they want to hear it or not.

ah i understand. Most IP phones support a paging mode, if they recieve a special SIP header along with the call they will not ring but instead just answer and put the call on speakerphone. This header varies from one manuf. to another but can be added with SipAddHeader().

So if you SipAddHeader() then Page(SIP/phone1&SIP/phone2&SIP/phone3) etc etc then what will happen is Page will invite all the phones in the list to a meetme conference as muted participants, and will use the header you added in all the invites. User will not have to answer the phone, the voice will just start coming out of his speaker (although he can usually hang up manually if he doesn’t want to hear it). When you hang up, the conference is dissolved and the phones are then hung up remotely.

This works great (i’ve used it). The only problem is network bandwidth- it sets up one audio stream to each phone, so if you’re using ulaw thats around 80kbit/sec times the number of phones you have. If you have a lot of offsite phones this may overwhelm your WAN links.

You can use branch office servers (what I was talking about before) to reduce this load. To do this setup an * server at each branch office and link them via IAX2 to a central server at your main office. If you do this right the users will still be able to dial between offices by extension.
Now create on each box an extension (say 9999) that will page all the phones. On each branch office it will have
exten => 9999,1,SipAddHeader(header for your IP phones to auto answer)
exten => 9999,2,Page(SIP/1234&SIP/1235…) ; fill out with all the phones that need to be paged.

now at your central office, you can make an exten say 5555 that will be the squawk exten.

exten => 5555,1,SipAddHeader(header for your IP phones)
exten => 5555,2,Page(SIP/1236&SIP/1237 & IAX2/office1/9999&IAX2/office2/9999&IAX2/office3/9999)
obviously you wouldnt use a space but i put it there to show what i mean- you Page() both the phones in your office and the remote extensions of the branch office paging extens.

The result when you dial 5555-
your central * server sets up a meetme conf and invites all the local phones into it. It also invites the remote exten9999’s into it. This creates meetme conferences in each branch office with all the local phones in them, and the branch office meeetme’s are members of the central meetme.
Note- if you use the above DO NOT use the ‘d’ flag in meetme. It will allow EVERY phone in your office full duplex speakerphone to EVERY OTHER phone, at best you will have chaos, at worst you will have digital feedback throughout the company (and a lot of pissed off workers :smile: )

Anyway the resulting bandwidth savings of this will be noticable- instead of setting up one 80kbit/sec stream to each offsite phone, you set up one stream to each offsite office. The local * servers then deal with all their own phones.

Going bandwidth wise though, multicast is the most efficient way to do it. With multicast you have ONE stream that goes exactly where it needs to.

I jumped away from this for a bit. In my particular scenario, the phones are not SIP phones on asterisk but SCCP phones hanging off of a Cisco CallManager 5.0. I’m using * as a voicemail server (works quite nicely).

I’m still working on my EAGI application and hope to have something completed in a week or two. I was having some problems with my app early on because I had misread the RFC’s and have my timestamp values populated incorrect. It’s also a bit more complex than I anticipated because the Idle URL that the phones load that tells them to listen to the multicast stream also mutes the audio into the phone and doesn’t restore it until you physically un-mute it by pushing the button. Even if a call comes in and you pick up the receiver you still have to hit the button. I reconsidered this and thought it best to do an HTTP POST to the phones to tell them to start listening for the stream IF they are idle and then again when the page is done , send another HTTP POST telling them to stop listening. I basically have all my components that I need to make a functional, zone based paging system, I just need to glue them together.

I go, on and on a little too much when I could be using this time to get the script done.

But anyway, thanks for all your input.