From ef4d3f132892a0ce12649bea2f325803e9ad7076 Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Wed, 30 Mar 2016 16:47:15 -0500 Subject: 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 --- include/asterisk/dial.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/asterisk/dial.h b/include/asterisk/dial.h index c59257ce5..168c5091a 100644 --- a/include/asterisk/dial.h +++ b/include/asterisk/dial.h @@ -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 -- cgit v1.2.3