diff options
author | Jonathan Rose <jrose@digium.com> | 2014-05-22 15:52:30 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2014-05-22 15:52:30 +0000 |
commit | d00882108fabd3798aa6566aa5697d82459e753e (patch) | |
tree | 0cb38a4b41e85b73f89486b8492a0fc3078e3ba9 /include | |
parent | 912bbdd1ddf98b4e6d99b3cb258f103c09ee132f (diff) |
res_pjsip_refer: Fix bugs involving Parking/PJSIP/transfers
PJSIP would never send the final 200 Notify for a blind transfer
when transferring to parking. This patch fixes that. In addition,
it fixes a reference leak when performing blind transfers to
non-bridging extensions.
Review: https://reviewboard.asterisk.org/r/3485/
........
Merged revisions 414400 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/bridge.h | 18 | ||||
-rw-r--r-- | include/asterisk/parking.h | 12 |
2 files changed, 27 insertions, 3 deletions
diff --git a/include/asterisk/bridge.h b/include/asterisk/bridge.h index 8768fe1be..d23d4b5bc 100644 --- a/include/asterisk/bridge.h +++ b/include/asterisk/bridge.h @@ -904,6 +904,22 @@ enum ast_transfer_type { }; /*! + * \brief AO2 object that wraps data for transfer_channel_cb + */ +struct transfer_channel_data { + void *data; /*! Data to be used by the transfer_channel_cb -- note that this + * pointer is going to be pointing to something on the stack, so + * it must not be used at any point after returning from the + * transfer_channel_cb. */ + int completed; /*! Initially 0, This will be set to 1 by either the transfer + * code or by transfer code hooks (e.g. parking) when the + * transfer is completed and any remaining actions have taken + * place (e.g. parking announcements). It will never be reset + * to 0. This is used for deferring progress for channel + * drivers that support deferred progress. */ +}; + +/*! * \brief Callback function type called during blind transfers * * A caller of ast_bridge_transfer_blind() may wish to set data on @@ -914,7 +930,7 @@ enum ast_transfer_type { * \param user_data User-provided data needed in the callback * \param transfer_type The type of transfer being completed */ -typedef void (*transfer_channel_cb)(struct ast_channel *chan, void *user_data, +typedef void (*transfer_channel_cb)(struct ast_channel *chan, struct transfer_channel_data *user_data, enum ast_transfer_type transfer_type); /*! diff --git a/include/asterisk/parking.h b/include/asterisk/parking.h index 8b2b4b409..a8832cdb8 100644 --- a/include/asterisk/parking.h +++ b/include/asterisk/parking.h @@ -24,6 +24,7 @@ */ #include "asterisk/stringfields.h" +#include "asterisk/bridge.h" /*! * \brief The default parking application that Asterisk expects. @@ -163,6 +164,8 @@ struct ast_parking_bridge_feature_fn_table { * \param parker The \ref bridge_channel object that is initiating the parking * \param context The context to blind transfer to * \param exten The extension to blind transfer to + * \param parked_channel_cb Execute the following function on the the channel that gets parked + * \param parked_channel_data Data for the parked_channel_cb * * \note If the bridge \ref parker is in has more than one other occupant, the entire * bridge will be parked using a Local channel @@ -172,7 +175,8 @@ struct ast_parking_bridge_feature_fn_table { * \retval 0 on success * \retval non-zero on error */ - int (* parking_blind_transfer_park)(struct ast_bridge_channel *parker, const char *context, const char *exten); + int (* parking_blind_transfer_park)(struct ast_bridge_channel *parker, const char *context, + const char *exten, transfer_channel_cb parked_channel_cb, struct transfer_channel_data *parked_channel_data); /*! * \brief Perform a direct park on a channel in a bridge. @@ -224,6 +228,9 @@ int ast_parking_park_call(struct ast_bridge_channel *parker, char *exten, size_t * \param parker The \ref bridge_channel object that is initiating the parking * \param context The context to blind transfer to * \param exten The extension to blind transfer to + * \param exten The extension to blind transfer to + * \param parked_channel_cb Execute the following function on the the channel that gets parked + * \param parked_channel_data Data for the parked_channel_cb * * \note If the bridge \ref parker is in has more than one other occupant, the entire * bridge will be parked using a Local channel @@ -233,7 +240,8 @@ int ast_parking_park_call(struct ast_bridge_channel *parker, char *exten, size_t * \retval 0 on success * \retval non-zero on error */ -int ast_parking_blind_transfer_park(struct ast_bridge_channel *parker, const char *context, const char *exten); +int ast_parking_blind_transfer_park(struct ast_bridge_channel *parker, const char *context, + const char *exten, transfer_channel_cb parked_channel_cb, struct transfer_channel_data *parked_channel_data); /*! * \brief Perform a direct park on a channel in a bridge. |