From c6a9fbf2c93aae79648be9414ea5f5872b873b84 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Thu, 22 Oct 2009 17:14:48 +0000 Subject: [PATCH] Merged revisions 225360 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r225360 | tilghman | 2009-10-22 12:11:23 -0500 (Thu, 22 Oct 2009) | 11 lines Merged revisions 225105 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r225105 | tilghman | 2009-10-21 11:02:12 -0500 (Wed, 21 Oct 2009) | 4 lines Fix documentation for ast_softhangup() and correct the misuse thereof. (closes issue #16103) Reported by: majorbloodnok ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@225363 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_meetme.c | 2 +- include/asterisk/channel.h | 9 +++++---- main/pbx.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/app_meetme.c b/apps/app_meetme.c index d505077a05..40624c6a4f 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -5141,7 +5141,7 @@ static void sla_handle_hold_event(struct sla_event *event) ast_indicate(event->trunk_ref->trunk->chan, AST_CONTROL_HOLD); } - ast_softhangup(event->trunk_ref->chan, AST_CAUSE_NORMAL); + ast_softhangup(event->trunk_ref->chan, AST_SOFTHANGUP_DEV); event->trunk_ref->chan = NULL; } diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index f0ff3d09c0..2744b7e375 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -945,7 +945,7 @@ int ast_hangup(struct ast_channel *chan); * \brief Softly hangup up a channel * * \param chan channel to be soft-hung-up - * \param cause Ast hangupcause for hangup + * \param reason an AST_SOFTHANGUP_* reason code * * Call the protocol layer, but don't destroy the channel structure * (use this if you are trying to @@ -955,12 +955,13 @@ int ast_hangup(struct ast_channel *chan); * * \return Returns 0 regardless */ -int ast_softhangup(struct ast_channel *chan, int cause); +int ast_softhangup(struct ast_channel *chan, int reason); /*! \brief Softly hangup up a channel (no channel lock) * \param chan channel to be soft-hung-up - * \param cause Ast hangupcause for hangup (see cause.h) */ -int ast_softhangup_nolock(struct ast_channel *chan, int cause); + * \param reason an AST_SOFTHANGUP_* reason code + */ +int ast_softhangup_nolock(struct ast_channel *chan, int reason); /*! \brief Check to see if a channel is needing hang up * \param chan channel on which to check for hang up diff --git a/main/pbx.c b/main/pbx.c index f30e8b210d..f548977997 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -4405,7 +4405,7 @@ static enum ast_pbx_result __ast_pbx_run(struct ast_channel *c, } if (!args || !args->no_hangup_chan) { - ast_softhangup(c, c->hangupcause ? c->hangupcause : AST_CAUSE_NORMAL_CLEARING); + ast_softhangup(c, AST_SOFTHANGUP_APPUNLOAD); } if ((!args || !args->no_hangup_chan) &&