diff options
author | Joshua Colp <jcolp@digium.com> | 2013-05-18 19:47:24 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2013-05-18 19:47:24 +0000 |
commit | 4e38a4eb6459ef79ebee61c87f144e0d5d0122eb (patch) | |
tree | e7faa017d2c0d21f6ca3f9007b27694763688204 /include/asterisk | |
parent | b97c71bb1190cb41eba9081d14724bcb39d422ba (diff) |
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
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/dial.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/asterisk/dial.h b/include/asterisk/dial.h index 04721d283..0991c8ff6 100644 --- a/include/asterisk/dial.h +++ b/include/asterisk/dial.h @@ -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 |