app_confbridge: Enable sending events to participants

ConfBridge can now send events to participants via in-dialog MESSAGEs.
All current Confbridge events are supported, such as ConfbridgeJoin,
ConfbridgeLeave, etc.  In addition to those events, a new event
ConfbridgeWelcome has been added that will send a list of all
current participants to a new participant.

For all but the ConfbridgeWelcome event, the JSON message contains
information about the bridge, such as its id and name, and information
about the channel that triggered the event such as channel name,
callerid info, mute status, and the MSID labels for their audio and
video tracks. You can use the labels to correlate callerid and mute
status to specific video elements in a webrtc client.

To control this behavior, the following options have been added to
confbridge.conf:

bridge_profile/enable_events:  This must be enabled on any bridge where
events are desired.

user_profile/send_events:  This must be set for a user profile to send
events.  Different user profiles connected to the same bridge can have
different settings.  This allows admins to get events but not normal
users for instance.

user_profile/echo_events:  In some cases, you might not want the user
triggering the event to get the event sent back to them.  To prevent it,
set this to false.

A change was also made to res_pjsip_sdp_rtp to save the generated msid
to the stream so it can be re-used.  This allows participant A's video
stream to appear as the same label to all other participants.

Change-Id: I26420aa9f101f0b2387dc9e2fd10733197f1318e
This commit is contained in:
George Joseph
2018-05-31 15:22:13 -06:00
parent a6a22debf1
commit e7a7506f9c
7 changed files with 485 additions and 28 deletions

View File

@@ -65,6 +65,8 @@ enum user_profile_flags {
USER_OPT_ANNOUNCEUSERCOUNTALL = (1 << 14), /*!< Sets if the number of users should be announced to everyone. */
USER_OPT_JITTERBUFFER = (1 << 15), /*!< Places a jitterbuffer on the user. */
USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW = (1 << 16), /*!< modifies ANNOUNCE_JOIN_LEAVE - user reviews the recording before continuing */
USER_OPT_SEND_EVENTS = (1 << 17), /*!< Send text message events to users */
USER_OPT_ECHO_EVENTS = (1 << 18), /*!< Send events only to the admin(s) */
};
enum bridge_profile_flags {
@@ -79,6 +81,7 @@ enum bridge_profile_flags {
BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE = (1 << 8), /*!< The average of all REMB reports is sent to the sender */
BRIDGE_OPT_REMB_BEHAVIOR_LOWEST = (1 << 9), /*!< The lowest estimated maximum bitrate is sent to the sender */
BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST = (1 << 10), /*!< The highest estimated maximum bitrate is sent to the sender */
BRIDGE_OPT_ENABLE_EVENTS = (1 << 11), /*!< Enable sending events to participants */
};
enum conf_menu_action_id {
@@ -625,6 +628,26 @@ struct stasis_message_type *confbridge_unmute_type(void);
*/
struct stasis_message_type *confbridge_talking_type(void);
/*!
* \since 15.5
* \brief get the confbridge welcome stasis message type
*
* \retval stasis message type for confbridge welcome messages if it's available
* \retval NULL if it isn't
*/
struct stasis_message_type *confbridge_welcome_type(void);
/*!
* \since 15.5
* \brief Get the string representation of a confbridge stasis message type
*
* \param event_type The confbridge event type such as 'confbridge_welcome_type()'
*
* \retval The string representation of the message type
* \retval "unknown" if not found
*/
const char *confbridge_event_type_to_string(struct stasis_message_type *event_type);
/*!
* \since 12.0
* \brief register stasis message routers to handle manager events for confbridge messages