diff options
author | David M. Lee <dlee@digium.com> | 2013-03-25 16:19:55 +0000 |
---|---|---|
committer | David M. Lee <dlee@digium.com> | 2013-03-25 16:19:55 +0000 |
commit | 4a6237b231df34494e420b577be320cde00d2619 (patch) | |
tree | 835d1fa72267de7face0d602c945b21ff59639ac /include | |
parent | d484f366f5e2f4a54d760cb39a10391f9ab94f52 (diff) |
Move NewCallerid, HangupRequest and SoftHangupRequest to Stasis
HangupRequest and SoftHangupRequest are now ast_channel_blob Stasis
messages, with the cause code as an optional field in the blob.
NewCallerid now simply watches for changes in the callerid information
in channel snapshots, and creates the AMI event appropriately.
Since the original NewCallerid event honored the channelvars setting
in manager.conf, the channel variables configured there had to become
a part of the channel snapshot. These are now a part of every snapshot
based event, making the configuration description "every time a
channel-oriented event is emitted" less of a lie.
There a a few other changes wrapped up in here as well.
* When ast_channel_topic() is given NULL for a channel, it returns
the ast_channel_topic_all() topic instead of NULL. This can clean
up a lot of NULL checking we're doing currently.
* The fields Cause and Cause-txt were removed from the base channel
information and put only on the Hangup events, since those fields
are meaningless outside of a Hangup event.
* Removed the pipe-delimiter processing of the channelvars field,
since that's been deprecated forever.
(closes issue ASTERISK-21096)
Review: https://reviewboard.asterisk.org/r/2405/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/channel.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 8fef86d2c..b60a92af8 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -4136,7 +4136,11 @@ struct ast_channel_snapshot { int priority; /*!< Dialplan: Current extension priority */ int amaflags; /*!< AMA flags for billing */ int hangupcause; /*!< Why is the channel hanged up. See causes.h */ + int caller_pres; /*!< Caller ID presentation. */ + struct ast_flags flags; /*!< channel flags of AST_FLAG_ type */ + + struct varshead *manager_vars; /*!< Variables to be appended to manager events */ }; /*! @@ -4153,6 +4157,27 @@ struct ast_channel_snapshot *ast_channel_snapshot_create(struct ast_channel *cha /*! * \since 12 + * \brief Sets the variables to be stored in the \a manager_vars field of all + * snapshots. + * \param varc Number of variable names. + * \param vars Array of variable names. + */ +void ast_channel_set_manager_vars(size_t varc, char **vars); + +/*! + * \since 12 + * \brief Gets the variables for a given channel, as specified by ast_channel_set_manager_vars(). + * + * The returned variable list is an AO2 object, so ao2_cleanup() to free it. + * + * \param chan Channel to get variables for. + * \return List of channel variables. + * \return \c NULL on error + */ +struct varshead *ast_channel_get_manager_vars(struct ast_channel *chan); + +/*! + * \since 12 * \brief Message type for \ref ast_channel_snapshot. * * \retval Message type for \ref ast_channel_snapshot. @@ -4163,10 +4188,12 @@ struct stasis_message_type *ast_channel_snapshot(void); * \since 12 * \brief A topic which publishes the events for a particular channel. * - * \param chan Channel. + * If the given \a chan is \c NULL, ast_channel_topic_all() is returned. + * + * \param chan Channel, or \c NULL. * * \retval Topic for channel's events. - * \retval \c NULL if \a chan is \c NULL. + * \retval ast_channel_topic_all() if \a chan is \c NULL. */ struct stasis_topic *ast_channel_topic(struct ast_channel *chan); |