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

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


In article <425E64F2.7070908 at fnords.org>, Eric Wieling <eric at fnords.org> 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.
> 
> The bounty is US$10 and will be paid via Paypal.  The patch must be
> accepted into CVS-HEAD before the bounty will be paid.

There is no app_hangup.c. The Hangup command is implemented in pbx.c by
the function pbx_builtin_hangup(), which does nothing except return
non-zero. The PBX core then initiates a hangup because the app returned
a non-zero status, which it would for ANY app that did so.

In my opinion the correct fix would be for Asterisk, when an app returns
non-zero, to check if it has already called the h extension for the
channel, and if so, NOT to go to h,1 again. This should be done using
a flag rather than checking the extension, so that it still works if
the dialplan does a Goto out of the h extension to somewhere else.

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-dev mailing list