]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix documentation for ast_softhangup() and correct the misuse thereof.
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 21 Oct 2009 16:02:12 +0000 (16:02 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 21 Oct 2009 16:02:12 +0000 (16:02 +0000)
(closes issue #16103)
 Reported by: majorbloodnok

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@225105 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_meetme.c
include/asterisk/channel.h
main/pbx.c

index 6b12ecdb00fa9f6be45090f927693325b5cc3b69..1867b7037960a68f8142b283c47d0dff85ddab9b 100644 (file)
@@ -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;
 }
 
index 2a835c96c9629831a37b999356781d608bc96721..42e473b7039dcfbcf2088156a260ee269c2d1fc8 100644 (file)
@@ -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 
index 7cf669c1f198b208b2af9a751c33fe3787bfedc6..6fe2c3c73a26147077a5fc3a24b405ef13107416 100644 (file)
@@ -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);