Move origination to use the dialing API and send Stasis messages on dial begin and end.

(closes issue ASTERISK-21549)
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/2512/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2013-05-18 19:47:24 +00:00
parent b97c71bb11
commit 4e38a4eb64
4 changed files with 352 additions and 465 deletions

View File

@@ -33,6 +33,9 @@ struct ast_dial;
/*! \brief Dialing channel structure. Contains per-channel dialing options, asterisk channel, and more! */
struct ast_dial_channel;
/*! \brief Forward declaration for format capabilities, used in prerun */
struct ast_format_cap;
typedef void (*ast_dial_state_callback)(struct ast_dial *);
/*! \brief List of options that are applicable either globally or per dialed channel */
@@ -70,6 +73,15 @@ struct ast_dial *ast_dial_create(void);
*/
int ast_dial_append(struct ast_dial *dial, const char *tech, const char *device);
/*! \brief Request all appended channels, but do not dial
* \param dial Dialing structure
* \param chan Optional dialing channel
* \param cap Optional requested capabilities
* \retval -1 failure
* \reval 0 success
*/
int ast_dial_prerun(struct ast_dial *dial, struct ast_channel *chan, struct ast_format_cap *cap);
/*! \brief Execute dialing synchronously or asynchronously
* \note Dials channels in a dial structure.
* \return Returns dial result code. (TRYING/INVALID/FAILED/ANSWERED/TIMEOUT/UNANSWERED).
@@ -145,6 +157,20 @@ int ast_dial_option_global_disable(struct ast_dial *dial, enum ast_dial_option o
*/
int ast_dial_option_disable(struct ast_dial *dial, int num, enum ast_dial_option option);
/*! \brief Get the reason an outgoing channel has failed
* \param dial Dial structure
* \param num Channel number to get the reason from
* \return Numerical cause code
*/
int ast_dial_reason(struct ast_dial *dial, int num);
/*! \brief Get the dialing channel, if prerun has been executed
* \param dial Dial structure
* \param num Channel number to get channel of
* \return Pointer to channel, without reference
*/
struct ast_channel *ast_dial_get_channel(struct ast_dial *dial, int num);
/*! \brief Set a callback for state changes
* \param dial The dial structure to watch for state changes
* \param callback the callback