[Asterisk-Users] Re: BOUNTY: app_hangup from exten => h

Tony Mountifield tony at softins.clara.co.uk
Thu Apr 14 07:13:58 MST 2005


In article <200504140928.13044.akohlsmith-asterisk at benshaw.com>,
Andrew Kohlsmith <akohlsmith-asterisk at benshaw.com> wrote:
> On April 14, 2005 08:31 am, Eric Wieling wrote:
> > This is a bounty for a patch to app_hangup.c to generate an error when
> > Hangup is called from exten => h.
> >
> > You should not call Hangup from exten => h.
> 
> I disagree; you should use Hangup() WHEREEVER you want to make absolutely sure 
> the dialplan stops.  If you do post-hangup processing that has some branching 
> it's far simpler to simply Hangup at the various branches than to 
> Goto(h,end,1).  A lot neater, too.

My turn to disagree, see my reply to you in another thread:
http://lists.digium.com/pipermail/asterisk-users/2005-April/101447.html

To be more specific, a while ago I was doing this:

exten => h,1,MYSQL(...connect...)
exten => h,2,MYSQL(...write a record...)
exten => h,3,MYSQL(...disconnect...)
exten => h,4,Hangup

because I had got into the habit of calling Hangup inside h. I found that
i was getting TWO records written to the MYSQL database, because my Hangup
was causing it to call the h extension again.

It didn't continue to go round and round, so there is some check in there,
but that check was not soon enough.

Removing the unnecessary h,4,Hangup cured the problem.

This was several months ago; I haven't tried reproducing it in more recent
versions.

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-users mailing list