app_confbridge: Use bridge join hook to send join and leave events

The first attempt at publishing confbridge events to participants
involved publishing them at the same time stasis events were
created.  This caused issues with bridge and channel locks.  The
second attempt involved publishing them when the stasis events
were received by the code that published the confbridge AMI events.
This caused timing issues because, depending on resources available,
the event could be received before channels actually joined the
bridge and would therefore fail to send messages to the participant.

This attempt reverts to the original mechanism with one exception.
The join and leave events are published via bridge join and leave
hooks.  This guarantees the states of the channels and bridge and
provides deterministic timing for event publishing.

Change-Id: I2660074f8a30a5224cb953d5e047ee84484a9036
This commit is contained in:
George Joseph
2018-09-27 12:19:28 -06:00
parent 9914e3998e
commit f10c7b6eeb
3 changed files with 75 additions and 14 deletions

View File

@@ -701,6 +701,16 @@ int conf_announce_channel_push(struct ast_channel *ast);
*/
struct confbridge_conference *conf_find_bridge(const char *conference_name);
/*!
* \brief Send events to bridge participants.
* \since 15.7
* \since 16.1
*
* \param conference The conference bridge
* \param chan The channel triggering the action
* \param msg The stasis message describing the event
*/
void conf_send_event_to_participants(struct confbridge_conference *conference,
struct ast_channel *chan, struct stasis_message *msg);
#endif