stasis/endpoint: Fix memory leak of channel_ids in ast_endpoint structure.

During Bridging of two channels if masquerade operation is performed on a
channel (clone channel) which was created with endpoint details
(ast_channel_alloc_with_endpoint()) and the original channel which is created
without endpoint details (ast_channel_alloc()) then both the channels must
exchange their endpoint details or else after masquerade when clone channel
is being destroyed the endpoint cleanup callbacks will be destroyed too and
after call completion unique_id of original channel will still be there in
ast_endpoint structure's channel_ids container.

ASTERISK-28197

Change-Id: I97ce73da390af20fd082fb09d722a6fe9cb2f39d
This commit is contained in:
mohitdhiman
2019-01-12 13:59:12 +05:30
parent 28dbb06e8c
commit d60ee2eeae
3 changed files with 26 additions and 0 deletions

View File

@@ -2658,6 +2658,18 @@ void ast_channel_internal_swap_uniqueid_and_linkedid(struct ast_channel *a, stru
*/
void ast_channel_internal_swap_topics(struct ast_channel *a, struct ast_channel *b);
/*!
* \brief Swap endpoint_forward between two channels
* \param a First channel
* \param b Second channel
* \return void
*
* \note
* This is used in masquerade to exchange endpoint details if one of the two or both
* the channels were created with endpoint
*/
void ast_channel_internal_swap_endpoint_forward(struct ast_channel *a, struct ast_channel *b);
/*!
* \brief Swap snapshots beteween two channels
* \param a First channel