Asterisk - The Open Source Telephony Project GIT-master-545c459
Loading...
Searching...
No Matches
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 specified in remb_estimated_bitrate */
94 BRIDGE_OPT_ANNOUNCEMENTS = (1 << 16), /*!< Set if the conference should have an announcer channel to play announcements to the conference as a whole */
95};
96
118
119/*! The conference menu action contains both
120 * the action id that represents the action that
121 * must take place, along with any data associated
122 * with that action. */
135
136/*! Conference menu entries contain the DTMF sequence
137 * and the list of actions that are associated with that
138 * sequence. */
140 /*! the DTMF sequence that triggers the actions */
142 /*! The actions associated with this menu entry. */
145};
146
147/*! Conference menu structure. Contains a list
148 * of DTMF sequences coupled with the actions those
149 * sequences invoke.*/
154
158 char moh_class[128];
160 unsigned int flags;
162 /*! Minimum average magnitude threshold to determine talking by the DSP. */
163 unsigned int talking_threshold;
164 /*! Time in ms of silence necessary to declare talking stopped by the bridge. */
165 unsigned int silence_threshold;
166 /*! The time in ms the user may stay in the confbridge */
167 unsigned int timeout;
168};
169
197
227
230 char language[MAX_LANGUAGE]; /*!< Language used for playback_chan */
232 char rec_options[128];
233 char rec_command[128];
234 unsigned int flags;
235 unsigned int max_members; /*!< The maximum number of participants allowed in the conference */
236 unsigned int internal_sample_rate; /*!< The internal sample rate of the bridge. 0 when set to auto adjust mode. */
237 unsigned int maximum_sample_rate; /*!< The maximum sample rate of the bridge. 0 when set to no maximum. */
238 unsigned int mix_interval; /*!< The internal mixing interval used by the bridge. When set to 0 the bridgewill use a default interval. */
241 unsigned int video_update_discard; /*!< Amount of time after sending a video update request that subsequent requests should be discarded */
242 unsigned int remb_send_interval; /*!< Interval at which a combined REMB frame is sent to video sources */
243 unsigned int remb_estimated_bitrate; /*!< Bitrate sent when BRIDGE_OPT_REMB_BEHAVIOR_FORCE is set */
244};
245
246/*! \brief The structure that represents a conference bridge */
248 char name[MAX_CONF_NAME]; /*!< Name of the conference bridge */
249 struct confbridge_state *state; /*!< Conference state information */
250 struct ast_bridge *bridge; /*!< Bridge structure doing the mixing */
251 struct bridge_profile b_profile; /*!< The Bridge Configuration Profile */
252 unsigned int activeusers; /*!< Number of active users present */
253 unsigned int markedusers; /*!< Number of marked users present */
254 unsigned int waitingusers; /*!< Number of waiting users present */
255 unsigned int locked:1; /*!< Is this conference bridge locked? */
256 unsigned int muted:1; /*!< Is this conference bridge muted? */
257 struct ast_channel *playback_chan; /*!< Channel used for playback into the conference bridge */
258 struct ast_channel *record_chan; /*!< Channel used for recording the conference */
259 struct ast_str *record_filename; /*!< Recording filename. */
260 struct ast_str *orig_rec_file; /*!< Previous b_profile.rec_file. */
261 AST_LIST_HEAD_NOLOCK(, confbridge_user) active_list; /*!< List of users participating in the conference bridge */
262 AST_LIST_HEAD_NOLOCK(, confbridge_user) waiting_list; /*!< List of users waiting to join the conference bridge */
263 struct ast_taskprocessor *playback_queue; /*!< Queue for playing back bridge announcements and managing the announcer channel */
264};
265
266extern struct ao2_container *conference_bridges;
267
272
273/*! \brief The structure that represents a conference bridge user */
275 struct confbridge_conference *conference; /*!< Conference bridge they are participating in */
276 struct bridge_profile b_profile; /*!< The Bridge Configuration Profile */
277 struct user_profile u_profile; /*!< The User Configuration Profile */
278 char menu_name[MAX_PROFILE_NAME]; /*!< The name of the DTMF menu assigned to this user */
279 char name_rec_location[PATH_MAX]; /*!< Location of the User's name recorded file if it exists */
280 struct ast_channel *chan; /*!< Asterisk channel participating */
281 struct ast_bridge_features features; /*!< Bridge features structure */
282 struct ast_bridge_tech_optimizations tech_args; /*!< Bridge technology optimizations for talk detection */
283 unsigned int suspended_moh; /*!< Count of active suspended MOH actions. */
284 unsigned int muted:1; /*!< Has the user requested to be muted? */
285 unsigned int kicked:1; /*!< User has been kicked from the conference */
286 unsigned int playing_moh:1; /*!< MOH is currently being played to the user */
287 unsigned int talking:1; /*!< User is currently talking */
288 AST_LIST_HEAD_NOLOCK(, post_join_action) post_join_list; /*!< List of sounds to play after joining */;
289 AST_LIST_ENTRY(confbridge_user) list; /*!< Linked list information */
290};
291
292/*! \brief load confbridge.conf file */
293int conf_load_config(void);
294
295/*! \brief reload confbridge.conf file */
296int conf_reload_config(void);
297
298/*! \brief destroy the information loaded from the confbridge.conf file*/
299void conf_destroy_config(void);
300
301/*!
302 * \brief find a user profile given a user profile's name and store
303 * that profile in result structure.
304 *
305 * \param chan channel the user profile is requested for
306 * \param user_profile_name name of the profile requested (optional)
307 * \param result data contained by the user profile will be copied to this struct pointer
308 *
309 * \details If user_profile_name is not provided, this function will
310 * check for the presence of a user profile set by the CONFBRIDGE
311 * function on a channel datastore. If that doesn't exist, the
312 * default_user profile is used.
313 *
314 * \retval user profile on success
315 * \retval NULL on failure
316 */
317const struct user_profile *conf_find_user_profile(struct ast_channel *chan, const char *user_profile_name, struct user_profile *result);
318
319/*!
320 * \brief Find a bridge profile given a bridge profile's name and store
321 * that profile in result structure.
322 *
323 * \param chan channel the bridge profile is requested for
324 * \param bridge_profile_name name of the profile requested (optional)
325 * \param result data contained by the bridge profile will be copied to this struct pointer
326 *
327 * \details If bridge_profile_name is not provided, this function will
328 * check for the presence of a bridge profile set by the CONFBRIDGE
329 * function on a channel datastore. If that doesn't exist, the
330 * default_bridge profile is used.
331 *
332 * \retval bridge profile on success
333 * \retval NULL on failure
334 */
335const struct bridge_profile *conf_find_bridge_profile(struct ast_channel *chan, const char *bridge_profile_name, struct bridge_profile *result);
336
337/*!
338 * \brief find a menu profile given a menu profile's name and apply
339 * the menu in DTMF hooks.
340 *
341 * \param chan channel the menu profile is requested for
342 * \param user user profile the menu is being applied to
343 * \param menu_profile_name name of the profile requested (optional)
344 *
345 * \details If menu_profile_name is not provided, this function will
346 * check for the presence of a menu profile set by the CONFBRIDGE
347 * function on a channel datastore. If that doesn't exist, the
348 * default_menu profile is used.
349 *
350 * \retval 0 on success
351 * \retval -1 on failure
352 */
353int conf_set_menu_to_user(struct ast_channel *chan, struct confbridge_user *user, const char *menu_profile_name);
354
355/*!
356 * \brief Destroy a bridge profile found by 'conf_find_bridge_profile'
357 */
358void conf_bridge_profile_destroy(struct bridge_profile *b_profile);
359
360/*!
361 * \brief copies a bridge profile
362 * \note conf_bridge_profile_destroy must be called on the dst structure
363 */
364void conf_bridge_profile_copy(struct bridge_profile *dst, struct bridge_profile *src);
365
366/*!
367 * \brief Finds a menu_entry in a menu structure matched by DTMF sequence.
368 *
369 * \note the menu entry found must be destroyed using conf_menu_entry_destroy()
370 *
371 * \retval 1 success, entry is found and stored in result
372 * \retval 0 failure, no entry found for given DTMF sequence
373 */
374int conf_find_menu_entry_by_sequence(const char *dtmf_sequence, struct conf_menu *menu, struct conf_menu_entry *result);
375
376/*!
377 * \brief Destroys and frees all the actions stored in a menu_entry structure
378 */
379void conf_menu_entry_destroy(struct conf_menu_entry *menu_entry);
380
381/*!
382 * \brief Once a DTMF sequence matches a sequence in the user's DTMF menu, this function will get
383 * called to perform the menu action.
384 *
385 * \param bridge_channel Bridged channel this is involving
386 * \param user the conference user to perform the action on.
387 * \param menu_entry the menu entry that invoked this callback to occur.
388 * \param menu an AO2 referenced pointer to the entire menu structure the menu_entry
389 * derived from.
390 *
391 * \note The menu_entry is a deep copy of the entry found in the menu structure. This allows
392 * for the menu_entry to be accessed without requiring the menu lock. If the menu must
393 * be accessed, the menu lock must be held. Reference counting of the menu structure is
394 * handled outside of the scope of this function.
395 *
396 * \retval 0 success
397 * \retval -1 failure
398 */
400 struct ast_bridge_channel *bridge_channel,
401 struct confbridge_user *user,
402 struct conf_menu_entry *menu_entry,
403 struct conf_menu *menu);
404
405
406/*! \brief Looks to see if sound file is stored in bridge profile sounds, if not
407 * default sound is provided.*/
408const char *conf_get_sound(enum conf_sounds sound, struct bridge_profile_sounds *custom_sounds);
409
410int func_confbridge_helper(struct ast_channel *chan, const char *cmd, char *data, const char *value);
411
412/*!
413 * \brief Play sound file into conference bridge
414 *
415 * \param conference The conference bridge to play sound file into
416 * \param filename Sound file to play
417 *
418 * \retval 0 success
419 * \retval -1 failure
420 */
421int play_sound_file(struct confbridge_conference *conference, const char *filename);
422
423/*!
424 * \brief Play sound file into conference bridge asynchronously
425 *
426 * If the initiator parameter is non-NULL, then the playback will wait for
427 * that initiator channel to get back in the bridge before playing the sound
428 * file. This way, the initiator has no danger of hearing a "clipped" file.
429 *
430 * \param conference The conference bridge to play sound file into
431 * \param filename Sound file to play
432 * \param initiator Channel that initiated playback.
433 *
434 * \retval 0 success
435 * \retval -1 failure
436 */
437int async_play_sound_file(struct confbridge_conference *conference, const char *filename,
438 struct ast_channel *initiator);
439
440/*!
441 * \brief Indicate the initiator of an async sound file is ready for it to play.
442 *
443 * When playing an async sound file, the initiator is typically either out of the bridge
444 * or not in a position to hear the queued announcement. This function lets the announcement
445 * thread know that the initiator is now ready for the sound to play.
446 *
447 * If an async announcement was queued and no initiator channel was provided, then this is
448 * a no-op
449 *
450 * \param chan The channel that initiated the async announcement
451 */
452void async_play_sound_ready(struct ast_channel *chan);
453
454/*! \brief Callback to be called when the conference has become empty
455 * \param conference The conference bridge
456 */
457void conf_ended(struct confbridge_conference *conference);
458
459/*!
460 * \brief Update the actual mute status of the user and set it on the bridge.
461 *
462 * \param user User to update the mute status.
463 */
465
466/*!
467 * \brief Stop MOH for the conference user.
468 *
469 * \param user Conference user to stop MOH on.
470 */
472
473/*!
474 * \brief Start MOH for the conference user.
475 *
476 * \param user Conference user to start MOH on.
477 */
479
480/*! \brief Attempt to mute/play MOH to the only user in the conference if they require it
481 * \param conference A conference bridge containing a single user
482 */
483void conf_mute_only_active(struct confbridge_conference *conference);
484
485/*! \brief Callback to execute any time we transition from zero to one active users
486 * \param conference The conference bridge with a single active user joined
487 */
488void conf_handle_first_join(struct confbridge_conference *conference);
489
490/*! \brief Handle actions every time a waitmarked user joins w/o a marked user present
491 * \param user The waitmarked user
492 * \retval 0 success
493 * \retval -1 failure
494 */
496
497/*! \brief Handle actions whenever an user joins an empty conference
498 *
499 * \param user The user
500 */
502
503/*! \brief Handle when a conference moves to having more than one active participant
504 * \param conference The conference bridge with more than one active participant
505 */
506void conf_handle_second_active(struct confbridge_conference *conference);
507
508/*! \brief Add a conference bridge user as an unmarked active user of the conference
509 * \param conference The conference bridge to add the user to
510 * \param user The conference bridge user to add to the conference
511 */
512void conf_add_user_active(struct confbridge_conference *conference, struct confbridge_user *user);
513
514/*! \brief Add a conference bridge user as a marked active user of the conference
515 * \param conference The conference bridge to add the user to
516 * \param user The conference bridge user to add to the conference
517 */
518void conf_add_user_marked(struct confbridge_conference *conference, struct confbridge_user *user);
519
520/*! \brief Add a conference bridge user as an waiting user of the conference
521 * \param conference The conference bridge to add the user to
522 * \param user The conference bridge user to add to the conference
523 */
524void conf_add_user_waiting(struct confbridge_conference *conference, struct confbridge_user *user);
525
526/*! \brief Remove a conference bridge user from the unmarked active conference users in the conference
527 * \param conference The conference bridge to remove the user from
528 * \param user The conference bridge user to remove from the conference
529 */
530void conf_remove_user_active(struct confbridge_conference *conference, struct confbridge_user *user);
531
532/*! \brief Remove a conference bridge user from the marked active conference users in the conference
533 * \param conference The conference bridge to remove the user from
534 * \param user The conference bridge user to remove from the conference
535 */
536void conf_remove_user_marked(struct confbridge_conference *conference, struct confbridge_user *user);
537
538/*! \brief Remove a conference bridge user from the waiting conference users in the conference
539 * \param conference The conference bridge to remove the user from
540 * \param user The conference bridge user to remove from the conference
541 */
543
544/*! \brief Queue a function to run with the given conference bridge user as an argument once the state transition is complete
545 * \param user The conference bridge user to pass to the function
546 * \param func The function to queue
547 * \retval 0 success
548 * \retval non-zero failure
549 */
550int conf_add_post_join_action(struct confbridge_user *user, int (*func)(struct confbridge_user *user));
551
552/*!
553 * \since 12.0
554 * \brief get the confbridge start stasis message type
555 *
556 * \retval stasis message type for confbridge start messages if it's available
557 * \retval NULL if it isn't
558 */
560
561/*!
562 * \since 12.0
563 * \brief get the confbridge end stasis message type
564 *
565 * \retval stasis message type for confbridge end messages if it's available
566 * \retval NULL if it isn't
567 */
569
570/*!
571 * \since 12.0
572 * \brief get the confbridge join stasis message type
573 *
574 * \retval stasis message type for confbridge join messages if it's available
575 * \retval NULL if it isn't
576 */
578
579/*!
580 * \since 12.0
581 * \brief get the confbridge leave stasis message type
582 *
583 * \retval stasis message type for confbridge leave messages if it's available
584 * \retval NULL if it isn't
585 */
587
588/*!
589 * \since 12.0
590 * \brief get the confbridge start_record stasis message type
591 *
592 * \retval stasis message type for confbridge start_record messages if it's available
593 * \retval NULL if it isn't
594 */
596
597/*!
598 * \since 12.0
599 * \brief get the confbridge stop_record stasis message type
600 *
601 * \retval stasis message type for confbridge stop_record messages if it's available
602 * \retval NULL if it isn't
603 */
605
606/*!
607 * \since 12.0
608 * \brief get the confbridge mute stasis message type
609 *
610 * \retval stasis message type for confbridge mute messages if it's available
611 * \retval NULL if it isn't
612 */
614
615/*!
616 * \since 12.0
617 * \brief get the confbridge unmute stasis message type
618 *
619 * \retval stasis message type for confbridge unmute messages if it's available
620 * \retval NULL if it isn't
621 */
623
624/*!
625 * \since 12.0
626 * \brief get the confbridge talking stasis message type
627 *
628 * \retval stasis message type for confbridge talking messages if it's available
629 * \retval NULL if it isn't
630 */
632
633/*!
634 * \since 15.5
635 * \brief get the confbridge welcome stasis message type
636 *
637 * \retval stasis message type for confbridge welcome messages if it's available
638 * \retval NULL if it isn't
639 */
641
642/*!
643 * \since 15.5
644 * \brief Get the string representation of a confbridge stasis message type
645 *
646 * \param event_type The confbridge event type such as 'confbridge_welcome_type()'
647 *
648 * \retval The string representation of the message type
649 * \retval "unknown" if not found
650 */
651const char *confbridge_event_type_to_string(struct stasis_message_type *event_type);
652
653/*!
654 * \since 12.0
655 * \brief register stasis message routers to handle manager events for confbridge messages
656 *
657 * \retval 0 success
658 * \retval non-zero failure
659 */
661
662/*!
663 * \since 12.0
664 * \brief unregister stasis message routers to handle manager events for confbridge messages
665 */
667
668/*!
669 * \brief Get ConfBridge record channel technology struct.
670 * \since 12.0.0
671 *
672 * \return ConfBridge record channel technology.
673 */
675
676/*!
677 * \brief Get ConfBridge announce channel technology struct.
678 * \since 12.0.0
679 *
680 * \return ConfBridge announce channel technology.
681 */
683
684/*!
685 * \brief Push the announcer channel into the conference.
686 * \since 12.0.0
687 *
688 * \param ast Either channel in the announcer channel pair.
689 *
690 * \retval 0 on success.
691 * \retval -1 on error.
692 */
694
695/*!
696 * \brief Find a confbridge by name.
697 * \since 13.22.0
698 * \since 15.5.0
699 *
700 * \param conference_name The name to search for
701 *
702 * \return ConfBridge (which must be unreffed) or NULL.
703 */
704struct confbridge_conference *conf_find_bridge(const char *conference_name);
705
706/*!
707 * \brief Send events to bridge participants.
708 * \since 15.7
709 * \since 16.1
710 *
711 * \param conference The conference bridge
712 * \param chan The channel triggering the action
713 * \param msg The stasis message describing the event
714 */
716 struct ast_channel *chan, struct stasis_message *msg);
717
718/*!
719 * \brief Create join/leave events for attended transfers
720 * \since 13.28
721 * \since 16.5
722 *
723 * \param msg The attended transfer stasis message
724 *
725 */
727
728#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:170
@ CONF_SOUND_JOIN
Definition confbridge.h:189
@ CONF_SOUND_OTHER_IN_PARTY
Definition confbridge.h:178
@ CONF_SOUND_INVALID_PIN
Definition confbridge.h:183
@ CONF_SOUND_LOCKED_NOW
Definition confbridge.h:186
@ CONF_SOUND_THERE_ARE
Definition confbridge.h:177
@ CONF_SOUND_ONLY_ONE
Definition confbridge.h:176
@ CONF_SOUND_GET_PIN
Definition confbridge.h:182
@ CONF_SOUND_ERROR_MENU
Definition confbridge.h:188
@ CONF_SOUND_PARTICIPANTS_UNMUTED
Definition confbridge.h:192
@ CONF_SOUND_BINAURAL_ON
Definition confbridge.h:194
@ CONF_SOUND_ONLY_PERSON
Definition confbridge.h:184
@ CONF_SOUND_BEGIN
Definition confbridge.h:193
@ CONF_SOUND_PARTICIPANTS_MUTED
Definition confbridge.h:191
@ CONF_SOUND_WAIT_FOR_LEADER
Definition confbridge.h:180
@ CONF_SOUND_HAS_LEFT
Definition confbridge.h:172
@ CONF_SOUND_BINAURAL_OFF
Definition confbridge.h:195
@ CONF_SOUND_LEAVE
Definition confbridge.h:190
@ CONF_SOUND_LEADER_HAS_LEFT
Definition confbridge.h:181
@ CONF_SOUND_PLACE_IN_CONF
Definition confbridge.h:179
@ CONF_SOUND_HAS_JOINED
Definition confbridge.h:171
@ CONF_SOUND_UNLOCKED_NOW
Definition confbridge.h:187
@ CONF_SOUND_UNMUTED
Definition confbridge.h:175
@ CONF_SOUND_MUTED
Definition confbridge.h:174
@ CONF_SOUND_LOCKED
Definition confbridge.h:185
@ CONF_SOUND_KICKED
Definition confbridge.h:173
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_ANNOUNCEMENTS
Definition confbridge.h:94
@ 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:97
@ MENU_ACTION_RELEASE_SINGLE_VIDEO_SRC
Definition confbridge.h:113
@ MENU_ACTION_SET_SINGLE_VIDEO_SRC
Definition confbridge.h:112
@ MENU_ACTION_ADMIN_KICK_LAST
Definition confbridge.h:109
@ MENU_ACTION_TOGGLE_BINAURAL
Definition confbridge.h:116
@ MENU_ACTION_PLAYBACK
Definition confbridge.h:99
@ MENU_ACTION_LEAVE
Definition confbridge.h:110
@ MENU_ACTION_RESET_LISTENING
Definition confbridge.h:103
@ MENU_ACTION_INCREASE_TALKING
Definition confbridge.h:105
@ MENU_ACTION_ADMIN_TOGGLE_MUTE_PARTICIPANTS
Definition confbridge.h:115
@ MENU_ACTION_INCREASE_LISTENING
Definition confbridge.h:101
@ MENU_ACTION_DIALPLAN_EXEC
Definition confbridge.h:107
@ MENU_ACTION_DECREASE_LISTENING
Definition confbridge.h:102
@ MENU_ACTION_PLAYBACK_AND_CONTINUE
Definition confbridge.h:100
@ MENU_ACTION_ADMIN_TOGGLE_LOCK
Definition confbridge.h:108
@ MENU_ACTION_DECREASE_TALKING
Definition confbridge.h:106
@ MENU_ACTION_PARTICIPANT_COUNT
Definition confbridge.h:114
@ MENU_ACTION_TOGGLE_MUTE
Definition confbridge.h:98
@ MENU_ACTION_NOOP
Definition confbridge.h:111
@ MENU_ACTION_RESET_TALKING
Definition confbridge.h:104
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).
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
#define AST_STRING_FIELD(name)
Declare a string field.
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:355
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.
const ast_string_field waitforleader
Definition confbridge.h:225
const ast_string_field invalidpin
Definition confbridge.h:225
const ast_string_field placeintoconf
Definition confbridge.h:225
const ast_string_field onlyone
Definition confbridge.h:225
const ast_string_field otherinparty
Definition confbridge.h:225
const ast_string_field unlockednow
Definition confbridge.h:225
const ast_string_field binauralon
Definition confbridge.h:225
const ast_string_field getpin
Definition confbridge.h:225
const ast_string_field errormenu
Definition confbridge.h:225
const ast_string_field participantsunmuted
Definition confbridge.h:225
const ast_string_field participantsmuted
Definition confbridge.h:225
const ast_string_field leave
Definition confbridge.h:225
const ast_string_field locked
Definition confbridge.h:225
const ast_string_field join
Definition confbridge.h:225
const ast_string_field kicked
Definition confbridge.h:225
const ast_string_field hasleft
Definition confbridge.h:225
const ast_string_field unmuted
Definition confbridge.h:225
const ast_string_field leaderhasleft
Definition confbridge.h:225
const ast_string_field lockednow
Definition confbridge.h:225
const ast_string_field hasjoin
Definition confbridge.h:225
const ast_string_field binauraloff
Definition confbridge.h:225
const ast_string_field onlyperson
Definition confbridge.h:225
const ast_string_field thereare
Definition confbridge.h:225
const ast_string_field muted
Definition confbridge.h:225
const ast_string_field begin
Definition confbridge.h:225
char rec_options[128]
Definition confbridge.h:232
unsigned int remb_send_interval
Definition confbridge.h:242
unsigned int maximum_sample_rate
Definition confbridge.h:237
unsigned int remb_estimated_bitrate
Definition confbridge.h:243
char regcontext[AST_MAX_CONTEXT]
Definition confbridge.h:240
char rec_command[128]
Definition confbridge.h:233
unsigned int mix_interval
Definition confbridge.h:238
unsigned int video_update_discard
Definition confbridge.h:241
unsigned int internal_sample_rate
Definition confbridge.h:236
unsigned int flags
Definition confbridge.h:234
char rec_file[PATH_MAX]
Definition confbridge.h:231
char language[MAX_LANGUAGE]
Definition confbridge.h:230
unsigned int max_members
Definition confbridge.h:235
char name[MAX_PROFILE_NAME]
Definition confbridge.h:229
struct bridge_profile_sounds * sounds
Definition confbridge.h:239
enum conf_menu_action_id id
Definition confbridge.h:124
char exten[AST_MAX_EXTENSION]
Definition confbridge.h:129
struct conf_menu_action::@89 action
struct conf_menu_action::@88::@90 dialplan_args
char playback_file[PATH_MAX]
Definition confbridge.h:126
char context[AST_MAX_CONTEXT]
Definition confbridge.h:128
union conf_menu_action::@88 data
Definition confbridge.h:139
char dtmf[MAXIMUM_DTMF_FEATURE_STRING]
Definition confbridge.h:141
struct conf_menu_entry::@92 entry
struct conf_menu_entry::@91 actions
char name[MAX_PROFILE_NAME]
Definition confbridge.h:151
struct conf_menu::@93 entries
The structure that represents a conference bridge.
Definition confbridge.h:247
char name[MAX_CONF_NAME]
Definition confbridge.h:248
struct confbridge_state * state
Definition confbridge.h:249
struct ast_str * orig_rec_file
Definition confbridge.h:260
struct ast_str * record_filename
Definition confbridge.h:259
struct ast_bridge * bridge
Definition confbridge.h:250
unsigned int activeusers
Definition confbridge.h:252
struct ast_channel * playback_chan
Definition confbridge.h:257
unsigned int waitingusers
Definition confbridge.h:254
struct ast_taskprocessor * playback_queue
Definition confbridge.h:263
struct bridge_profile b_profile
Definition confbridge.h:251
unsigned int markedusers
Definition confbridge.h:253
struct confbridge_conference::@94 active_list
struct ast_channel * record_chan
Definition confbridge.h:258
struct confbridge_conference::@95 waiting_list
unsigned int locked
Definition confbridge.h:255
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:274
unsigned int talking
Definition confbridge.h:287
unsigned int kicked
Definition confbridge.h:285
unsigned int muted
Definition confbridge.h:284
struct confbridge_conference * conference
Definition confbridge.h:275
struct confbridge_user::@98 list
char menu_name[MAX_PROFILE_NAME]
Definition confbridge.h:278
struct ast_channel * chan
Definition confbridge.h:280
struct ast_bridge_features features
Definition confbridge.h:281
struct bridge_profile b_profile
Definition confbridge.h:276
char name_rec_location[PATH_MAX]
Definition confbridge.h:279
struct user_profile u_profile
Definition confbridge.h:277
struct ast_bridge_tech_optimizations tech_args
Definition confbridge.h:282
unsigned int suspended_moh
Definition confbridge.h:283
unsigned int playing_moh
Definition confbridge.h:286
struct confbridge_user::@97 post_join_list
int(* func)(struct confbridge_user *user)
Definition confbridge.h:269
struct post_join_action::@96 list
unsigned int timeout
Definition confbridge.h:167
unsigned int silence_threshold
Definition confbridge.h:165
char announcement[PATH_MAX]
Definition confbridge.h:159
char moh_class[128]
Definition confbridge.h:158
unsigned int talking_threshold
Definition confbridge.h:163
unsigned int flags
Definition confbridge.h:160
char pin[MAX_PIN]
Definition confbridge.h:157
unsigned int announce_user_count_all_after
Definition confbridge.h:161
char name[MAX_PROFILE_NAME]
Definition confbridge.h:156
structure to hold users read from phoneprov_users.conf
int value
Definition syslog.c:37