Asterisk - The Open Source Telephony Project GIT-master-0bf3178
confbridge.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2011, Digium, Inc.
5 *
6 * David Vossel <dvossel@digium.com>
7 * Joshua Colp <jcolp@digium.com>
8 *
9 * See http://www.asterisk.org for more information about
10 * the Asterisk project. Please do not directly contact
11 * any of the maintainers of this project for assistance;
12 * the project provides a web site, mailing lists and IRC
13 * channels for your use.
14 *
15 * This program is free software, distributed under the terms of
16 * the GNU General Public License Version 2. See the LICENSE file
17 * at the top of the source tree.
18 */
19
20
21#ifndef _CONFBRIDGE_H
22#define _CONFBRIDGE_H
23
24#include "asterisk.h"
25#include "asterisk/app.h"
26#include "asterisk/logger.h"
28#include "asterisk/channel.h"
29#include "asterisk/bridge.h"
32#include "conf_state.h"
33
34/*! Maximum length of a conference bridge name */
35#define MAX_CONF_NAME AST_MAX_EXTENSION
36/*! Maximum length of a conference pin */
37#define MAX_PIN 80
38/*! Maximum length of bridge/user/menu profile names */
39#define MAX_PROFILE_NAME 128
40
41#define DEFAULT_USER_PROFILE "default_user"
42#define DEFAULT_BRIDGE_PROFILE "default_bridge"
43#define DEFAULT_MENU_PROFILE "default_menu"
44
45/*! Default minimum average magnitude threshold to determine talking by the DSP. */
46#define DEFAULT_TALKING_THRESHOLD 160
47
48/*! Default time in ms of silence necessary to declare talking stopped by the bridge. */
49#define DEFAULT_SILENCE_THRESHOLD 2500
50
52 USER_OPT_ADMIN = (1 << 0), /*!< Set if the caller is an administrator */
53 USER_OPT_NOONLYPERSON = (1 << 1), /*!< Set if the "you are currently the only person in this conference" sound file should not be played */
54 USER_OPT_MARKEDUSER = (1 << 2), /*!< Set if the caller is a marked user */
55 USER_OPT_STARTMUTED = (1 << 3), /*!< Set if the caller should be initially set muted */
56 USER_OPT_MUSICONHOLD = (1 << 4), /*!< Set if music on hold should be played if nobody else is in the conference bridge */
57 USER_OPT_QUIET = (1 << 5), /*!< Set if no audio prompts should be played */
58 USER_OPT_ANNOUNCEUSERCOUNT = (1 << 6), /*!< Set if the number of users should be announced to the caller */
59 USER_OPT_WAITMARKED = (1 << 7), /*!< Set if the user must wait for a marked user before starting */
60 USER_OPT_ENDMARKED = (1 << 8), /*!< Set if the user should be kicked after the last Marked user exits */
61 USER_OPT_DENOISE = (1 << 9), /*!< Sets if denoise filter should be used on audio before mixing. */
62 USER_OPT_ANNOUNCE_JOIN_LEAVE = (1 << 10), /*!< Sets if the user's name should be recorded and announced on join and leave. */
63 USER_OPT_TALKER_DETECT = (1 << 11), /*!< Sets if start and stop talking events should generated for this user over AMI. */
64 USER_OPT_DROP_SILENCE = (1 << 12), /*!< Sets if silence should be dropped from the mix or not. */
65 USER_OPT_DTMF_PASS = (1 << 13), /*!< Sets if dtmf should be passed into the conference or not */
66 USER_OPT_ANNOUNCEUSERCOUNTALL = (1 << 14), /*!< Sets if the number of users should be announced to everyone. */
67 USER_OPT_JITTERBUFFER = (1 << 15), /*!< Places a jitterbuffer on the user. */
68 USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW = (1 << 16), /*!< modifies ANNOUNCE_JOIN_LEAVE - user reviews the recording before continuing */
69 USER_OPT_SEND_EVENTS = (1 << 17), /*!< Send text message events to users */
70 USER_OPT_ECHO_EVENTS = (1 << 18), /*!< Send events only to the admin(s) */
71 USER_OPT_TEXT_MESSAGING = (1 << 19), /*!< Send text messages to the user */
72 USER_OPT_ANSWER_CHANNEL = (1 << 20), /*!< Sets if the channel should be answered if currently unanswered */
73 USER_OPT_HEAR_OWN_JOIN_SOUND = (1 << 21), /*!< Set if the caller should hear the join sound */
74 USER_OPT_ENDMARKEDANY = (1 << 22), /*!< Set if the user should be kicked after any marked user exits */
75};
76
78 BRIDGE_OPT_RECORD_CONFERENCE = (1 << 0), /*!< Set if the conference should be recorded */
79 BRIDGE_OPT_VIDEO_SRC_LAST_MARKED = (1 << 1), /*!< Set if conference should feed video of last marked user to all participants. */
80 BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED = (1 << 2), /*!< Set if conference should feed video of first marked user to all participants. */
81 BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER = (1 << 3), /*!< Set if conference set the video feed to follow the loudest talker. */
82 BRIDGE_OPT_RECORD_FILE_APPEND = (1 << 4), /*!< Set if the record file should be appended to between start/stops. */
83 BRIDGE_OPT_RECORD_FILE_TIMESTAMP = (1 << 5), /*!< Set if the record file should have a timestamp appended */
84 BRIDGE_OPT_BINAURAL_ACTIVE = (1 << 6), /*!< Set if binaural convolution is activated */
85 BRIDGE_OPT_VIDEO_SRC_SFU = (1 << 7), /*!< Selective forwarding unit */
86 BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE = (1 << 8), /*!< The average of all REMB reports is sent to the sender */
87 BRIDGE_OPT_REMB_BEHAVIOR_LOWEST = (1 << 9), /*!< The lowest estimated maximum bitrate is sent to the sender */
88 BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST = (1 << 10), /*!< The highest estimated maximum bitrate is sent to the sender */
89 BRIDGE_OPT_ENABLE_EVENTS = (1 << 11), /*!< Enable sending events to participants */
90 BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE_ALL = (1 << 12), /*!< The average of all REMB reports in the entire bridge is sent to each sender */
91 BRIDGE_OPT_REMB_BEHAVIOR_LOWEST_ALL = (1 << 13), /*!< The lowest estimated maximum bitrate from all receivers is sent to each sender */
92 BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST_ALL = (1 << 14), /*!< The highest estimated maximum bitrate from all receivers is sent to each sender */
93 BRIDGE_OPT_REMB_BEHAVIOR_FORCE = (1 << 15), /*!< Force the REMB estimated bitrate to that specifiec in remb_estimated_bitrate */
94};
95
116};
117
118/*! The conference menu action contains both
119 * the action id that represents the action that
120 * must take place, along with any data associated
121 * with that action. */
124 union {
126 struct {
133};
134
135/*! Conference menu entries contain the DTMF sequence
136 * and the list of actions that are associated with that
137 * sequence. */
139 /*! the DTMF sequence that triggers the actions */
141 /*! The actions associated with this menu entry. */
144};
145
146/*! Conference menu structure. Contains a list
147 * of DTMF sequences coupled with the actions those
148 * sequences invoke.*/
149struct conf_menu {
152};
153
157 char moh_class[128];
159 unsigned int flags;
161 /*! Minimum average magnitude threshold to determine talking by the DSP. */
162 unsigned int talking_threshold;
163 /*! Time in ms of silence necessary to declare talking stopped by the bridge. */
164 unsigned int silence_threshold;
165 /*! The time in ms the user may stay in the confbridge */
166 unsigned int timeout;
167};
168
195};
196
224 );
225};
226
229 char language[MAX_LANGUAGE]; /*!< Language used for playback_chan */
231 char rec_options[128];
232 char rec_command[128];
233 unsigned int flags;
234 unsigned int max_members; /*!< The maximum number of participants allowed in the conference */
235 unsigned int internal_sample_rate; /*!< The internal sample rate of the bridge. 0 when set to auto adjust mode. */
236 unsigned int maximum_sample_rate; /*!< The maximum sample rate of the bridge. 0 when set to no maximum. */
237 unsigned int mix_interval; /*!< The internal mixing interval used by the bridge. When set to 0 the bridgewill use a default interval. */
240 unsigned int video_update_discard; /*!< Amount of time after sending a video update request that subsequent requests should be discarded */
241 unsigned int remb_send_interval; /*!< Interval at which a combined REMB frame is sent to video sources */
242 unsigned int remb_estimated_bitrate; /*!< Bitrate sent when BRIDGE_OPT_REMB_BEHAVIOR_FORCE is set */
243};
244
245/*! \brief The structure that represents a conference bridge */
247 char name[MAX_CONF_NAME]; /*!< Name of the conference bridge */
248 struct confbridge_state *state; /*!< Conference state information */
249 struct ast_bridge *bridge; /*!< Bridge structure doing the mixing */
250 struct bridge_profile b_profile; /*!< The Bridge Configuration Profile */
251 unsigned int activeusers; /*!< Number of active users present */
252 unsigned int markedusers; /*!< Number of marked users present */
253 unsigned int waitingusers; /*!< Number of waiting users present */
254 unsigned int locked:1; /*!< Is this conference bridge locked? */
255 unsigned int muted:1; /*!< Is this conference bridge muted? */
256 struct ast_channel *playback_chan; /*!< Channel used for playback into the conference bridge */
257 struct ast_channel *record_chan; /*!< Channel used for recording the conference */
258 struct ast_str *record_filename; /*!< Recording filename. */
259 struct ast_str *orig_rec_file; /*!< Previous b_profile.rec_file. */
260 AST_LIST_HEAD_NOLOCK(, confbridge_user) active_list; /*!< List of users participating in the conference bridge */
261 AST_LIST_HEAD_NOLOCK(, confbridge_user) waiting_list; /*!< List of users waiting to join the conference bridge */
262 struct ast_taskprocessor *playback_queue; /*!< Queue for playing back bridge announcements and managing the announcer channel */
263};
264
265extern struct ao2_container *conference_bridges;
266
268 int (*func)(struct confbridge_user *user);
270};
271
272/*! \brief The structure that represents a conference bridge user */
274 struct confbridge_conference *conference; /*!< Conference bridge they are participating in */
275 struct bridge_profile b_profile; /*!< The Bridge Configuration Profile */
276 struct user_profile u_profile; /*!< The User Configuration Profile */
277 char menu_name[MAX_PROFILE_NAME]; /*!< The name of the DTMF menu assigned to this user */
278 char name_rec_location[PATH_MAX]; /*!< Location of the User's name recorded file if it exists */
279 struct ast_channel *chan; /*!< Asterisk channel participating */
280 struct ast_bridge_features features; /*!< Bridge features structure */
281 struct ast_bridge_tech_optimizations tech_args; /*!< Bridge technology optimizations for talk detection */
282 unsigned int suspended_moh; /*!< Count of active suspended MOH actions. */
283 unsigned int muted:1; /*!< Has the user requested to be muted? */
284 unsigned int kicked:1; /*!< User has been kicked from the conference */
285 unsigned int playing_moh:1; /*!< MOH is currently being played to the user */
286 unsigned int talking:1; /*!< User is currently talking */
287 AST_LIST_HEAD_NOLOCK(, post_join_action) post_join_list; /*!< List of sounds to play after joining */;
288 AST_LIST_ENTRY(confbridge_user) list; /*!< Linked list information */
289};
290
291/*! \brief load confbridge.conf file */
292int conf_load_config(void);
293
294/*! \brief reload confbridge.conf file */
295int conf_reload_config(void);
296
297/*! \brief destroy the information loaded from the confbridge.conf file*/
298void conf_destroy_config(void);
299
300/*!
301 * \brief find a user profile given a user profile's name and store
302 * that profile in result structure.
303 *
304 * \param chan channel the user profile is requested for
305 * \param user_profile_name name of the profile requested (optional)
306 * \param result data contained by the user profile will be copied to this struct pointer
307 *
308 * \details If user_profile_name is not provided, this function will
309 * check for the presence of a user profile set by the CONFBRIDGE
310 * function on a channel datastore. If that doesn't exist, the
311 * default_user profile is used.
312 *
313 * \retval user profile on success
314 * \retval NULL on failure
315 */
316const struct user_profile *conf_find_user_profile(struct ast_channel *chan, const char *user_profile_name, struct user_profile *result);
317
318/*!
319 * \brief Find a bridge profile given a bridge profile's name and store
320 * that profile in result structure.
321 *
322 * \param chan channel the bridge profile is requested for
323 * \param bridge_profile_name name of the profile requested (optional)
324 * \param result data contained by the bridge profile will be copied to this struct pointer
325 *
326 * \details If bridge_profile_name is not provided, this function will
327 * check for the presence of a bridge profile set by the CONFBRIDGE
328 * function on a channel datastore. If that doesn't exist, the
329 * default_bridge profile is used.
330 *
331 * \retval bridge profile on success
332 * \retval NULL on failure
333 */
334const struct bridge_profile *conf_find_bridge_profile(struct ast_channel *chan, const char *bridge_profile_name, struct bridge_profile *result);
335
336/*!
337 * \brief find a menu profile given a menu profile's name and apply
338 * the menu in DTMF hooks.
339 *
340 * \param chan channel the menu profile is requested for
341 * \param user user profile the menu is being applied to
342 * \param menu_profile_name name of the profile requested (optional)
343 *
344 * \details If menu_profile_name is not provided, this function will
345 * check for the presence of a menu profile set by the CONFBRIDGE
346 * function on a channel datastore. If that doesn't exist, the
347 * default_menu profile is used.
348 *
349 * \retval 0 on success
350 * \retval -1 on failure
351 */
352int conf_set_menu_to_user(struct ast_channel *chan, struct confbridge_user *user, const char *menu_profile_name);
353
354/*!
355 * \brief Destroy a bridge profile found by 'conf_find_bridge_profile'
356 */
357void conf_bridge_profile_destroy(struct bridge_profile *b_profile);
358
359/*!
360 * \brief copies a bridge profile
361 * \note conf_bridge_profile_destroy must be called on the dst structure
362 */
363void conf_bridge_profile_copy(struct bridge_profile *dst, struct bridge_profile *src);
364
365/*!
366 * \brief Finds a menu_entry in a menu structure matched by DTMF sequence.
367 *
368 * \note the menu entry found must be destroyed using conf_menu_entry_destroy()
369 *
370 * \retval 1 success, entry is found and stored in result
371 * \retval 0 failure, no entry found for given DTMF sequence
372 */
373int conf_find_menu_entry_by_sequence(const char *dtmf_sequence, struct conf_menu *menu, struct conf_menu_entry *result);
374
375/*!
376 * \brief Destroys and frees all the actions stored in a menu_entry structure
377 */
378void conf_menu_entry_destroy(struct conf_menu_entry *menu_entry);
379
380/*!
381 * \brief Once a DTMF sequence matches a sequence in the user's DTMF menu, this function will get
382 * called to perform the menu action.
383 *
384 * \param bridge_channel Bridged channel this is involving
385 * \param user the conference user to perform the action on.
386 * \param menu_entry the menu entry that invoked this callback to occur.
387 * \param menu an AO2 referenced pointer to the entire menu structure the menu_entry
388 * derived from.
389 *
390 * \note The menu_entry is a deep copy of the entry found in the menu structure. This allows
391 * for the menu_entry to be accessed without requiring the menu lock. If the menu must
392 * be accessed, the menu lock must be held. Reference counting of the menu structure is
393 * handled outside of the scope of this function.
394 *
395 * \retval 0 success
396 * \retval -1 failure
397 */
399 struct ast_bridge_channel *bridge_channel,
400 struct confbridge_user *user,
401 struct conf_menu_entry *menu_entry,
402 struct conf_menu *menu);
403
404
405/*! \brief Looks to see if sound file is stored in bridge profile sounds, if not
406 * default sound is provided.*/
407const char *conf_get_sound(enum conf_sounds sound, struct bridge_profile_sounds *custom_sounds);
408
409int func_confbridge_helper(struct ast_channel *chan, const char *cmd, char *data, const char *value);
410
411/*!
412 * \brief Play sound file into conference bridge
413 *
414 * \param conference The conference bridge to play sound file into
415 * \param filename Sound file to play
416 *
417 * \retval 0 success
418 * \retval -1 failure
419 */
420int play_sound_file(struct confbridge_conference *conference, const char *filename);
421
422/*!
423 * \brief Play sound file into conference bridge asynchronously
424 *
425 * If the initiator parameter is non-NULL, then the playback will wait for
426 * that initiator channel to get back in the bridge before playing the sound
427 * file. This way, the initiator has no danger of hearing a "clipped" file.
428 *
429 * \param conference The conference bridge to play sound file into
430 * \param filename Sound file to play
431 * \param initiator Channel that initiated playback.
432 *
433 * \retval 0 success
434 * \retval -1 failure
435 */
436int async_play_sound_file(struct confbridge_conference *conference, const char *filename,
437 struct ast_channel *initiator);
438
439/*!
440 * \brief Indicate the initiator of an async sound file is ready for it to play.
441 *
442 * When playing an async sound file, the initiator is typically either out of the bridge
443 * or not in a position to hear the queued announcement. This function lets the announcement
444 * thread know that the initiator is now ready for the sound to play.
445 *
446 * If an async announcement was queued and no initiator channel was provided, then this is
447 * a no-op
448 *
449 * \param chan The channel that initiated the async announcement
450 */
451void async_play_sound_ready(struct ast_channel *chan);
452
453/*! \brief Callback to be called when the conference has become empty
454 * \param conference The conference bridge
455 */
456void conf_ended(struct confbridge_conference *conference);
457
458/*!
459 * \brief Update the actual mute status of the user and set it on the bridge.
460 *
461 * \param user User to update the mute status.
462 */
464
465/*!
466 * \brief Stop MOH for the conference user.
467 *
468 * \param user Conference user to stop MOH on.
469 */
471
472/*!
473 * \brief Start MOH for the conference user.
474 *
475 * \param user Conference user to start MOH on.
476 */
478
479/*! \brief Attempt to mute/play MOH to the only user in the conference if they require it
480 * \param conference A conference bridge containing a single user
481 */
482void conf_mute_only_active(struct confbridge_conference *conference);
483
484/*! \brief Callback to execute any time we transition from zero to one active users
485 * \param conference The conference bridge with a single active user joined
486 */
487void conf_handle_first_join(struct confbridge_conference *conference);
488
489/*! \brief Handle actions every time a waitmarked user joins w/o a marked user present
490 * \param user The waitmarked user
491 * \retval 0 success
492 * \retval -1 failure
493 */
495
496/*! \brief Handle actions whenever an user joins an empty conference
497 *
498 * \param user The user
499 */
501
502/*! \brief Handle when a conference moves to having more than one active participant
503 * \param conference The conference bridge with more than one active participant
504 */
505void conf_handle_second_active(struct confbridge_conference *conference);
506
507/*! \brief Add a conference bridge user as an unmarked active user of the conference
508 * \param conference The conference bridge to add the user to
509 * \param user The conference bridge user to add to the conference
510 */
511void conf_add_user_active(struct confbridge_conference *conference, struct confbridge_user *user);
512
513/*! \brief Add a conference bridge user as a marked active user of the conference
514 * \param conference The conference bridge to add the user to
515 * \param user The conference bridge user to add to the conference
516 */
517void conf_add_user_marked(struct confbridge_conference *conference, struct confbridge_user *user);
518
519/*! \brief Add a conference bridge user as an waiting user of the conference
520 * \param conference The conference bridge to add the user to
521 * \param user The conference bridge user to add to the conference
522 */
523void conf_add_user_waiting(struct confbridge_conference *conference, struct confbridge_user *user);
524
525/*! \brief Remove a conference bridge user from the unmarked active conference users in the conference
526 * \param conference The conference bridge to remove the user from
527 * \param user The conference bridge user to remove from the conference
528 */
529void conf_remove_user_active(struct confbridge_conference *conference, struct confbridge_user *user);
530
531/*! \brief Remove a conference bridge user from the marked active conference users in the conference
532 * \param conference The conference bridge to remove the user from
533 * \param user The conference bridge user to remove from the conference
534 */
535void conf_remove_user_marked(struct confbridge_conference *conference, struct confbridge_user *user);
536
537/*! \brief Remove a conference bridge user from the waiting conference users in the conference
538 * \param conference The conference bridge to remove the user from
539 * \param user The conference bridge user to remove from the conference
540 */
542
543/*! \brief Queue a function to run with the given conference bridge user as an argument once the state transition is complete
544 * \param user The conference bridge user to pass to the function
545 * \param func The function to queue
546 * \retval 0 success
547 * \retval non-zero failure
548 */
549int conf_add_post_join_action(struct confbridge_user *user, int (*func)(struct confbridge_user *user));
550
551/*!
552 * \since 12.0
553 * \brief get the confbridge start stasis message type
554 *
555 * \retval stasis message type for confbridge start messages if it's available
556 * \retval NULL if it isn't
557 */
559
560/*!
561 * \since 12.0
562 * \brief get the confbridge end stasis message type
563 *
564 * \retval stasis message type for confbridge end messages if it's available
565 * \retval NULL if it isn't
566 */
568
569/*!
570 * \since 12.0
571 * \brief get the confbridge join stasis message type
572 *
573 * \retval stasis message type for confbridge join messages if it's available
574 * \retval NULL if it isn't
575 */
577
578/*!
579 * \since 12.0
580 * \brief get the confbridge leave stasis message type
581 *
582 * \retval stasis message type for confbridge leave messages if it's available
583 * \retval NULL if it isn't
584 */
586
587/*!
588 * \since 12.0
589 * \brief get the confbridge start_record stasis message type
590 *
591 * \retval stasis message type for confbridge start_record messages if it's available
592 * \retval NULL if it isn't
593 */
595
596/*!
597 * \since 12.0
598 * \brief get the confbridge stop_record stasis message type
599 *
600 * \retval stasis message type for confbridge stop_record messages if it's available
601 * \retval NULL if it isn't
602 */
604
605/*!
606 * \since 12.0
607 * \brief get the confbridge mute stasis message type
608 *
609 * \retval stasis message type for confbridge mute messages if it's available
610 * \retval NULL if it isn't
611 */
613
614/*!
615 * \since 12.0
616 * \brief get the confbridge unmute stasis message type
617 *
618 * \retval stasis message type for confbridge unmute messages if it's available
619 * \retval NULL if it isn't
620 */
622
623/*!
624 * \since 12.0
625 * \brief get the confbridge talking stasis message type
626 *
627 * \retval stasis message type for confbridge talking messages if it's available
628 * \retval NULL if it isn't
629 */
631
632/*!
633 * \since 15.5
634 * \brief get the confbridge welcome stasis message type
635 *
636 * \retval stasis message type for confbridge welcome messages if it's available
637 * \retval NULL if it isn't
638 */
640
641/*!
642 * \since 15.5
643 * \brief Get the string representation of a confbridge stasis message type
644 *
645 * \param event_type The confbridge event type such as 'confbridge_welcome_type()'
646 *
647 * \retval The string representation of the message type
648 * \retval "unknown" if not found
649 */
650const char *confbridge_event_type_to_string(struct stasis_message_type *event_type);
651
652/*!
653 * \since 12.0
654 * \brief register stasis message routers to handle manager events for confbridge messages
655 *
656 * \retval 0 success
657 * \retval non-zero failure
658 */
660
661/*!
662 * \since 12.0
663 * \brief unregister stasis message routers to handle manager events for confbridge messages
664 */
666
667/*!
668 * \brief Get ConfBridge record channel technology struct.
669 * \since 12.0.0
670 *
671 * \return ConfBridge record channel technology.
672 */
674
675/*!
676 * \brief Get ConfBridge announce channel technology struct.
677 * \since 12.0.0
678 *
679 * \return ConfBridge announce channel technology.
680 */
682
683/*!
684 * \brief Push the announcer channel into the conference.
685 * \since 12.0.0
686 *
687 * \param ast Either channel in the announcer channel pair.
688 *
689 * \retval 0 on success.
690 * \retval -1 on error.
691 */
693
694/*!
695 * \brief Find a confbridge by name.
696 * \since 13.22.0
697 * \since 15.5.0
698 *
699 * \param conference_name The name to search for
700 *
701 * \return ConfBridge (which must be unreffed) or NULL.
702 */
703struct confbridge_conference *conf_find_bridge(const char *conference_name);
704
705/*!
706 * \brief Send events to bridge participants.
707 * \since 15.7
708 * \since 16.1
709 *
710 * \param conference The conference bridge
711 * \param chan The channel triggering the action
712 * \param msg The stasis message describing the event
713 */
715 struct ast_channel *chan, struct stasis_message *msg);
716
717/*!
718 * \brief Create join/leave events for attended transfers
719 * \since 13.28
720 * \since 16.5
721 *
722 * \param msg The attended transfer stasis message
723 *
724 */
726
727#endif
Asterisk main include file. File version handling, generic pbx functions.
#define PATH_MAX
Definition: asterisk.h:40
Bridging API.
Channel Bridging API.
#define MAXIMUM_DTMF_FEATURE_STRING
Maximum length of a DTMF feature string.
static PGresult * result
Definition: cel_pgsql.c:84
General Asterisk PBX channel definitions.
#define MAX_LANGUAGE
Definition: channel.h:174
#define AST_MAX_CONTEXT
Definition: channel.h:135
#define AST_MAX_EXTENSION
Definition: channel.h:134
Confbridge state handling.
struct stasis_message_type * confbridge_mute_type(void)
get the confbridge mute stasis message type
int func_confbridge_helper(struct ast_channel *chan, const char *cmd, char *data, const char *value)
struct ast_channel_tech * conf_announce_get_tech(void)
Get ConfBridge announce channel technology struct.
int conf_handle_only_person(struct confbridge_user *user)
Handle actions whenever an user joins an empty conference.
void conf_moh_stop(struct confbridge_user *user)
Stop MOH for the conference user.
void conf_add_user_active(struct confbridge_conference *conference, struct confbridge_user *user)
Add a conference bridge user as an unmarked active user of the conference.
int manager_confbridge_init(void)
register stasis message routers to handle manager events for confbridge messages
int conf_reload_config(void)
reload confbridge.conf file
struct stasis_message_type * confbridge_talking_type(void)
get the confbridge talking stasis message type
#define MAX_PROFILE_NAME
Definition: confbridge.h:39
const char * confbridge_event_type_to_string(struct stasis_message_type *event_type)
Get the string representation of a confbridge stasis message type.
const char * conf_get_sound(enum conf_sounds sound, struct bridge_profile_sounds *custom_sounds)
Looks to see if sound file is stored in bridge profile sounds, if not default sound is provided.
void conf_send_event_to_participants(struct confbridge_conference *conference, struct ast_channel *chan, struct stasis_message *msg)
Send events to bridge participants.
struct stasis_message_type * confbridge_stop_record_type(void)
get the confbridge stop_record stasis message type
int conf_handle_inactive_waitmarked(struct confbridge_user *user)
Handle actions every time a waitmarked user joins w/o a marked user present.
void confbridge_handle_atxfer(struct ast_attended_transfer_message *msg)
Create join/leave events for attended transfers.
void conf_add_user_marked(struct confbridge_conference *conference, struct confbridge_user *user)
Add a conference bridge user as a marked active user of the conference.
user_profile_flags
Definition: confbridge.h:51
@ USER_OPT_ENDMARKED
Definition: confbridge.h:60
@ USER_OPT_WAITMARKED
Definition: confbridge.h:59
@ USER_OPT_ANNOUNCEUSERCOUNTALL
Definition: confbridge.h:66
@ USER_OPT_HEAR_OWN_JOIN_SOUND
Definition: confbridge.h:73
@ USER_OPT_TEXT_MESSAGING
Definition: confbridge.h:71
@ USER_OPT_QUIET
Definition: confbridge.h:57
@ USER_OPT_DENOISE
Definition: confbridge.h:61
@ USER_OPT_MARKEDUSER
Definition: confbridge.h:54
@ USER_OPT_DTMF_PASS
Definition: confbridge.h:65
@ USER_OPT_NOONLYPERSON
Definition: confbridge.h:53
@ USER_OPT_TALKER_DETECT
Definition: confbridge.h:63
@ USER_OPT_MUSICONHOLD
Definition: confbridge.h:56
@ USER_OPT_ANNOUNCEUSERCOUNT
Definition: confbridge.h:58
@ USER_OPT_STARTMUTED
Definition: confbridge.h:55
@ USER_OPT_DROP_SILENCE
Definition: confbridge.h:64
@ USER_OPT_ANSWER_CHANNEL
Definition: confbridge.h:72
@ USER_OPT_SEND_EVENTS
Definition: confbridge.h:69
@ USER_OPT_ENDMARKEDANY
Definition: confbridge.h:74
@ USER_OPT_ADMIN
Definition: confbridge.h:52
@ USER_OPT_JITTERBUFFER
Definition: confbridge.h:67
@ USER_OPT_ECHO_EVENTS
Definition: confbridge.h:70
@ USER_OPT_ANNOUNCE_JOIN_LEAVE
Definition: confbridge.h:62
@ USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW
Definition: confbridge.h:68
void conf_add_user_waiting(struct confbridge_conference *conference, struct confbridge_user *user)
Add a conference bridge user as an waiting user of the conference.
struct stasis_message_type * confbridge_end_type(void)
get the confbridge end stasis message type
void manager_confbridge_shutdown(void)
unregister stasis message routers to handle manager events for confbridge messages
conf_sounds
Definition: confbridge.h:169
@ CONF_SOUND_JOIN
Definition: confbridge.h:188
@ CONF_SOUND_OTHER_IN_PARTY
Definition: confbridge.h:177
@ CONF_SOUND_INVALID_PIN
Definition: confbridge.h:182
@ CONF_SOUND_LOCKED_NOW
Definition: confbridge.h:185
@ CONF_SOUND_THERE_ARE
Definition: confbridge.h:176
@ CONF_SOUND_ONLY_ONE
Definition: confbridge.h:175
@ CONF_SOUND_GET_PIN
Definition: confbridge.h:181
@ CONF_SOUND_ERROR_MENU
Definition: confbridge.h:187
@ CONF_SOUND_PARTICIPANTS_UNMUTED
Definition: confbridge.h:191
@ CONF_SOUND_BINAURAL_ON
Definition: confbridge.h:193
@ CONF_SOUND_ONLY_PERSON
Definition: confbridge.h:183
@ CONF_SOUND_BEGIN
Definition: confbridge.h:192
@ CONF_SOUND_PARTICIPANTS_MUTED
Definition: confbridge.h:190
@ CONF_SOUND_WAIT_FOR_LEADER
Definition: confbridge.h:179
@ CONF_SOUND_HAS_LEFT
Definition: confbridge.h:171
@ CONF_SOUND_BINAURAL_OFF
Definition: confbridge.h:194
@ CONF_SOUND_LEAVE
Definition: confbridge.h:189
@ CONF_SOUND_LEADER_HAS_LEFT
Definition: confbridge.h:180
@ CONF_SOUND_PLACE_IN_CONF
Definition: confbridge.h:178
@ CONF_SOUND_HAS_JOINED
Definition: confbridge.h:170
@ CONF_SOUND_UNLOCKED_NOW
Definition: confbridge.h:186
@ CONF_SOUND_UNMUTED
Definition: confbridge.h:174
@ CONF_SOUND_MUTED
Definition: confbridge.h:173
@ CONF_SOUND_LOCKED
Definition: confbridge.h:184
@ CONF_SOUND_KICKED
Definition: confbridge.h:172
void conf_remove_user_waiting(struct confbridge_conference *conference, struct confbridge_user *user)
Remove a conference bridge user from the waiting conference users in the conference.
#define MAX_PIN
Definition: confbridge.h:37
int conf_find_menu_entry_by_sequence(const char *dtmf_sequence, struct conf_menu *menu, struct conf_menu_entry *result)
Finds a menu_entry in a menu structure matched by DTMF sequence.
struct stasis_message_type * confbridge_start_type(void)
get the confbridge start stasis message type
struct stasis_message_type * confbridge_welcome_type(void)
get the confbridge welcome stasis message type
void conf_bridge_profile_destroy(struct bridge_profile *b_profile)
Destroy a bridge profile found by 'conf_find_bridge_profile'.
void conf_ended(struct confbridge_conference *conference)
Callback to be called when the conference has become empty.
struct ast_channel_tech * conf_record_get_tech(void)
Get ConfBridge record channel technology struct.
int async_play_sound_file(struct confbridge_conference *conference, const char *filename, struct ast_channel *initiator)
Play sound file into conference bridge asynchronously.
int play_sound_file(struct confbridge_conference *conference, const char *filename)
Play sound file into conference bridge.
struct stasis_message_type * confbridge_start_record_type(void)
get the confbridge start_record stasis message type
void conf_remove_user_marked(struct confbridge_conference *conference, struct confbridge_user *user)
Remove a conference bridge user from the marked active conference users in the conference.
int conf_handle_dtmf(struct ast_bridge_channel *bridge_channel, struct confbridge_user *user, struct conf_menu_entry *menu_entry, struct conf_menu *menu)
Once a DTMF sequence matches a sequence in the user's DTMF menu, this function will get called to per...
int conf_load_config(void)
load confbridge.conf file
void conf_update_user_mute(struct confbridge_user *user)
Update the actual mute status of the user and set it on the bridge.
const struct bridge_profile * conf_find_bridge_profile(struct ast_channel *chan, const char *bridge_profile_name, struct bridge_profile *result)
Find a bridge profile given a bridge profile's name and store that profile in result structure.
void conf_mute_only_active(struct confbridge_conference *conference)
Attempt to mute/play MOH to the only user in the conference if they require it.
struct ao2_container * conference_bridges
Container to hold all conference bridges in progress.
int conf_add_post_join_action(struct confbridge_user *user, int(*func)(struct confbridge_user *user))
Queue a function to run with the given conference bridge user as an argument once the state transitio...
int conf_set_menu_to_user(struct ast_channel *chan, struct confbridge_user *user, const char *menu_profile_name)
find a menu profile given a menu profile's name and apply the menu in DTMF hooks.
struct confbridge_conference * conf_find_bridge(const char *conference_name)
Find a confbridge by name.
struct stasis_message_type * confbridge_unmute_type(void)
get the confbridge unmute stasis message type
void conf_handle_first_join(struct confbridge_conference *conference)
Callback to execute any time we transition from zero to one active users.
void conf_moh_start(struct confbridge_user *user)
Start MOH for the conference user.
struct stasis_message_type * confbridge_join_type(void)
get the confbridge join stasis message type
void conf_bridge_profile_copy(struct bridge_profile *dst, struct bridge_profile *src)
copies a bridge profile
void conf_destroy_config(void)
destroy the information loaded from the confbridge.conf file
bridge_profile_flags
Definition: confbridge.h:77
@ BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE
Definition: confbridge.h:86
@ BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST_ALL
Definition: confbridge.h:92
@ BRIDGE_OPT_REMB_BEHAVIOR_LOWEST
Definition: confbridge.h:87
@ BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER
Definition: confbridge.h:81
@ BRIDGE_OPT_VIDEO_SRC_LAST_MARKED
Definition: confbridge.h:79
@ BRIDGE_OPT_VIDEO_SRC_SFU
Definition: confbridge.h:85
@ BRIDGE_OPT_BINAURAL_ACTIVE
Definition: confbridge.h:84
@ BRIDGE_OPT_RECORD_CONFERENCE
Definition: confbridge.h:78
@ BRIDGE_OPT_REMB_BEHAVIOR_LOWEST_ALL
Definition: confbridge.h:91
@ BRIDGE_OPT_RECORD_FILE_TIMESTAMP
Definition: confbridge.h:83
@ BRIDGE_OPT_ENABLE_EVENTS
Definition: confbridge.h:89
@ BRIDGE_OPT_REMB_BEHAVIOR_FORCE
Definition: confbridge.h:93
@ BRIDGE_OPT_RECORD_FILE_APPEND
Definition: confbridge.h:82
@ BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE_ALL
Definition: confbridge.h:90
@ BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST
Definition: confbridge.h:88
@ BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED
Definition: confbridge.h:80
const struct user_profile * conf_find_user_profile(struct ast_channel *chan, const char *user_profile_name, struct user_profile *result)
find a user profile given a user profile's name and store that profile in result structure.
void conf_remove_user_active(struct confbridge_conference *conference, struct confbridge_user *user)
Remove a conference bridge user from the unmarked active conference users in the conference.
struct stasis_message_type * confbridge_leave_type(void)
get the confbridge leave stasis message type
void async_play_sound_ready(struct ast_channel *chan)
Indicate the initiator of an async sound file is ready for it to play.
#define MAX_CONF_NAME
Definition: confbridge.h:35
void conf_handle_second_active(struct confbridge_conference *conference)
Handle when a conference moves to having more than one active participant.
conf_menu_action_id
Definition: confbridge.h:96
@ MENU_ACTION_RELEASE_SINGLE_VIDEO_SRC
Definition: confbridge.h:112
@ MENU_ACTION_SET_SINGLE_VIDEO_SRC
Definition: confbridge.h:111
@ MENU_ACTION_ADMIN_KICK_LAST
Definition: confbridge.h:108
@ MENU_ACTION_TOGGLE_BINAURAL
Definition: confbridge.h:115
@ MENU_ACTION_PLAYBACK
Definition: confbridge.h:98
@ MENU_ACTION_LEAVE
Definition: confbridge.h:109
@ MENU_ACTION_RESET_LISTENING
Definition: confbridge.h:102
@ MENU_ACTION_INCREASE_TALKING
Definition: confbridge.h:104
@ MENU_ACTION_ADMIN_TOGGLE_MUTE_PARTICIPANTS
Definition: confbridge.h:114
@ MENU_ACTION_INCREASE_LISTENING
Definition: confbridge.h:100
@ MENU_ACTION_DIALPLAN_EXEC
Definition: confbridge.h:106
@ MENU_ACTION_DECREASE_LISTENING
Definition: confbridge.h:101
@ MENU_ACTION_PLAYBACK_AND_CONTINUE
Definition: confbridge.h:99
@ MENU_ACTION_ADMIN_TOGGLE_LOCK
Definition: confbridge.h:107
@ MENU_ACTION_DECREASE_TALKING
Definition: confbridge.h:105
@ MENU_ACTION_PARTICIPANT_COUNT
Definition: confbridge.h:113
@ MENU_ACTION_TOGGLE_MUTE
Definition: confbridge.h:97
@ MENU_ACTION_NOOP
Definition: confbridge.h:110
@ MENU_ACTION_RESET_TALKING
Definition: confbridge.h:103
int conf_announce_channel_push(struct ast_channel *ast)
Push the announcer channel into the conference.
void conf_menu_entry_destroy(struct conf_menu_entry *menu_entry)
Destroys and frees all the actions stored in a menu_entry structure.
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
Support for logging to various files, console and syslog Configuration in file logger....
A set of macros to manage forward-linked lists.
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
Definition: linkedlists.h:225
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
Definition: linkedlists.h:410
static char user[512]
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
Definition: stringfields.h:341
#define AST_STRING_FIELD(name)
Declare a string field.
Definition: stringfields.h:303
Generic container type.
Message representing attended transfer.
Structure that contains information regarding a channel in a bridge.
Structure that contains features information.
Structure specific to bridge technologies capable of performing talking optimizations.
Structure that contains information about a bridge.
Definition: bridge.h:349
Structure to describe a channel "technology", ie a channel driver See for examples:
Definition: channel.h:648
Main Channel structure associated with a channel.
Support for dynamic strings.
Definition: strings.h:623
A ast_taskprocessor structure is a singleton by name.
Definition: taskprocessor.c:69
const ast_string_field waitforleader
Definition: confbridge.h:224
const ast_string_field invalidpin
Definition: confbridge.h:224
const ast_string_field placeintoconf
Definition: confbridge.h:224
const ast_string_field onlyone
Definition: confbridge.h:224
const ast_string_field otherinparty
Definition: confbridge.h:224
const ast_string_field unlockednow
Definition: confbridge.h:224
const ast_string_field binauralon
Definition: confbridge.h:224
const ast_string_field getpin
Definition: confbridge.h:224
const ast_string_field errormenu
Definition: confbridge.h:224
const ast_string_field participantsunmuted
Definition: confbridge.h:224
const ast_string_field participantsmuted
Definition: confbridge.h:224
const ast_string_field leave
Definition: confbridge.h:224
const ast_string_field locked
Definition: confbridge.h:224
const ast_string_field join
Definition: confbridge.h:224
const ast_string_field kicked
Definition: confbridge.h:224
const ast_string_field hasleft
Definition: confbridge.h:224
const ast_string_field unmuted
Definition: confbridge.h:224
const ast_string_field leaderhasleft
Definition: confbridge.h:224
const ast_string_field lockednow
Definition: confbridge.h:224
const ast_string_field hasjoin
Definition: confbridge.h:224
const ast_string_field binauraloff
Definition: confbridge.h:224
const ast_string_field onlyperson
Definition: confbridge.h:224
const ast_string_field thereare
Definition: confbridge.h:224
const ast_string_field muted
Definition: confbridge.h:224
const ast_string_field begin
Definition: confbridge.h:224
char rec_options[128]
Definition: confbridge.h:231
unsigned int remb_send_interval
Definition: confbridge.h:241
unsigned int maximum_sample_rate
Definition: confbridge.h:236
unsigned int remb_estimated_bitrate
Definition: confbridge.h:242
char regcontext[AST_MAX_CONTEXT]
Definition: confbridge.h:239
char rec_command[128]
Definition: confbridge.h:232
unsigned int mix_interval
Definition: confbridge.h:237
unsigned int video_update_discard
Definition: confbridge.h:240
unsigned int internal_sample_rate
Definition: confbridge.h:235
unsigned int flags
Definition: confbridge.h:233
char rec_file[PATH_MAX]
Definition: confbridge.h:230
char language[MAX_LANGUAGE]
Definition: confbridge.h:229
unsigned int max_members
Definition: confbridge.h:234
char name[MAX_PROFILE_NAME]
Definition: confbridge.h:228
struct bridge_profile_sounds * sounds
Definition: confbridge.h:238
enum conf_menu_action_id id
Definition: confbridge.h:123
char exten[AST_MAX_EXTENSION]
Definition: confbridge.h:128
struct conf_menu_action::@89 action
struct conf_menu_action::@88::@90 dialplan_args
char playback_file[PATH_MAX]
Definition: confbridge.h:125
char context[AST_MAX_CONTEXT]
Definition: confbridge.h:127
union conf_menu_action::@88 data
Definition: confbridge.h:138
char dtmf[MAXIMUM_DTMF_FEATURE_STRING]
Definition: confbridge.h:140
struct conf_menu_entry::@92 entry
struct conf_menu_entry::@91 actions
char name[MAX_PROFILE_NAME]
Definition: confbridge.h:150
struct conf_menu::@93 entries
The structure that represents a conference bridge.
Definition: confbridge.h:246
char name[MAX_CONF_NAME]
Definition: confbridge.h:247
struct confbridge_state * state
Definition: confbridge.h:248
unsigned int muted
Definition: confbridge.h:255
struct ast_str * orig_rec_file
Definition: confbridge.h:259
struct ast_str * record_filename
Definition: confbridge.h:258
struct ast_bridge * bridge
Definition: confbridge.h:249
unsigned int activeusers
Definition: confbridge.h:251
struct ast_channel * playback_chan
Definition: confbridge.h:256
unsigned int waitingusers
Definition: confbridge.h:253
struct ast_taskprocessor * playback_queue
Definition: confbridge.h:262
struct bridge_profile b_profile
Definition: confbridge.h:250
unsigned int markedusers
Definition: confbridge.h:252
struct confbridge_conference::@94 active_list
struct ast_channel * record_chan
Definition: confbridge.h:257
struct confbridge_conference::@95 waiting_list
unsigned int locked
Definition: confbridge.h:254
A conference state object to hold the various state callback functions.
Definition: conf_state.h:45
The structure that represents a conference bridge user.
Definition: confbridge.h:273
unsigned int talking
Definition: confbridge.h:286
unsigned int kicked
Definition: confbridge.h:284
unsigned int muted
Definition: confbridge.h:283
struct confbridge_conference * conference
Definition: confbridge.h:274
struct confbridge_user::@98 list
char menu_name[MAX_PROFILE_NAME]
Definition: confbridge.h:277
struct ast_channel * chan
Definition: confbridge.h:279
struct ast_bridge_features features
Definition: confbridge.h:280
struct bridge_profile b_profile
Definition: confbridge.h:275
char name_rec_location[PATH_MAX]
Definition: confbridge.h:278
struct user_profile u_profile
Definition: confbridge.h:276
struct ast_bridge_tech_optimizations tech_args
Definition: confbridge.h:281
unsigned int suspended_moh
Definition: confbridge.h:282
unsigned int playing_moh
Definition: confbridge.h:285
struct confbridge_user::@97 post_join_list
int(* func)(struct confbridge_user *user)
Definition: confbridge.h:268
struct post_join_action::@96 list
unsigned int timeout
Definition: confbridge.h:166
unsigned int silence_threshold
Definition: confbridge.h:164
char announcement[PATH_MAX]
Definition: confbridge.h:158
char moh_class[128]
Definition: confbridge.h:157
unsigned int talking_threshold
Definition: confbridge.h:162
unsigned int flags
Definition: confbridge.h:159
char pin[MAX_PIN]
Definition: confbridge.h:156
unsigned int announce_user_count_all_after
Definition: confbridge.h:160
char name[MAX_PROFILE_NAME]
Definition: confbridge.h:155
structure to hold users read from users.conf
int value
Definition: syslog.c:37