[Asterisk-Dev] tip from the asterisk guru's...

Chris Wade clwade at sparco.com
Wed Mar 2 11:00:58 MST 2005


Kevin P. Fleming wrote:
> Chris Wade wrote:
> 
>> is it safe to run ast_moh_start inside one apps _exec function, return 
>> from that function, and then run ast_moh_stop inside another apps 
>> _exec function?
> 
> 
> Yes.

Cool, so I can safely create 'StartMusicOnHold' and 'StopMusicOnHold' :)
I'll upload my patch to mantis as - even though Mark will probably shoot 
them down as not needed - I want others to have access to them.

Just to double check, I've got an idea where I'll be doing something 
like this: (which Mark _says_ nobody would ever do)

exten => blah,1,Answer
exten => blah,n(start),StartMusicOnHold
exten => blah,n,WaitExten(10)
exten => blah,n,StopMusicOnHold
exten => blah,n,Background(you-didnt-pick-an-option)
exten => blah,n,Goto(start)

This allows me to get rid if app_swait.c (bug # 2984) that I wrote which 
is really just a hack of WaitMusicOnHold, Wait, and WaitExten.  The 
ability to start and stop music on hold from the dialplan makes 
WaitMusicOnHold pointless and allows you to pick whether or not to 
accept an extension by switching WaitExten in the above example with a 
simple Wait.

No problems foreseen?

-Chris

PS: thanks to anthm for the plug in your WaitIVR app :) [just now went 
back to find the bug number and noticed you considered it worthy of 
're-factoring']




More information about the asterisk-dev mailing list