I am trying to make a dialplan that when I dial 90 I can go round a whole set of extensions and leave them a short message, hangup and go on the next one. I use the M facility of dial, with something like this [messages] exten => 90,n(calcnextchan),Set(DIALCHAN=...) exten => 90,n,Dial(${DIALCHAN},30,M(domessage)) exten => 90,n,Goto(calcnextchan) [macro-domessage] exten => s,1,Playback(message) exten => s,n,Set(MACRO_RESULT=CONTINUE) [There is actually more logic to check for busy dial channels and retry them later] This seems to work fine until one of the callees hangs up before the message is played. at which point my call is terminated. I was wondering if I should user the h extension here to pickup the hungup call from the callee and continue. However I am worried that I might end up looping if I hang up my end of the call - since I want it to stop if I do that. I can't find a definitive explanation of what causes the h extension to be called. Can someone explain what what happen if I added something like exten => h,1,Goto(90,calcnextchan) to the [messages] context -- Alan Chandler http://www.chandlerfamily.org.uk
Alan Chandler
2007-Apr-03 12:03 UTC
[asterisk-users] understanding what h extension does [ISSUE SOLVED]
On Tuesday 03 April 2007 07:48, Alan Chandler wrote:> I am trying to make a dialplan that when I dial 90 I can go round a > whole set of extensions and leave them a short message, hangup and go > on the next one. > > I use the M facility of dial, with something like this > > [messages] > > exten => 90,n(calcnextchan),Set(DIALCHAN=...) > exten => 90,n,Dial(${DIALCHAN},30,M(domessage)) > exten => 90,n,Goto(calcnextchan) > > [macro-domessage] > > exten => s,1,Playback(message) > exten => s,n,Set(MACRO_RESULT=CONTINUE) > > [There is actually more logic to check for busy dial channels and > retry them later] > > This seems to work fine until one of the callees hangs up before the > message is played. at which point my call is terminated. >OK, its a logic problem. If the caller hangs up before playback is complete MACRO_RESULT has not been set, so the call is bridged and then hung up. If I set MACRO_RESULT as the first action of the call macro, then any interruption from the far end hanging up means that the dialplan just continues without the call having been bridged. -- Alan Chandler http://www.chandlerfamily.org.uk