Dial: Add function to append already-created channel.

The Dial API takes responsiblity for creating an outbound channel when
calling ast_dial_append(). This commit adds a new function,
ast_dial_append_channel(), which allows us to create the channel outside
the Dial API and then to append the channel to the ast_dial structure.

This is useful for situations where the channel's creation and dialing
are distinct operations. Upcoming ARI early bridge work will illustrate
its usage.

ASTERISK-25889

Change-Id: Id8179f64f8f99132f80dead8d5db2030fd2c0509
This commit is contained in:
Mark Michelson
2016-03-30 16:47:15 -05:00
committed by Richard Mudgett
parent 23d2a561d5
commit ef4d3f1328
2 changed files with 87 additions and 32 deletions

View File

@@ -76,6 +76,18 @@ struct ast_dial *ast_dial_create(void);
*/
int ast_dial_append(struct ast_dial *dial, const char *tech, const char *device, const struct ast_assigned_ids *assignedids);
/*!
* \brief Append a channel using an actual channel object
*
* \param dial The ast_dial to add the channel to
* \param chan The channel to add to the dial
* \retval -1 Failure
* \retval non-zero The position of the channel in the list of dialed channels
*
* \note The chan ref is stolen with a successful return.
*/
int ast_dial_append_channel(struct ast_dial *dial, struct ast_channel *chan);
/*! \brief Request all appended channels, but do not dial
* \param dial Dialing structure
* \param chan Optional dialing channel