Asterisk - The Open Source Telephony Project  18.5.0
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 <[email protected]>
7  * Joshua Colp <[email protected]>
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"
27 #include "asterisk/linkedlists.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 };
74 
76  BRIDGE_OPT_RECORD_CONFERENCE = (1 << 0), /*!< Set if the conference should be recorded */
77  BRIDGE_OPT_VIDEO_SRC_LAST_MARKED = (1 << 1), /*!< Set if conference should feed video of last marked user to all participants. */
78  BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED = (1 << 2), /*!< Set if conference should feed video of first marked user to all participants. */
79  BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER = (1 << 3), /*!< Set if conference set the video feed to follow the loudest talker. */
80  BRIDGE_OPT_RECORD_FILE_APPEND = (1 << 4), /*!< Set if the record file should be appended to between start/stops. */
81  BRIDGE_OPT_RECORD_FILE_TIMESTAMP = (1 << 5), /*!< Set if the record file should have a timestamp appended */
82  BRIDGE_OPT_BINAURAL_ACTIVE = (1 << 6), /*!< Set if binaural convolution is activated */
83  BRIDGE_OPT_VIDEO_SRC_SFU = (1 << 7), /*!< Selective forwarding unit */
84  BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE = (1 << 8), /*!< The average of all REMB reports is sent to the sender */
85  BRIDGE_OPT_REMB_BEHAVIOR_LOWEST = (1 << 9), /*!< The lowest estimated maximum bitrate is sent to the sender */
86  BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST = (1 << 10), /*!< The highest estimated maximum bitrate is sent to the sender */
87  BRIDGE_OPT_ENABLE_EVENTS = (1 << 11), /*!< Enable sending events to participants */
88  BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE_ALL = (1 << 12), /*!< The average of all REMB reports in the entire bridge is sent to each sender */
89  BRIDGE_OPT_REMB_BEHAVIOR_LOWEST_ALL = (1 << 13), /*!< The lowest estimated maximum bitrate from all receivers is sent to each sender */
90  BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST_ALL = (1 << 14), /*!< The highest estimated maximum bitrate from all receivers is sent to each sender */
91  BRIDGE_OPT_REMB_BEHAVIOR_FORCE = (1 << 15), /*!< Force the REMB estimated bitrate to that specifiec in remb_estimated_bitrate */
92 };
93 
114 };
115 
116 /*! The conference menu action contains both
117  * the action id that represents the action that
118  * must take place, along with any data associated
119  * with that action. */
122  union {
124  struct {
127  int priority;
128  } dialplan_args;
129  } data;
131 };
132 
133 /*! Conference menu entries contain the DTMF sequence
134  * and the list of actions that are associated with that
135  * sequence. */
137  /*! the DTMF sequence that triggers the actions */
139  /*! The actions associated with this menu entry. */
142 };
143 
144 /*! Conference menu structure. Contains a list
145  * of DTMF sequences coupled with the actions those
146  * sequences invoke.*/
147 struct conf_menu {
150 };
151 
152 struct user_profile {
154  char pin[MAX_PIN];
155  char moh_class[128];
156  char announcement[PATH_MAX];
157  unsigned int flags;
159  /*! Minimum average magnitude threshold to determine talking by the DSP. */
160  unsigned int talking_threshold;
161  /*! Time in ms of silence necessary to declare talking stopped by the bridge. */
162  unsigned int silence_threshold;
163  /*! The time in ms the user may stay in the confbridge */
164  unsigned int timeout;
165 };
166 
193 };
194 
197  AST_STRING_FIELD(hasjoin);
198  AST_STRING_FIELD(hasleft);
199  AST_STRING_FIELD(kicked);
201  AST_STRING_FIELD(unmuted);
202  AST_STRING_FIELD(onlyone);
203  AST_STRING_FIELD(thereare);
204  AST_STRING_FIELD(otherinparty);
205  AST_STRING_FIELD(placeintoconf);
206  AST_STRING_FIELD(waitforleader);
207  AST_STRING_FIELD(leaderhasleft);
208  AST_STRING_FIELD(getpin);
209  AST_STRING_FIELD(invalidpin);
210  AST_STRING_FIELD(onlyperson);
211  AST_STRING_FIELD(locked);
212  AST_STRING_FIELD(lockednow);
213  AST_STRING_FIELD(unlockednow);
214  AST_STRING_FIELD(errormenu);
216  AST_STRING_FIELD(join);
217  AST_STRING_FIELD(participantsmuted);
218  AST_STRING_FIELD(participantsunmuted);
219  AST_STRING_FIELD(begin);
220  AST_STRING_FIELD(binauralon);
221  AST_STRING_FIELD(binauraloff);
222  );
223 };
224 
227  char language[MAX_LANGUAGE]; /*!< Language used for playback_chan */
228  char rec_file[PATH_MAX];
229  char rec_options[128];
230  char rec_command[128];
231  unsigned int flags;
232  unsigned int max_members; /*!< The maximum number of participants allowed in the conference */
233  unsigned int internal_sample_rate; /*!< The internal sample rate of the bridge. 0 when set to auto adjust mode. */
234  unsigned int maximum_sample_rate; /*!< The maximum sample rate of the bridge. 0 when set to no maximum. */
235  unsigned int mix_interval; /*!< The internal mixing interval used by the bridge. When set to 0 the bridgewill use a default interval. */
238  unsigned int video_update_discard; /*!< Amount of time after sending a video update request that subsequent requests should be discarded */
239  unsigned int remb_send_interval; /*!< Interval at which a combined REMB frame is sent to video sources */
240  unsigned int remb_estimated_bitrate; /*!< Bitrate sent when BRIDGE_OPT_REMB_BEHAVIOR_FORCE is set */
241 };
242 
243 /*! \brief The structure that represents a conference bridge */
245  char name[MAX_CONF_NAME]; /*!< Name of the conference bridge */
246  struct confbridge_state *state; /*!< Conference state information */
247  struct ast_bridge *bridge; /*!< Bridge structure doing the mixing */
248  struct bridge_profile b_profile; /*!< The Bridge Configuration Profile */
249  unsigned int activeusers; /*!< Number of active users present */
250  unsigned int markedusers; /*!< Number of marked users present */
251  unsigned int waitingusers; /*!< Number of waiting users present */
252  unsigned int locked:1; /*!< Is this conference bridge locked? */
253  unsigned int muted:1; /*!< Is this conference bridge muted? */
254  struct ast_channel *playback_chan; /*!< Channel used for playback into the conference bridge */
255  struct ast_channel *record_chan; /*!< Channel used for recording the conference */
256  struct ast_str *record_filename; /*!< Recording filename. */
257  struct ast_str *orig_rec_file; /*!< Previous b_profile.rec_file. */
258  AST_LIST_HEAD_NOLOCK(, confbridge_user) active_list; /*!< List of users participating in the conference bridge */
259  AST_LIST_HEAD_NOLOCK(, confbridge_user) waiting_list; /*!< List of users waiting to join the conference bridge */
260  struct ast_taskprocessor *playback_queue; /*!< Queue for playing back bridge announcements and managing the announcer channel */
261 };
262 
263 extern struct ao2_container *conference_bridges;
264 
266  int (*func)(struct confbridge_user *user);
268 };
269 
270 /*! \brief The structure that represents a conference bridge user */
272  struct confbridge_conference *conference; /*!< Conference bridge they are participating in */
273  struct bridge_profile b_profile; /*!< The Bridge Configuration Profile */
274  struct user_profile u_profile; /*!< The User Configuration Profile */
275  char menu_name[MAX_PROFILE_NAME]; /*!< The name of the DTMF menu assigned to this user */
276  char name_rec_location[PATH_MAX]; /*!< Location of the User's name recorded file if it exists */
277  struct ast_channel *chan; /*!< Asterisk channel participating */
278  struct ast_bridge_features features; /*!< Bridge features structure */
279  struct ast_bridge_tech_optimizations tech_args; /*!< Bridge technology optimizations for talk detection */
280  unsigned int suspended_moh; /*!< Count of active suspended MOH actions. */
281  unsigned int muted:1; /*!< Has the user requested to be muted? */
282  unsigned int kicked:1; /*!< User has been kicked from the conference */
283  unsigned int playing_moh:1; /*!< MOH is currently being played to the user */
284  unsigned int talking:1; /*!< User is currently talking */
285  AST_LIST_HEAD_NOLOCK(, post_join_action) post_join_list; /*!< List of sounds to play after joining */;
286  AST_LIST_ENTRY(confbridge_user) list; /*!< Linked list information */
287 };
288 
289 /*! \brief load confbridge.conf file */
290 int conf_load_config(void);
291 
292 /*! \brief reload confbridge.conf file */
293 int conf_reload_config(void);
294 
295 /*! \brief destroy the information loaded from the confbridge.conf file*/
296 void conf_destroy_config(void);
297 
298 /*!
299  * \brief find a user profile given a user profile's name and store
300  * that profile in result structure.
301  *
302  * \param chan channel the user profile is requested for
303  * \param user_profile_name name of the profile requested (optional)
304  * \param result data contained by the user profile will be copied to this struct pointer
305  *
306  * \details If user_profile_name is not provided, this function will
307  * check for the presence of a user profile set by the CONFBRIDGE
308  * function on a channel datastore. If that doesn't exist, the
309  * default_user profile is used.
310  *
311  * \retval user profile on success
312  * \retval NULL on failure
313  */
314 const struct user_profile *conf_find_user_profile(struct ast_channel *chan, const char *user_profile_name, struct user_profile *result);
315 
316 /*!
317  * \brief Find a bridge profile given a bridge profile's name and store
318  * that profile in result structure.
319  *
320  * \param chan channel the bridge profile is requested for
321  * \param bridge_profile_name name of the profile requested (optional)
322  * \param result data contained by the bridge profile will be copied to this struct pointer
323  *
324  * \details If bridge_profile_name is not provided, this function will
325  * check for the presence of a bridge profile set by the CONFBRIDGE
326  * function on a channel datastore. If that doesn't exist, the
327  * default_bridge profile is used.
328  *
329  * \retval bridge profile on success
330  * \retval NULL on failure
331  */
332 const struct bridge_profile *conf_find_bridge_profile(struct ast_channel *chan, const char *bridge_profile_name, struct bridge_profile *result);
333 
334 /*!
335  * \brief find a menu profile given a menu profile's name and apply
336  * the menu in DTMF hooks.
337  *
338  * \param chan channel the menu profile is requested for
339  * \param user user profile the menu is being applied to
340  * \param menu_profile_name name of the profile requested (optional)
341  *
342  * \details If menu_profile_name is not provided, this function will
343  * check for the presence of a menu profile set by the CONFBRIDGE
344  * function on a channel datastore. If that doesn't exist, the
345  * default_menu profile is used.
346  *
347  * \retval 0 on success
348  * \retval -1 on failure
349  */
350 int conf_set_menu_to_user(struct ast_channel *chan, struct confbridge_user *user, const char *menu_profile_name);
351 
352 /*!
353  * \brief Destroy a bridge profile found by 'conf_find_bridge_profile'
354  */
355 void conf_bridge_profile_destroy(struct bridge_profile *b_profile);
356 
357 /*!
358  * \brief copies a bridge profile
359  * \note conf_bridge_profile_destroy must be called on the dst structure
360  */
361 void conf_bridge_profile_copy(struct bridge_profile *dst, struct bridge_profile *src);
362 
363 /*!
364  * \brief Finds a menu_entry in a menu structure matched by DTMF sequence.
365  *
366  * \note the menu entry found must be destroyed using conf_menu_entry_destroy()
367  *
368  * \retval 1 success, entry is found and stored in result
369  * \retval 0 failure, no entry found for given DTMF sequence
370  */
371 int conf_find_menu_entry_by_sequence(const char *dtmf_sequence, struct conf_menu *menu, struct conf_menu_entry *result);
372 
373 /*!
374  * \brief Destroys and frees all the actions stored in a menu_entry structure
375  */
376 void conf_menu_entry_destroy(struct conf_menu_entry *menu_entry);
377 
378 /*!
379  * \brief Once a DTMF sequence matches a sequence in the user's DTMF menu, this function will get
380  * called to perform the menu action.
381  *
382  * \param bridge_channel Bridged channel this is involving
383  * \param user the conference user to perform the action on.
384  * \param menu_entry the menu entry that invoked this callback to occur.
385  * \param menu an AO2 referenced pointer to the entire menu structure the menu_entry
386  * derived from.
387  *
388  * \note The menu_entry is a deep copy of the entry found in the menu structure. This allows
389  * for the menu_entry to be accessed without requiring the menu lock. If the menu must
390  * be accessed, the menu lock must be held. Reference counting of the menu structure is
391  * handled outside of the scope of this function.
392  *
393  * \retval 0 success
394  * \retval -1 failure
395  */
396 int conf_handle_dtmf(
397  struct ast_bridge_channel *bridge_channel,
398  struct confbridge_user *user,
399  struct conf_menu_entry *menu_entry,
400  struct conf_menu *menu);
401 
402 
403 /*! \brief Looks to see if sound file is stored in bridge profile sounds, if not
404  * default sound is provided.*/
405 const char *conf_get_sound(enum conf_sounds sound, struct bridge_profile_sounds *custom_sounds);
406 
407 int func_confbridge_helper(struct ast_channel *chan, const char *cmd, char *data, const char *value);
408 
409 /*!
410  * \brief Play sound file into conference bridge
411  *
412  * \param conference The conference bridge to play sound file into
413  * \param filename Sound file to play
414  *
415  * \retval 0 success
416  * \retval -1 failure
417  */
418 int play_sound_file(struct confbridge_conference *conference, const char *filename);
419 
420 /*!
421  * \brief Play sound file into conference bridge asynchronously
422  *
423  * If the initiator parameter is non-NULL, then the playback will wait for
424  * that initiator channel to get back in the bridge before playing the sound
425  * file. This way, the initiator has no danger of hearing a "clipped" file.
426  *
427  * \param conference The conference bridge to play sound file into
428  * \param filename Sound file to play
429  * \param initiator Channel that initiated playback.
430  *
431  * \retval 0 success
432  * \retval -1 failure
433  */
434 int async_play_sound_file(struct confbridge_conference *conference, const char *filename,
435  struct ast_channel *initiator);
436 
437 /*!
438  * \brief Indicate the initiator of an async sound file is ready for it to play.
439  *
440  * When playing an async sound file, the initiator is typically either out of the bridge
441  * or not in a position to hear the queued announcement. This function lets the announcement
442  * thread know that the initiator is now ready for the sound to play.
443  *
444  * If an async announcement was queued and no initiator channel was provided, then this is
445  * a no-op
446  *
447  * \param chan The channel that initiated the async announcement
448  */
449 void async_play_sound_ready(struct ast_channel *chan);
450 
451 /*! \brief Callback to be called when the conference has become empty
452  * \param conference The conference bridge
453  */
454 void conf_ended(struct confbridge_conference *conference);
455 
456 /*!
457  * \brief Update the actual mute status of the user and set it on the bridge.
458  *
459  * \param user User to update the mute status.
460  *
461  * \return Nothing
462  */
464 
465 /*!
466  * \brief Stop MOH for the conference user.
467  *
468  * \param user Conference user to stop MOH on.
469  *
470  * \return Nothing
471  */
472 void conf_moh_stop(struct confbridge_user *user);
473 
474 /*!
475  * \brief Start MOH for the conference user.
476  *
477  * \param user Conference user to start MOH on.
478  *
479  * \return Nothing
480  */
481 void conf_moh_start(struct confbridge_user *user);
482 
483 /*! \brief Attempt to mute/play MOH to the only user in the conference if they require it
484  * \param conference A conference bridge containing a single user
485  */
486 void conf_mute_only_active(struct confbridge_conference *conference);
487 
488 /*! \brief Callback to execute any time we transition from zero to one active users
489  * \param conference The conference bridge with a single active user joined
490  * \retval 0 success
491  * \retval -1 failure
492  */
493 void conf_handle_first_join(struct confbridge_conference *conference);
494 
495 /*! \brief Handle actions every time a waitmarked user joins w/o a marked user present
496  * \param user The waitmarked user
497  * \retval 0 success
498  * \retval -1 failure
499  */
501 
502 /*! \brief Handle actions whenever an user joins an empty conference
503  *
504  * \param user The user
505  */
507 
508 /*! \brief Handle when a conference moves to having more than one active participant
509  * \param conference The conference bridge with more than one active participant
510  */
511 void conf_handle_second_active(struct confbridge_conference *conference);
512 
513 /*! \brief Add a conference bridge user as an unmarked 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  */
517 void conf_add_user_active(struct confbridge_conference *conference, struct confbridge_user *user);
518 
519 /*! \brief Add a conference bridge user as a marked active 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  */
523 void conf_add_user_marked(struct confbridge_conference *conference, struct confbridge_user *user);
524 
525 /*! \brief Add a conference bridge user as an waiting user of the conference
526  * \param conference The conference bridge to add the user to
527  * \param user The conference bridge user to add to the conference
528  */
529 void conf_add_user_waiting(struct confbridge_conference *conference, struct confbridge_user *user);
530 
531 /*! \brief Remove a conference bridge user from the unmarked 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  */
535 void conf_remove_user_active(struct confbridge_conference *conference, struct confbridge_user *user);
536 
537 /*! \brief Remove a conference bridge user from the marked active 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  */
541 void conf_remove_user_marked(struct confbridge_conference *conference, struct confbridge_user *user);
542 
543 /*! \brief Remove a conference bridge user from the waiting conference users in the conference
544  * \param conference The conference bridge to remove the user from
545  * \param user The conference bridge user to remove from the conference
546  */
547 void conf_remove_user_waiting(struct confbridge_conference *conference, struct confbridge_user *user);
548 
549 /*! \brief Queue a function to run with the given conference bridge user as an argument once the state transition is complete
550  * \param user The conference bridge user to pass to the function
551  * \param func The function to queue
552  * \retval 0 success
553  * \retval non-zero failure
554  */
555 int conf_add_post_join_action(struct confbridge_user *user, int (*func)(struct confbridge_user *user));
556 
557 /*!
558  * \since 12.0
559  * \brief get the confbridge start stasis message type
560  *
561  * \retval stasis message type for confbridge start messages if it's available
562  * \retval NULL if it isn't
563  */
565 
566 /*!
567  * \since 12.0
568  * \brief get the confbridge end stasis message type
569  *
570  * \retval stasis message type for confbridge end messages if it's available
571  * \retval NULL if it isn't
572  */
574 
575 /*!
576  * \since 12.0
577  * \brief get the confbridge join stasis message type
578  *
579  * \retval stasis message type for confbridge join messages if it's available
580  * \retval NULL if it isn't
581  */
583 
584 /*!
585  * \since 12.0
586  * \brief get the confbridge leave stasis message type
587  *
588  * \retval stasis message type for confbridge leave messages if it's available
589  * \retval NULL if it isn't
590  */
592 
593 /*!
594  * \since 12.0
595  * \brief get the confbridge start_record stasis message type
596  *
597  * \retval stasis message type for confbridge start_record messages if it's available
598  * \retval NULL if it isn't
599  */
601 
602 /*!
603  * \since 12.0
604  * \brief get the confbridge stop_record stasis message type
605  *
606  * \retval stasis message type for confbridge stop_record messages if it's available
607  * \retval NULL if it isn't
608  */
610 
611 /*!
612  * \since 12.0
613  * \brief get the confbridge mute stasis message type
614  *
615  * \retval stasis message type for confbridge mute messages if it's available
616  * \retval NULL if it isn't
617  */
619 
620 /*!
621  * \since 12.0
622  * \brief get the confbridge unmute stasis message type
623  *
624  * \retval stasis message type for confbridge unmute messages if it's available
625  * \retval NULL if it isn't
626  */
628 
629 /*!
630  * \since 12.0
631  * \brief get the confbridge talking stasis message type
632  *
633  * \retval stasis message type for confbridge talking messages if it's available
634  * \retval NULL if it isn't
635  */
637 
638 /*!
639  * \since 15.5
640  * \brief get the confbridge welcome stasis message type
641  *
642  * \retval stasis message type for confbridge welcome messages if it's available
643  * \retval NULL if it isn't
644  */
646 
647 /*!
648  * \since 15.5
649  * \brief Get the string representation of a confbridge stasis message type
650  *
651  * \param event_type The confbridge event type such as 'confbridge_welcome_type()'
652  *
653  * \retval The string representation of the message type
654  * \retval "unknown" if not found
655  */
656 const char *confbridge_event_type_to_string(struct stasis_message_type *event_type);
657 
658 /*!
659  * \since 12.0
660  * \brief register stasis message routers to handle manager events for confbridge messages
661  *
662  * \retval 0 success
663  * \retval non-zero failure
664  */
665 int manager_confbridge_init(void);
666 
667 /*!
668  * \since 12.0
669  * \brief unregister stasis message routers to handle manager events for confbridge messages
670  */
671 void manager_confbridge_shutdown(void);
672 
673 /*!
674  * \brief Get ConfBridge record channel technology struct.
675  * \since 12.0.0
676  *
677  * \return ConfBridge record channel technology.
678  */
680 
681 /*!
682  * \brief Get ConfBridge announce channel technology struct.
683  * \since 12.0.0
684  *
685  * \return ConfBridge announce channel technology.
686  */
688 
689 /*!
690  * \brief Push the announcer channel into the conference.
691  * \since 12.0.0
692  *
693  * \param ast Either channel in the announcer channel pair.
694  *
695  * \retval 0 on success.
696  * \retval -1 on error.
697  */
698 int conf_announce_channel_push(struct ast_channel *ast);
699 
700 /*!
701  * \brief Find a confbridge by name.
702  * \since 13.22.0
703  * \since 15.5.0
704  *
705  * \param confbridge_name The name to search for
706  *
707  * \return ConfBridge (which must be unreffed) or NULL.
708  */
709 struct confbridge_conference *conf_find_bridge(const char *conference_name);
710 
711 /*!
712  * \brief Send events to bridge participants.
713  * \since 15.7
714  * \since 16.1
715  *
716  * \param conference The conference bridge
717  * \param chan The channel triggering the action
718  * \param msg The stasis message describing the event
719  */
721  struct ast_channel *chan, struct stasis_message *msg);
722 
723 /*!
724  * \brief Create join/leave events for attended transfers
725  * \since 13.28
726  * \since 16.5
727  *
728  * \param msg The attended transfer stasis message
729  *
730  */
732 
733 #endif
static char user[512]
struct stasis_message_type * confbridge_start_record_type(void)
get the confbridge start_record stasis message type
const char * confbridge_event_type_to_string(struct stasis_message_type *event_type)
Get the string representation of a confbridge stasis message type.
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&#39;s name and store that profile in result structure.
Main Channel structure associated with a channel.
Asterisk main include file. File version handling, generic pbx functions.
struct stasis_message_type * confbridge_join_type(void)
get the confbridge join stasis message type
int manager_confbridge_init(void)
register stasis message routers to handle manager events for confbridge messages
struct ast_channel * chan
Definition: confbridge.h:277
unsigned int playing_moh
Definition: confbridge.h:283
int play_sound_file(struct confbridge_conference *conference, const char *filename)
Play sound file into conference bridge.
Message representing attended transfer.
int conf_reload_config(void)
reload confbridge.conf file
static unsigned char leave[]
Definition: leave.h:12
int async_play_sound_file(struct confbridge_conference *conference, const char *filename, struct ast_channel *initiator)
Play sound file into conference bridge asynchronously.
Structure that contains features information.
struct confbridge_conference * conference
Definition: confbridge.h:272
Definition: confbridge.h:136
void conf_handle_second_active(struct confbridge_conference *conference)
Handle when a conference moves to having more than one active participant.
int conf_handle_only_person(struct confbridge_user *user)
Handle actions whenever an user joins an empty conference.
static int muted
Definition: muted.c:82
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.
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...
struct bridge_profile_sounds * sounds
Definition: confbridge.h:236
unsigned int suspended_moh
Definition: confbridge.h:280
int conf_load_config(void)
load confbridge.conf file
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
Definition: stringfields.h:337
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.
unsigned int silence_threshold
Definition: confbridge.h:162
struct confbridge_user::@94 list
int conf_announce_channel_push(struct ast_channel *ast)
Push the announcer channel into the conference.
struct conf_menu_action::@85 action
bridge_profile_flags
Definition: confbridge.h:75
struct ast_channel * record_chan
Definition: confbridge.h:255
struct stasis_message_type * confbridge_start_type(void)
get the confbridge start stasis message type
int value
Definition: syslog.c:37
struct ast_str * orig_rec_file
Definition: confbridge.h:257
unsigned int markedusers
Definition: confbridge.h:250
void confbridge_handle_atxfer(struct ast_attended_transfer_message *msg)
Create join/leave events for attended transfers.
unsigned int announce_user_count_all_after
Definition: confbridge.h:158
conf_menu_action_id
Definition: confbridge.h:94
struct ast_taskprocessor * playback_queue
Definition: confbridge.h:260
#define MAX_LANGUAGE
Definition: channel.h:173
char context[AST_MAX_CONTEXT]
Definition: confbridge.h:125
void conf_moh_start(struct confbridge_user *user)
Start MOH for the conference user.
unsigned int locked
Definition: confbridge.h:252
unsigned int waitingusers
Definition: confbridge.h:251
struct stasis_message_type * confbridge_leave_type(void)
get the confbridge leave 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.
void conf_destroy_config(void)
destroy the information loaded from the confbridge.conf file
user_profile_flags
Definition: confbridge.h:51
General Asterisk PBX channel definitions.
void async_play_sound_ready(struct ast_channel *chan)
Indicate the initiator of an async sound file is ready for it to play.
void conf_bridge_profile_destroy(struct bridge_profile *b_profile)
Destroy a bridge profile found by &#39;conf_find_bridge_profile&#39;.
void conf_handle_first_join(struct confbridge_conference *conference)
Callback to execute any time we transition from zero to one active users.
struct ao2_container * conference_bridges
Container to hold all conference bridges in progress.
unsigned int flags
Definition: confbridge.h:231
#define AST_MAX_EXTENSION
Definition: channel.h:135
void conf_ended(struct confbridge_conference *conference)
Callback to be called when the conference has become empty.
#define AST_STRING_FIELD(name)
Declare a string field.
Definition: stringfields.h:299
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.
A set of macros to manage forward-linked lists.
static char language[MAX_LANGUAGE]
Definition: chan_alsa.c:117
#define MAXIMUM_DTMF_FEATURE_STRING
Maximum length of a DTMF feature string.
void conf_send_event_to_participants(struct confbridge_conference *conference, struct ast_channel *chan, struct stasis_message *msg)
Send events to bridge participants.
AST_LIST_HEAD_NOLOCK(contactliststruct, contact)
void manager_confbridge_shutdown(void)
unregister stasis message routers to handle manager events for confbridge messages ...
unsigned int flags
Definition: confbridge.h:157
unsigned int maximum_sample_rate
Definition: confbridge.h:234
Structure to describe a channel "technology", ie a channel driver See for examples: ...
Definition: channel.h:629
unsigned int internal_sample_rate
Definition: confbridge.h:233
void conf_menu_entry_destroy(struct conf_menu_entry *menu_entry)
Destroys and frees all the actions stored in a menu_entry structure.
struct conf_menu_action::@84::@86 dialplan_args
struct stasis_message_type * confbridge_stop_record_type(void)
get the confbridge stop_record stasis message type
#define MAX_PIN
Definition: confbridge.h:37
struct confbridge_state * state
Definition: confbridge.h:246
int conf_handle_inactive_waitmarked(struct confbridge_user *user)
Handle actions every time a waitmarked user joins w/o a marked user present.
char playback_file[PATH_MAX]
Definition: confbridge.h:123
Structure that contains information about a bridge.
Definition: bridge.h:357
unsigned int video_update_discard
Definition: confbridge.h:238
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
void conf_bridge_profile_copy(struct bridge_profile *dst, struct bridge_profile *src)
copies a bridge profile
#define MAX_CONF_NAME
Definition: confbridge.h:35
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.
struct ast_channel_tech * conf_record_get_tech(void)
Get ConfBridge record channel technology struct.
unsigned int muted
Definition: confbridge.h:281
int func_confbridge_helper(struct ast_channel *chan, const char *cmd, char *data, const char *value)
static struct active_list active_list
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&#39;s DTMF menu, this function will get called to per...
#define MAX_PROFILE_NAME
Definition: confbridge.h:39
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
Definition: linkedlists.h:409
unsigned int max_members
Definition: confbridge.h:232
unsigned int talking_threshold
Definition: confbridge.h:160
conf_sounds
Definition: confbridge.h:167
void conf_moh_stop(struct confbridge_user *user)
Stop MOH for the conference user.
#define AST_MAX_CONTEXT
Definition: channel.h:136
static const char name[]
Definition: cdr_mysql.c:74
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.
unsigned int timeout
Definition: confbridge.h:164
The structure that represents a conference bridge.
Definition: confbridge.h:244
unsigned int activeusers
Definition: confbridge.h:249
union conf_menu_action::@84 data
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.
structure to hold users read from users.conf
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&#39;s name and store that profile in result structure...
Confbridge state handling.
A conference state object to hold the various state callback functions.
Definition: conf_state.h:48
Support for logging to various files, console and syslog Configuration in file logger.conf.
struct stasis_message_type * confbridge_end_type(void)
get the confbridge end stasis message type
enum conf_menu_action_id id
Definition: confbridge.h:121
Structure that contains information regarding a channel in a bridge.
A ast_taskprocessor structure is a singleton by name.
Definition: taskprocessor.c:69
struct stasis_message_type * confbridge_welcome_type(void)
get the confbridge welcome stasis message type
char exten[AST_MAX_EXTENSION]
Definition: confbridge.h:126
static PGresult * result
Definition: cel_pgsql.c:88
unsigned int remb_estimated_bitrate
Definition: confbridge.h:240
struct ast_channel * playback_chan
Definition: confbridge.h:254
static char regcontext[AST_MAX_CONTEXT]
Definition: chan_iax2.c:321
struct stasis_message_type * confbridge_talking_type(void)
get the confbridge talking stasis message type
struct stasis_message_type * confbridge_unmute_type(void)
get the confbridge unmute stasis message type
void conf_update_user_mute(struct confbridge_user *user)
Update the actual mute status of the user and set it on the bridge.
The structure that represents a conference bridge user.
Definition: confbridge.h:271
unsigned int muted
Definition: confbridge.h:253
struct ast_str * record_filename
Definition: confbridge.h:256
Definition: search.h:40
#define PATH_MAX
Definition: asterisk.h:40
struct stasis_message_type * confbridge_mute_type(void)
get the confbridge mute stasis message type
unsigned int talking
Definition: confbridge.h:284
Generic container type.
static struct actions actions
struct ast_channel_tech * conf_announce_get_tech(void)
Get ConfBridge announce channel technology struct.
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&#39;s name and apply the menu in DTMF hooks. ...
unsigned int remb_send_interval
Definition: confbridge.h:239
Bridging API.
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.
unsigned int mix_interval
Definition: confbridge.h:235
Structure specific to bridge technologies capable of performing talking optimizations.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
struct confbridge_conference * conf_find_bridge(const char *conference_name)
Find a confbridge by name.
unsigned int kicked
Definition: confbridge.h:282
Channel Bridging API.
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...
struct ast_bridge * bridge
Definition: confbridge.h:247