diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-10-21 16:02:12 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-10-21 16:02:12 +0000 |
commit | 1108195e5b2814451ec22c190be7d0ca2d9ead10 (patch) | |
tree | 233fc1c8f5d9bd9ffedc123671b0cea898b45e93 | |
parent | 97ce3dbf31ec080fbaa0374e8096213c360c2c21 (diff) |
Fix documentation for ast_softhangup() and correct the misuse thereof.
(closes issue #16103)
Reported by: majorbloodnok
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@225105 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | apps/app_meetme.c | 2 | ||||
-rw-r--r-- | include/asterisk/channel.h | 4 | ||||
-rw-r--r-- | main/pbx.c | 5 |
3 files changed, 6 insertions, 5 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c index 6b12ecdb0..1867b7037 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 2a835c96c..42e473b70 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 7cf669c1f..6fe2c3c73 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); |