Skip to content
Snippets Groups Projects
Commit 0b898073 authored by Joshua Colp's avatar Joshua Colp
Browse files

Add an API call that steals the answered channel so that a destruction of the...

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 3d776930
Branches
Tags
No related merge requests found
...@@ -82,6 +82,12 @@ enum ast_dial_result ast_dial_run(struct ast_dial *dial, struct ast_channel *cha ...@@ -82,6 +82,12 @@ enum ast_dial_result ast_dial_run(struct ast_dial *dial, struct ast_channel *cha
*/ */
struct ast_channel *ast_dial_answered(struct ast_dial *dial); 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 /*! \brief Return state of dial
* \note Returns the state of the dial attempt * \note Returns the state of the dial attempt
* \param dial Dialing structure * \param dial Dialing structure
......
...@@ -721,6 +721,25 @@ struct ast_channel *ast_dial_answered(struct ast_dial *dial) ...@@ -721,6 +721,25 @@ struct ast_channel *ast_dial_answered(struct ast_dial *dial)
return ((dial->state == AST_DIAL_RESULT_ANSWERED) ? AST_LIST_FIRST(&dial->channels)->owner : NULL); 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 /*! \brief Return state of dial
* \note Returns the state of the dial attempt * \note Returns the state of the dial attempt
* \param dial Dialing structure * \param dial Dialing structure
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment