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
1.4
Tilghman Lesher 16 years ago
parent 8699a5f158
commit 6e8a455534

@ -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;
}

@ -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

@ -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);

Loading…
Cancel
Save