[asterisk-commits] file: branch file/bridging r100326 - in /team/file/bridging: ./ include/aster...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 24 20:53:32 CST 2008


Author: file
Date: Thu Jan 24 20:53:32 2008
New Revision: 100326

URL: http://svn.digium.com/view/asterisk?view=rev&rev=100326
Log:
Merged revisions 100325 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r100325 | file | 2008-01-24 22:52:10 -0400 (Thu, 24 Jan 2008) | 2 lines

Add an API call that steals the answered channel so that a destruction of the dialing structure does not hang it up.

........

Modified:
    team/file/bridging/   (props changed)
    team/file/bridging/include/asterisk/dial.h
    team/file/bridging/main/dial.c

Propchange: team/file/bridging/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jan 24 20:53:32 2008
@@ -1,1 +1,1 @@
-/trunk:1-100308
+/trunk:1-100325

Modified: team/file/bridging/include/asterisk/dial.h
URL: http://svn.digium.com/view/asterisk/team/file/bridging/include/asterisk/dial.h?view=diff&rev=100326&r1=100325&r2=100326
==============================================================================
--- team/file/bridging/include/asterisk/dial.h (original)
+++ team/file/bridging/include/asterisk/dial.h Thu Jan 24 20:53:32 2008
@@ -81,6 +81,12 @@
  * \param dial Dialing structure
  */
 struct ast_channel *ast_dial_answered(struct ast_dial *dial);
+
+/*! \brief Steal the channel that answered
+ * \note Returns the Asterisk channel that answered and removes it from the dialing structure
+ * \param dial Dialing structure
+ */
+struct ast_channel *ast_dial_answered_steal(struct ast_dial *dial);
 
 /*! \brief Return state of dial
  * \note Returns the state of the dial attempt

Modified: team/file/bridging/main/dial.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/main/dial.c?view=diff&rev=100326&r1=100325&r2=100326
==============================================================================
--- team/file/bridging/main/dial.c (original)
+++ team/file/bridging/main/dial.c Thu Jan 24 20:53:32 2008
@@ -721,6 +721,25 @@
 	return ((dial->state == AST_DIAL_RESULT_ANSWERED) ? AST_LIST_FIRST(&dial->channels)->owner : NULL);
 }
 
+/*! \brief Steal the channel that answered
+ * \note Returns the Asterisk channel that answered and removes it from the dialing structure
+ * \param dial Dialing structure
+ */
+struct ast_channel *ast_dial_answered_steal(struct ast_dial *dial)
+{
+	struct ast_channel *chan = NULL;
+
+	if (!dial)
+		return NULL;
+
+	if (dial->state == AST_DIAL_RESULT_ANSWERED) {
+		chan = AST_LIST_FIRST(&dial->channels)->owner;
+		AST_LIST_FIRST(&dial->channels)->owner = NULL;
+	}
+
+	return chan;
+}
+
 /*! \brief Return state of dial
  * \note Returns the state of the dial attempt
  * \param dial Dialing structure




More information about the asterisk-commits mailing list