[asterisk-dev] Implementing priodic announces in Dial

Mark Michelson mmichelson at digium.com
Mon Feb 2 12:23:21 CST 2009


Saúl Ibarra wrote:
> Hi all,
> 
> I'm thinking abount implementing (or at least trying to do it :) )
> priodic announces in Dial application. I actually came to the need of
> having some klnd of announcement to the caller whil he hears the
> ringing  and I can't see how to do it without touching the code.
> 
> At first I tried it whith Local channels and dialplan configuration,
> later I tried with retrydial, but I can't achieve waht I really want.
> I'd like to have some application (or parameter to the Dial
> application) which reproduces a given filename each fiven seconds of
> time to the calling party.
> 
> I've been through the code (I'm not an expert Asterisk programmer) and
> can't find the right place to implement this behaviour... should I do
> it on the wait_for_answer function?
> 
> I'd be really happy to implement this, but first I need a little help
> to start... :)
> 
> 
> 
> Thanks in advance!
> 

Certainly an interesting idea, and I can think of a couple of methods to go 
about doing it.

The first method is along the lines you were implying, which is to add logic to 
the wait_for_answer function in some way to play periodic announcements at 
intervals. If you want to see the pure mechanics of such an operation, you can 
see app_queue.c, specifically the say_periodic_announce function. That will show 
you how to stop music on hold and play a different message. It will have to be 
different in the Dial application, though, since you will have to be able to 
detect an answer frame at the same time that you are playing the periodic 
announcement to the caller.

Another route to go with this would be to add the periodic announcement support 
to res_musiconhold instead of app_dial. This is somewhat similar to what Nicolas 
suggested a bit earlier, though, so you may not be keen to the idea.

Mark Michelson



More information about the asterisk-dev mailing list