From: Tilghman Lesher Date: Wed, 21 Oct 2009 16:02:12 +0000 (+0000) Subject: Fix documentation for ast_softhangup() and correct the misuse thereof. X-Git-Tag: 1.4.27-rc3~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e8a4555341d87c87212f5b74db48f789a007bac;p=thirdparty%2Fasterisk.git 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.4@225105 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_meetme.c b/apps/app_meetme.c index 6b12ecdb00..1867b70379 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -3919,7 +3919,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 2a835c96c9..42e473b703 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -774,14 +774,14 @@ int ast_hangup(struct ast_channel *chan); * \param chan channel to be soft-hung-up * Call the protocol layer, but don't destroy the channel structure (use this if you are trying to * safely hangup a channel managed by another thread. - * \param cause Ast hangupcause for hangup + * \param reason an AST_SOFTHANGUP_* reason code * \return Returns 0 regardless */ int ast_softhangup(struct ast_channel *chan, int cause); /*! \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) */ + * \param reason an AST_SOFTHANGUP_* reason code */ int ast_softhangup_nolock(struct ast_channel *chan, int cause); /*! \brief Check to see if a channel is needing hang up diff --git a/main/pbx.c b/main/pbx.c index 7cf669c1f1..6fe2c3c73a 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -2504,8 +2504,9 @@ static int __ast_pbx_run(struct ast_channel *c) } if (!found && !error) ast_log(LOG_WARNING, "Don't know what to do with '%s'\n", c->name); - if (res != AST_PBX_KEEPALIVE) - ast_softhangup(c, c->hangupcause ? c->hangupcause : AST_CAUSE_NORMAL_CLEARING); + if (res != AST_PBX_KEEPALIVE) { + ast_softhangup(c, AST_SOFTHANGUP_APPUNLOAD); + } ast_channel_lock(c); if ((emc = pbx_builtin_getvar_helper(c, "EXIT_MACRO_CONTEXT"))) { emc = ast_strdupa(emc);