confbridge.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  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. #ifndef _CONFBRIDGE_H
  20. #define _CONFBRIDGE_H
  21. #include "asterisk.h"
  22. #include "asterisk/app.h"
  23. #include "asterisk/logger.h"
  24. #include "asterisk/linkedlists.h"
  25. #include "asterisk/channel.h"
  26. #include "asterisk/bridge.h"
  27. #include "asterisk/bridge_features.h"
  28. #include "conf_state.h"
  29. /* Maximum length of a conference bridge name */
  30. #define MAX_CONF_NAME AST_MAX_EXTENSION
  31. /* Maximum length of a conference pin */
  32. #define MAX_PIN 80
  33. /* Maximum length of bridge/user/menu profile names */
  34. #define MAX_PROFILE_NAME 128
  35. #define DEFAULT_USER_PROFILE "default_user"
  36. #define DEFAULT_BRIDGE_PROFILE "default_bridge"
  37. #define DEFAULT_MENU_PROFILE "default_menu"
  38. /*! Default minimum average magnitude threshold to determine talking by the DSP. */
  39. #define DEFAULT_TALKING_THRESHOLD 160
  40. /*! Default time in ms of silence necessary to declare talking stopped by the bridge. */
  41. #define DEFAULT_SILENCE_THRESHOLD 2500
  42. enum user_profile_flags {
  43. USER_OPT_ADMIN = (1 << 0), /*!< Set if the caller is an administrator */
  44. USER_OPT_NOONLYPERSON = (1 << 1), /*!< Set if the "you are currently the only person in this conference" sound file should not be played */
  45. USER_OPT_MARKEDUSER = (1 << 2), /*!< Set if the caller is a marked user */
  46. USER_OPT_STARTMUTED = (1 << 3), /*!< Set if the caller should be initially set muted */
  47. USER_OPT_MUSICONHOLD = (1 << 4), /*!< Set if music on hold should be played if nobody else is in the conference bridge */
  48. USER_OPT_QUIET = (1 << 5), /*!< Set if no audio prompts should be played */
  49. USER_OPT_ANNOUNCEUSERCOUNT = (1 << 6), /*!< Set if the number of users should be announced to the caller */
  50. USER_OPT_WAITMARKED = (1 << 7), /*!< Set if the user must wait for a marked user before starting */
  51. USER_OPT_ENDMARKED = (1 << 8), /*!< Set if the user should be kicked after the last Marked user exits */
  52. USER_OPT_DENOISE = (1 << 9), /*!< Sets if denoise filter should be used on audio before mixing. */
  53. USER_OPT_ANNOUNCE_JOIN_LEAVE = (1 << 10), /*!< Sets if the user's name should be recorded and announced on join and leave. */
  54. USER_OPT_TALKER_DETECT = (1 << 11), /*!< Sets if start and stop talking events should generated for this user over AMI. */
  55. USER_OPT_DROP_SILENCE = (1 << 12), /*!< Sets if silence should be dropped from the mix or not. */
  56. USER_OPT_DTMF_PASS = (1 << 13), /*!< Sets if dtmf should be passed into the conference or not */
  57. USER_OPT_ANNOUNCEUSERCOUNTALL = (1 << 14), /*!< Sets if the number of users should be announced to everyone. */
  58. USER_OPT_JITTERBUFFER = (1 << 15), /*!< Places a jitterbuffer on the user. */
  59. USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW = (1 << 16), /*!< modifies ANNOUNCE_JOIN_LEAVE - user reviews the recording before continuing */
  60. };
  61. enum bridge_profile_flags {
  62. BRIDGE_OPT_RECORD_CONFERENCE = (1 << 0), /*!< Set if the conference should be recorded */
  63. BRIDGE_OPT_VIDEO_SRC_LAST_MARKED = (1 << 1), /*!< Set if conference should feed video of last marked user to all participants. */
  64. BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED = (1 << 2), /*!< Set if conference should feed video of first marked user to all participants. */
  65. BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER = (1 << 3), /*!< Set if conference set the video feed to follow the loudest talker. */
  66. BRIDGE_OPT_RECORD_FILE_APPEND = (1 << 4), /*!< Set if the record file should be appended to between start/stops. */
  67. };
  68. enum conf_menu_action_id {
  69. MENU_ACTION_TOGGLE_MUTE = 1,
  70. MENU_ACTION_PLAYBACK,
  71. MENU_ACTION_PLAYBACK_AND_CONTINUE,
  72. MENU_ACTION_INCREASE_LISTENING,
  73. MENU_ACTION_DECREASE_LISTENING,
  74. MENU_ACTION_RESET_LISTENING,
  75. MENU_ACTION_RESET_TALKING,
  76. MENU_ACTION_INCREASE_TALKING,
  77. MENU_ACTION_DECREASE_TALKING,
  78. MENU_ACTION_DIALPLAN_EXEC,
  79. MENU_ACTION_ADMIN_TOGGLE_LOCK,
  80. MENU_ACTION_ADMIN_KICK_LAST,
  81. MENU_ACTION_LEAVE,
  82. MENU_ACTION_NOOP,
  83. MENU_ACTION_SET_SINGLE_VIDEO_SRC,
  84. MENU_ACTION_RELEASE_SINGLE_VIDEO_SRC,
  85. MENU_ACTION_PARTICIPANT_COUNT,
  86. MENU_ACTION_ADMIN_TOGGLE_MUTE_PARTICIPANTS,
  87. };
  88. /*! The conference menu action contains both
  89. * the action id that represents the action that
  90. * must take place, along with any data associated
  91. * with that action. */
  92. struct conf_menu_action {
  93. enum conf_menu_action_id id;
  94. union {
  95. char playback_file[PATH_MAX];
  96. struct {
  97. char context[AST_MAX_CONTEXT];
  98. char exten[AST_MAX_EXTENSION];
  99. int priority;
  100. } dialplan_args;
  101. } data;
  102. AST_LIST_ENTRY(conf_menu_action) action;
  103. };
  104. /*! Conference menu entries contain the DTMF sequence
  105. * and the list of actions that are associated with that
  106. * sequence. */
  107. struct conf_menu_entry {
  108. /*! the DTMF sequence that triggers the actions */
  109. char dtmf[MAXIMUM_DTMF_FEATURE_STRING];
  110. /*! The actions associated with this menu entry. */
  111. AST_LIST_HEAD_NOLOCK(, conf_menu_action) actions;
  112. AST_LIST_ENTRY(conf_menu_entry) entry;
  113. };
  114. /*! Conference menu structure. Contains a list
  115. * of DTMF sequences coupled with the actions those
  116. * sequences invoke.*/
  117. struct conf_menu {
  118. char name[MAX_PROFILE_NAME];
  119. AST_LIST_HEAD_NOLOCK(, conf_menu_entry) entries;
  120. };
  121. struct user_profile {
  122. char name[MAX_PROFILE_NAME];
  123. char pin[MAX_PIN];
  124. char moh_class[128];
  125. char announcement[PATH_MAX];
  126. unsigned int flags;
  127. unsigned int announce_user_count_all_after;
  128. /*! Minimum average magnitude threshold to determine talking by the DSP. */
  129. unsigned int talking_threshold;
  130. /*! Time in ms of silence necessary to declare talking stopped by the bridge. */
  131. unsigned int silence_threshold;
  132. /*! The time in ms the user may stay in the confbridge */
  133. unsigned int timeout;
  134. };
  135. enum conf_sounds {
  136. CONF_SOUND_HAS_JOINED,
  137. CONF_SOUND_HAS_LEFT,
  138. CONF_SOUND_KICKED,
  139. CONF_SOUND_MUTED,
  140. CONF_SOUND_UNMUTED,
  141. CONF_SOUND_ONLY_ONE,
  142. CONF_SOUND_THERE_ARE,
  143. CONF_SOUND_OTHER_IN_PARTY,
  144. CONF_SOUND_PLACE_IN_CONF,
  145. CONF_SOUND_WAIT_FOR_LEADER,
  146. CONF_SOUND_LEADER_HAS_LEFT,
  147. CONF_SOUND_GET_PIN,
  148. CONF_SOUND_INVALID_PIN,
  149. CONF_SOUND_ONLY_PERSON,
  150. CONF_SOUND_LOCKED,
  151. CONF_SOUND_LOCKED_NOW,
  152. CONF_SOUND_UNLOCKED_NOW,
  153. CONF_SOUND_ERROR_MENU,
  154. CONF_SOUND_JOIN,
  155. CONF_SOUND_LEAVE,
  156. CONF_SOUND_PARTICIPANTS_MUTED,
  157. CONF_SOUND_PARTICIPANTS_UNMUTED,
  158. CONF_SOUND_BEGIN,
  159. };
  160. struct bridge_profile_sounds {
  161. AST_DECLARE_STRING_FIELDS(
  162. AST_STRING_FIELD(hasjoin);
  163. AST_STRING_FIELD(hasleft);
  164. AST_STRING_FIELD(kicked);
  165. AST_STRING_FIELD(muted);
  166. AST_STRING_FIELD(unmuted);
  167. AST_STRING_FIELD(onlyone);
  168. AST_STRING_FIELD(thereare);
  169. AST_STRING_FIELD(otherinparty);
  170. AST_STRING_FIELD(placeintoconf);
  171. AST_STRING_FIELD(waitforleader);
  172. AST_STRING_FIELD(leaderhasleft);
  173. AST_STRING_FIELD(getpin);
  174. AST_STRING_FIELD(invalidpin);
  175. AST_STRING_FIELD(onlyperson);
  176. AST_STRING_FIELD(locked);
  177. AST_STRING_FIELD(lockednow);
  178. AST_STRING_FIELD(unlockednow);
  179. AST_STRING_FIELD(errormenu);
  180. AST_STRING_FIELD(leave);
  181. AST_STRING_FIELD(join);
  182. AST_STRING_FIELD(participantsmuted);
  183. AST_STRING_FIELD(participantsunmuted);
  184. AST_STRING_FIELD(begin);
  185. );
  186. };
  187. struct bridge_profile {
  188. char name[MAX_PROFILE_NAME];
  189. char language[MAX_LANGUAGE]; /*!< Language used for playback_chan */
  190. char rec_file[PATH_MAX];
  191. unsigned int flags;
  192. unsigned int max_members; /*!< The maximum number of participants allowed in the conference */
  193. unsigned int internal_sample_rate; /*!< The internal sample rate of the bridge. 0 when set to auto adjust mode. */
  194. unsigned int mix_interval; /*!< The internal mixing interval used by the bridge. When set to 0 the bridgewill use a default interval. */
  195. struct bridge_profile_sounds *sounds;
  196. char regcontext[AST_MAX_CONTEXT];
  197. };
  198. /*! \brief The structure that represents a conference bridge */
  199. struct confbridge_conference {
  200. char name[MAX_CONF_NAME]; /*!< Name of the conference bridge */
  201. struct confbridge_state *state; /*!< Conference state information */
  202. struct ast_bridge *bridge; /*!< Bridge structure doing the mixing */
  203. struct bridge_profile b_profile; /*!< The Bridge Configuration Profile */
  204. unsigned int activeusers; /*!< Number of active users present */
  205. unsigned int markedusers; /*!< Number of marked users present */
  206. unsigned int waitingusers; /*!< Number of waiting users present */
  207. unsigned int locked:1; /*!< Is this conference bridge locked? */
  208. unsigned int muted:1; /*!< Is this conference bridge muted? */
  209. struct ast_channel *playback_chan; /*!< Channel used for playback into the conference bridge */
  210. struct ast_channel *record_chan; /*!< Channel used for recording the conference */
  211. struct ast_str *record_filename; /*!< Recording filename. */
  212. struct ast_str *orig_rec_file; /*!< Previous b_profile.rec_file. */
  213. AST_LIST_HEAD_NOLOCK(, confbridge_user) active_list; /*!< List of users participating in the conference bridge */
  214. AST_LIST_HEAD_NOLOCK(, confbridge_user) waiting_list; /*!< List of users waiting to join the conference bridge */
  215. struct ast_taskprocessor *playback_queue; /*!< Queue for playing back bridge announcements and managing the announcer channel */
  216. };
  217. extern struct ao2_container *conference_bridges;
  218. struct post_join_action {
  219. int (*func)(struct confbridge_user *user);
  220. AST_LIST_ENTRY(post_join_action) list;
  221. };
  222. /*! \brief The structure that represents a conference bridge user */
  223. struct confbridge_user {
  224. struct confbridge_conference *conference; /*!< Conference bridge they are participating in */
  225. struct bridge_profile b_profile; /*!< The Bridge Configuration Profile */
  226. struct user_profile u_profile; /*!< The User Configuration Profile */
  227. char menu_name[MAX_PROFILE_NAME]; /*!< The name of the DTMF menu assigned to this user */
  228. char name_rec_location[PATH_MAX]; /*!< Location of the User's name recorded file if it exists */
  229. struct ast_channel *chan; /*!< Asterisk channel participating */
  230. struct ast_bridge_features features; /*!< Bridge features structure */
  231. struct ast_bridge_tech_optimizations tech_args; /*!< Bridge technology optimizations for talk detection */
  232. unsigned int suspended_moh; /*!< Count of active suspended MOH actions. */
  233. unsigned int muted:1; /*!< Has the user requested to be muted? */
  234. unsigned int kicked:1; /*!< User has been kicked from the conference */
  235. unsigned int playing_moh:1; /*!< MOH is currently being played to the user */
  236. unsigned int talking:1; /*!< User is currently talking */
  237. AST_LIST_HEAD_NOLOCK(, post_join_action) post_join_list; /*!< List of sounds to play after joining */;
  238. AST_LIST_ENTRY(confbridge_user) list; /*!< Linked list information */
  239. };
  240. /*! \brief load confbridge.conf file */
  241. int conf_load_config(void);
  242. /*! \brief reload confbridge.conf file */
  243. int conf_reload_config(void);
  244. /*! \brief destroy the information loaded from the confbridge.conf file*/
  245. void conf_destroy_config(void);
  246. /*!
  247. * \brief find a user profile given a user profile's name and store
  248. * that profile in result structure.
  249. *
  250. * \param chan channel the user profile is requested for
  251. * \param user_profile_name name of the profile requested (optional)
  252. * \param result data contained by the user profile will be copied to this struct pointer
  253. *
  254. * \details If user_profile_name is not provided, this function will
  255. * check for the presence of a user profile set by the CONFBRIDGE
  256. * function on a channel datastore. If that doesn't exist, the
  257. * default_user profile is used.
  258. *
  259. * \retval user profile on success
  260. * \retval NULL on failure
  261. */
  262. const struct user_profile *conf_find_user_profile(struct ast_channel *chan, const char *user_profile_name, struct user_profile *result);
  263. /*!
  264. * \brief Find a bridge profile given a bridge profile's name and store
  265. * that profile in result structure.
  266. *
  267. * \param chan channel the bridge profile is requested for
  268. * \param bridge_profile_name name of the profile requested (optional)
  269. * \param result data contained by the bridge profile will be copied to this struct pointer
  270. *
  271. * \details If bridge_profile_name is not provided, this function will
  272. * check for the presence of a bridge profile set by the CONFBRIDGE
  273. * function on a channel datastore. If that doesn't exist, the
  274. * default_bridge profile is used.
  275. *
  276. * \retval bridge profile on success
  277. * \retval NULL on failure
  278. */
  279. const struct bridge_profile *conf_find_bridge_profile(struct ast_channel *chan, const char *bridge_profile_name, struct bridge_profile *result);
  280. /*!
  281. * \brief find a menu profile given a menu profile's name and apply
  282. * the menu in DTMF hooks.
  283. *
  284. * \param chan channel the menu profile is requested for
  285. * \param user user profile the menu is being applied to
  286. * \param menu_profile_name name of the profile requested (optional)
  287. *
  288. * \details If menu_profile_name is not provided, this function will
  289. * check for the presence of a menu profile set by the CONFBRIDGE
  290. * function on a channel datastore. If that doesn't exist, the
  291. * default_menu profile is used.
  292. *
  293. * \retval 0 on success
  294. * \retval -1 on failure
  295. */
  296. int conf_set_menu_to_user(struct ast_channel *chan, struct confbridge_user *user, const char *menu_profile_name);
  297. /*!
  298. * \brief Destroy a bridge profile found by 'conf_find_bridge_profile'
  299. */
  300. void conf_bridge_profile_destroy(struct bridge_profile *b_profile);
  301. /*!
  302. * \brief copies a bridge profile
  303. * \note conf_bridge_profile_destroy must be called on the dst structure
  304. */
  305. void conf_bridge_profile_copy(struct bridge_profile *dst, struct bridge_profile *src);
  306. /*!
  307. * \brief Finds a menu_entry in a menu structure matched by DTMF sequence.
  308. *
  309. * \note the menu entry found must be destroyed using conf_menu_entry_destroy()
  310. *
  311. * \retval 1 success, entry is found and stored in result
  312. * \retval 0 failure, no entry found for given DTMF sequence
  313. */
  314. int conf_find_menu_entry_by_sequence(const char *dtmf_sequence, struct conf_menu *menu, struct conf_menu_entry *result);
  315. /*!
  316. * \brief Destroys and frees all the actions stored in a menu_entry structure
  317. */
  318. void conf_menu_entry_destroy(struct conf_menu_entry *menu_entry);
  319. /*!
  320. * \brief Once a DTMF sequence matches a sequence in the user's DTMF menu, this function will get
  321. * called to perform the menu action.
  322. *
  323. * \param bridge_channel Bridged channel this is involving
  324. * \param user the conference user to perform the action on.
  325. * \param menu_entry the menu entry that invoked this callback to occur.
  326. * \param menu an AO2 referenced pointer to the entire menu structure the menu_entry
  327. * derived from.
  328. *
  329. * \note The menu_entry is a deep copy of the entry found in the menu structure. This allows
  330. * for the menu_entry to be accessed without requiring the menu lock. If the menu must
  331. * be accessed, the menu lock must be held. Reference counting of the menu structure is
  332. * handled outside of the scope of this function.
  333. *
  334. * \retval 0 success
  335. * \retval -1 failure
  336. */
  337. int conf_handle_dtmf(
  338. struct ast_bridge_channel *bridge_channel,
  339. struct confbridge_user *user,
  340. struct conf_menu_entry *menu_entry,
  341. struct conf_menu *menu);
  342. /*! \brief Looks to see if sound file is stored in bridge profile sounds, if not
  343. * default sound is provided.*/
  344. const char *conf_get_sound(enum conf_sounds sound, struct bridge_profile_sounds *custom_sounds);
  345. int func_confbridge_helper(struct ast_channel *chan, const char *cmd, char *data, const char *value);
  346. /*!
  347. * \brief Play sound file into conference bridge
  348. *
  349. * \param conference The conference bridge to play sound file into
  350. * \param filename Sound file to play
  351. *
  352. * \retval 0 success
  353. * \retval -1 failure
  354. */
  355. int play_sound_file(struct confbridge_conference *conference, const char *filename);
  356. /*!
  357. * \brief Play sound file into conference bridge asynchronously
  358. *
  359. * If the initiator parameter is non-NULL, then the playback will wait for
  360. * that initiator channel to get back in the bridge before playing the sound
  361. * file. This way, the initiator has no danger of hearing a "clipped" file.
  362. *
  363. * \param conference The conference bridge to play sound file into
  364. * \param filename Sound file to play
  365. * \param initiator Channel that initiated playback.
  366. *
  367. * \retval 0 success
  368. * \retval -1 failure
  369. */
  370. int async_play_sound_file(struct confbridge_conference *conference, const char *filename,
  371. struct ast_channel *initiator);
  372. /*!
  373. * \brief Indicate the initiator of an async sound file is ready for it to play.
  374. *
  375. * When playing an async sound file, the initiator is typically either out of the bridge
  376. * or not in a position to hear the queued announcement. This function lets the announcement
  377. * thread know that the initiator is now ready for the sound to play.
  378. *
  379. * If an async announcement was queued and no initiator channel was provided, then this is
  380. * a no-op
  381. *
  382. * \param chan The channel that initiated the async announcement
  383. */
  384. void async_play_sound_ready(struct ast_channel *chan);
  385. /*! \brief Callback to be called when the conference has become empty
  386. * \param conference The conference bridge
  387. */
  388. void conf_ended(struct confbridge_conference *conference);
  389. /*!
  390. * \brief Update the actual mute status of the user and set it on the bridge.
  391. *
  392. * \param user User to update the mute status.
  393. *
  394. * \return Nothing
  395. */
  396. void conf_update_user_mute(struct confbridge_user *user);
  397. /*!
  398. * \brief Stop MOH for the conference user.
  399. *
  400. * \param user Conference user to stop MOH on.
  401. *
  402. * \return Nothing
  403. */
  404. void conf_moh_stop(struct confbridge_user *user);
  405. /*!
  406. * \brief Start MOH for the conference user.
  407. *
  408. * \param user Conference user to start MOH on.
  409. *
  410. * \return Nothing
  411. */
  412. void conf_moh_start(struct confbridge_user *user);
  413. /*! \brief Attempt to mute/play MOH to the only user in the conference if they require it
  414. * \param conference A conference bridge containing a single user
  415. */
  416. void conf_mute_only_active(struct confbridge_conference *conference);
  417. /*! \brief Callback to execute any time we transition from zero to one active users
  418. * \param conference The conference bridge with a single active user joined
  419. * \retval 0 success
  420. * \retval -1 failure
  421. */
  422. void conf_handle_first_join(struct confbridge_conference *conference);
  423. /*! \brief Handle actions every time a waitmarked user joins w/o a marked user present
  424. * \param user The waitmarked user
  425. * \retval 0 success
  426. * \retval -1 failure
  427. */
  428. int conf_handle_inactive_waitmarked(struct confbridge_user *user);
  429. /*! \brief Handle actions whenever an user joins an empty conference
  430. *
  431. * \param user The user
  432. */
  433. int conf_handle_only_person(struct confbridge_user *user);
  434. /*! \brief Handle when a conference moves to having more than one active participant
  435. * \param conference The conference bridge with more than one active participant
  436. */
  437. void conf_handle_second_active(struct confbridge_conference *conference);
  438. /*! \brief Add a conference bridge user as an unmarked active user of the conference
  439. * \param conference The conference bridge to add the user to
  440. * \param user The conference bridge user to add to the conference
  441. */
  442. void conf_add_user_active(struct confbridge_conference *conference, struct confbridge_user *user);
  443. /*! \brief Add a conference bridge user as a marked active user of the conference
  444. * \param conference The conference bridge to add the user to
  445. * \param user The conference bridge user to add to the conference
  446. */
  447. void conf_add_user_marked(struct confbridge_conference *conference, struct confbridge_user *user);
  448. /*! \brief Add a conference bridge user as an waiting user of the conference
  449. * \param conference The conference bridge to add the user to
  450. * \param user The conference bridge user to add to the conference
  451. */
  452. void conf_add_user_waiting(struct confbridge_conference *conference, struct confbridge_user *user);
  453. /*! \brief Remove a conference bridge user from the unmarked active conference users in the conference
  454. * \param conference The conference bridge to remove the user from
  455. * \param user The conference bridge user to remove from the conference
  456. */
  457. void conf_remove_user_active(struct confbridge_conference *conference, struct confbridge_user *user);
  458. /*! \brief Remove a conference bridge user from the marked active conference users in the conference
  459. * \param conference The conference bridge to remove the user from
  460. * \param user The conference bridge user to remove from the conference
  461. */
  462. void conf_remove_user_marked(struct confbridge_conference *conference, struct confbridge_user *user);
  463. /*! \brief Remove a conference bridge user from the waiting conference users in the conference
  464. * \param conference The conference bridge to remove the user from
  465. * \param user The conference bridge user to remove from the conference
  466. */
  467. void conf_remove_user_waiting(struct confbridge_conference *conference, struct confbridge_user *user);
  468. /*! \brief Queue a function to run with the given conference bridge user as an argument once the state transition is complete
  469. * \param user The conference bridge user to pass to the function
  470. * \param func The function to queue
  471. * \retval 0 success
  472. * \retval non-zero failure
  473. */
  474. int conf_add_post_join_action(struct confbridge_user *user, int (*func)(struct confbridge_user *user));
  475. /*!
  476. * \since 12.0
  477. * \brief get the confbridge start stasis message type
  478. *
  479. * \retval stasis message type for confbridge start messages if it's available
  480. * \retval NULL if it isn't
  481. */
  482. struct stasis_message_type *confbridge_start_type(void);
  483. /*!
  484. * \since 12.0
  485. * \brief get the confbridge end stasis message type
  486. *
  487. * \retval stasis message type for confbridge end messages if it's available
  488. * \retval NULL if it isn't
  489. */
  490. struct stasis_message_type *confbridge_end_type(void);
  491. /*!
  492. * \since 12.0
  493. * \brief get the confbridge join stasis message type
  494. *
  495. * \retval stasis message type for confbridge join messages if it's available
  496. * \retval NULL if it isn't
  497. */
  498. struct stasis_message_type *confbridge_join_type(void);
  499. /*!
  500. * \since 12.0
  501. * \brief get the confbridge leave stasis message type
  502. *
  503. * \retval stasis message type for confbridge leave messages if it's available
  504. * \retval NULL if it isn't
  505. */
  506. struct stasis_message_type *confbridge_leave_type(void);
  507. /*!
  508. * \since 12.0
  509. * \brief get the confbridge start_record stasis message type
  510. *
  511. * \retval stasis message type for confbridge start_record messages if it's available
  512. * \retval NULL if it isn't
  513. */
  514. struct stasis_message_type *confbridge_start_record_type(void);
  515. /*!
  516. * \since 12.0
  517. * \brief get the confbridge stop_record stasis message type
  518. *
  519. * \retval stasis message type for confbridge stop_record messages if it's available
  520. * \retval NULL if it isn't
  521. */
  522. struct stasis_message_type *confbridge_stop_record_type(void);
  523. /*!
  524. * \since 12.0
  525. * \brief get the confbridge mute stasis message type
  526. *
  527. * \retval stasis message type for confbridge mute messages if it's available
  528. * \retval NULL if it isn't
  529. */
  530. struct stasis_message_type *confbridge_mute_type(void);
  531. /*!
  532. * \since 12.0
  533. * \brief get the confbridge unmute stasis message type
  534. *
  535. * \retval stasis message type for confbridge unmute messages if it's available
  536. * \retval NULL if it isn't
  537. */
  538. struct stasis_message_type *confbridge_unmute_type(void);
  539. /*!
  540. * \since 12.0
  541. * \brief get the confbridge talking stasis message type
  542. *
  543. * \retval stasis message type for confbridge talking messages if it's available
  544. * \retval NULL if it isn't
  545. */
  546. struct stasis_message_type *confbridge_talking_type(void);
  547. /*!
  548. * \since 12.0
  549. * \brief register stasis message routers to handle manager events for confbridge messages
  550. *
  551. * \retval 0 success
  552. * \retval non-zero failure
  553. */
  554. int manager_confbridge_init(void);
  555. /*!
  556. * \since 12.0
  557. * \brief unregister stasis message routers to handle manager events for confbridge messages
  558. */
  559. void manager_confbridge_shutdown(void);
  560. /*!
  561. * \brief Get ConfBridge record channel technology struct.
  562. * \since 12.0.0
  563. *
  564. * \return ConfBridge record channel technology.
  565. */
  566. struct ast_channel_tech *conf_record_get_tech(void);
  567. /*!
  568. * \brief Get ConfBridge announce channel technology struct.
  569. * \since 12.0.0
  570. *
  571. * \return ConfBridge announce channel technology.
  572. */
  573. struct ast_channel_tech *conf_announce_get_tech(void);
  574. /*!
  575. * \brief Push the announcer channel into the conference.
  576. * \since 12.0.0
  577. *
  578. * \param ast Either channel in the announcer channel pair.
  579. *
  580. * \retval 0 on success.
  581. * \retval -1 on error.
  582. */
  583. int conf_announce_channel_push(struct ast_channel *ast);
  584. #endif