Asterisk - The Open Source Telephony Project GIT-master-f36a736
Data Structures | Macros | Typedefs | Enumerations | Functions
bridge_channel.h File Reference
#include "asterisk/bridge_features.h"
#include "asterisk/bridge_technology.h"
Include dependency graph for bridge_channel.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ast_bridge_channel
 Structure that contains information regarding a channel in a bridge. More...
 

Macros

#define ast_bridge_channel_lock(bridge_channel)   _ast_bridge_channel_lock(bridge_channel, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge_channel)
 Lock the bridge_channel. More...
 
#define ast_bridge_channel_trylock(bridge_channel)   _ast_bridge_channel_trylock(bridge_channel, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge_channel)
 Try locking the bridge_channel. More...
 
#define ast_bridge_channel_unlock(bridge_channel)   _ast_bridge_channel_unlock(bridge_channel, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge_channel)
 Unlock the bridge_channel. More...
 

Typedefs

typedef void(* ast_bridge_custom_callback_fn) (struct ast_bridge_channel *bridge_channel, const void *payload, size_t payload_size)
 Custom callback run on a bridge channel. More...
 
typedef void(* ast_bridge_custom_play_fn) (struct ast_bridge_channel *bridge_channel, const char *playfile)
 Custom interpretation of the playfile name. More...
 

Enumerations

enum  ast_bridge_channel_custom_callback_option { AST_BRIDGE_CHANNEL_CB_OPTION_MEDIA = (1 << 0) }
 
enum  bridge_channel_state { BRIDGE_CHANNEL_STATE_WAIT = 0 , BRIDGE_CHANNEL_STATE_END , BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE }
 State information about a bridged channel. More...
 
enum  bridge_channel_thread_state { BRIDGE_CHANNEL_THREAD_IDLE , BRIDGE_CHANNEL_THREAD_SIMPLE , BRIDGE_CHANNEL_THREAD_FRAME }
 

Functions

static void _ast_bridge_channel_lock (struct ast_bridge_channel *bridge_channel, const char *file, const char *function, int line, const char *var)
 
static int _ast_bridge_channel_trylock (struct ast_bridge_channel *bridge_channel, const char *file, const char *function, int line, const char *var)
 
static void _ast_bridge_channel_unlock (struct ast_bridge_channel *bridge_channel, const char *file, const char *function, int line, const char *var)
 
void ast_bridge_channel_feature_digit (struct ast_bridge_channel *bridge_channel, int digit)
 Add a DTMF digit to the collected digits to match against DTMF features. More...
 
void ast_bridge_channel_feature_digit_add (struct ast_bridge_channel *bridge_channel, int digit)
 Add a DTMF digit to the collected digits. More...
 
struct ast_channelast_bridge_channel_get_chan (struct ast_bridge_channel *bridge_channel)
 Get a ref to the bridge_channel's ast_channel. More...
 
void ast_bridge_channel_kick (struct ast_bridge_channel *bridge_channel, int cause)
 Kick the channel out of the bridge. More...
 
void ast_bridge_channel_leave_bridge (struct ast_bridge_channel *bridge_channel, enum bridge_channel_state new_state, int cause)
 Set bridge channel state to leave bridge (if not leaving already). More...
 
void ast_bridge_channel_leave_bridge_nolock (struct ast_bridge_channel *bridge_channel, enum bridge_channel_state new_state, int cause)
 Set bridge channel state to leave bridge (if not leaving already). More...
 
void ast_bridge_channel_lock_bridge (struct ast_bridge_channel *bridge_channel)
 Lock the bridge associated with the bridge channel. More...
 
struct ast_bridgeast_bridge_channel_merge_inhibit (struct ast_bridge_channel *bridge_channel, int request)
 Adjust the bridge_channel's bridge merge inhibit request count. More...
 
int ast_bridge_channel_notify_talking (struct ast_bridge_channel *bridge_channel, int started_talking)
 Lets the bridging indicate when a bridge channel has stopped or started talking. More...
 
struct ast_bridge_channelast_bridge_channel_peer (struct ast_bridge_channel *bridge_channel)
 Get the peer bridge channel of a two party bridge. More...
 
void ast_bridge_channel_playfile (struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class)
 Play a file on the bridge channel. More...
 
int ast_bridge_channel_queue_app (struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class)
 Queue a bridge action run application frame onto the bridge channel. More...
 
int ast_bridge_channel_queue_callback (struct ast_bridge_channel *bridge_channel, enum ast_bridge_channel_custom_callback_option flags, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size)
 Queue a bridge action custom callback frame onto the bridge channel. More...
 
int ast_bridge_channel_queue_control_data (struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen)
 Queue a control frame onto the bridge channel with data. More...
 
int ast_bridge_channel_queue_frame (struct ast_bridge_channel *bridge_channel, struct ast_frame *fr)
 Write a frame to the specified bridge_channel. More...
 
int ast_bridge_channel_queue_playfile (struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class)
 Queue a bridge action play file frame onto the bridge channel. More...
 
int ast_bridge_channel_queue_playfile_sync (struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class)
 Synchronously queue a bridge action play file frame onto the bridge channel. More...
 
void ast_bridge_channel_restore_formats (struct ast_bridge_channel *bridge_channel)
 Restore the formats of a bridge channel's channel to how they were before bridge_channel_internal_join. More...
 
void ast_bridge_channel_run_app (struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class)
 Run an application on the bridge channel. More...
 
void ast_bridge_channel_stream_map (struct ast_bridge_channel *bridge_channel)
 Maps a channel's stream topology to and from the bridge. More...
 
void ast_bridge_channel_update_accountcodes (struct ast_bridge_channel *joining, struct ast_bridge_channel *leaving)
 
void ast_bridge_channel_update_linkedids (struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap)
 
int ast_bridge_channel_write_app (struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class)
 Write a bridge action run application frame into the bridge. More...
 
int ast_bridge_channel_write_callback (struct ast_bridge_channel *bridge_channel, enum ast_bridge_channel_custom_callback_option flags, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size)
 Write a bridge action custom callback frame into the bridge. More...
 
int ast_bridge_channel_write_control_data (struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen)
 Write a control frame into the bridge with data. More...
 
int ast_bridge_channel_write_hold (struct ast_bridge_channel *bridge_channel, const char *moh_class)
 Write a hold frame into the bridge. More...
 
int ast_bridge_channel_write_park (struct ast_bridge_channel *bridge_channel, const char *parkee_uuid, const char *parker_uuid, const char *app_data)
 Have a bridge channel park a channel in the bridge. More...
 
int ast_bridge_channel_write_playfile (struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class)
 Write a bridge action play file frame into the bridge. More...
 
int ast_bridge_channel_write_unhold (struct ast_bridge_channel *bridge_channel)
 Write an unhold frame into the bridge. More...
 

Macro Definition Documentation

◆ ast_bridge_channel_lock

#define ast_bridge_channel_lock (   bridge_channel)    _ast_bridge_channel_lock(bridge_channel, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge_channel)

Lock the bridge_channel.

Parameters
bridge_channelWhat to lock

Definition at line 229 of file bridge_channel.h.

◆ ast_bridge_channel_trylock

#define ast_bridge_channel_trylock (   bridge_channel)    _ast_bridge_channel_trylock(bridge_channel, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge_channel)

Try locking the bridge_channel.

Parameters
bridge_channelWhat to try locking
Return values
0on success.
non-zeroon error.

Definition at line 218 of file bridge_channel.h.

◆ ast_bridge_channel_unlock

#define ast_bridge_channel_unlock (   bridge_channel)    _ast_bridge_channel_unlock(bridge_channel, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge_channel)

Unlock the bridge_channel.

Parameters
bridge_channelWhat to unlock

Definition at line 240 of file bridge_channel.h.

Typedef Documentation

◆ ast_bridge_custom_callback_fn

typedef void(* ast_bridge_custom_callback_fn) (struct ast_bridge_channel *bridge_channel, const void *payload, size_t payload_size)

Custom callback run on a bridge channel.

Parameters
bridge_channelWhich channel to operate on.
payloadData to pass to the callback. (NULL if none).
payload_sizeSize of the payload if payload is non-NULL. A number otherwise.
Note
The payload MUST NOT have any resources that need to be freed.

Definition at line 598 of file bridge_channel.h.

◆ ast_bridge_custom_play_fn

typedef void(* ast_bridge_custom_play_fn) (struct ast_bridge_channel *bridge_channel, const char *playfile)

Custom interpretation of the playfile name.

Parameters
bridge_channelWhich channel to play the file on
playfileSound filename to play.

Definition at line 514 of file bridge_channel.h.

Enumeration Type Documentation

◆ ast_bridge_channel_custom_callback_option

Enumerator
AST_BRIDGE_CHANNEL_CB_OPTION_MEDIA 

The callback temporarily affects media. (Like a custom playfile.)

Definition at line 600 of file bridge_channel.h.

600 {
601 /*! The callback temporarily affects media. (Like a custom playfile.) */
603};
@ AST_BRIDGE_CHANNEL_CB_OPTION_MEDIA

◆ bridge_channel_state

State information about a bridged channel.

Enumerator
BRIDGE_CHANNEL_STATE_WAIT 

Waiting for a signal (Channel in the bridge)

BRIDGE_CHANNEL_STATE_END 

Bridged channel was forced out and should be hung up (Bridge may dissolve.)

BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE 

Bridged channel was forced out. Don't dissolve the bridge regardless

Definition at line 60 of file bridge_channel.h.

60 {
61 /*! Waiting for a signal (Channel in the bridge) */
63 /*! Bridged channel was forced out and should be hung up (Bridge may dissolve.) */
65 /*! Bridged channel was forced out. Don't dissolve the bridge regardless */
67};
@ BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE
@ BRIDGE_CHANNEL_STATE_WAIT
@ BRIDGE_CHANNEL_STATE_END

◆ bridge_channel_thread_state

Enumerator
BRIDGE_CHANNEL_THREAD_IDLE 

Bridge channel thread is idle/waiting.

BRIDGE_CHANNEL_THREAD_SIMPLE 

Bridge channel thread is writing a normal/simple frame.

BRIDGE_CHANNEL_THREAD_FRAME 

Bridge channel thread is processing a frame.

Definition at line 69 of file bridge_channel.h.

69 {
70 /*! Bridge channel thread is idle/waiting. */
72 /*! Bridge channel thread is writing a normal/simple frame. */
74 /*! Bridge channel thread is processing a frame. */
76};
@ BRIDGE_CHANNEL_THREAD_FRAME
@ BRIDGE_CHANNEL_THREAD_SIMPLE
@ BRIDGE_CHANNEL_THREAD_IDLE

Function Documentation

◆ _ast_bridge_channel_lock()

static void _ast_bridge_channel_lock ( struct ast_bridge_channel bridge_channel,
const char *  file,
const char *  function,
int  line,
const char *  var 
)
inlinestatic

Definition at line 230 of file bridge_channel.h.

231{
232 __ao2_lock(bridge_channel, AO2_LOCK_REQ_MUTEX, file, function, line, var);
233}
#define var
Definition: ast_expr2f.c:605
@ AO2_LOCK_REQ_MUTEX
Definition: astobj2.h:702
int __ao2_lock(void *a, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var)
Lock an object.
Definition: astobj2.c:222

References __ao2_lock(), AO2_LOCK_REQ_MUTEX, ast_channel::bridge_channel, make_ari_stubs::file, and var.

◆ _ast_bridge_channel_trylock()

static int _ast_bridge_channel_trylock ( struct ast_bridge_channel bridge_channel,
const char *  file,
const char *  function,
int  line,
const char *  var 
)
inlinestatic

Definition at line 219 of file bridge_channel.h.

220{
221 return __ao2_trylock(bridge_channel, AO2_LOCK_REQ_MUTEX, file, function, line, var);
222}
int __ao2_trylock(void *a, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var)
Try locking– (don't block if fail)
Definition: astobj2.c:342

References __ao2_trylock(), AO2_LOCK_REQ_MUTEX, ast_channel::bridge_channel, make_ari_stubs::file, and var.

◆ _ast_bridge_channel_unlock()

static void _ast_bridge_channel_unlock ( struct ast_bridge_channel bridge_channel,
const char *  file,
const char *  function,
int  line,
const char *  var 
)
inlinestatic

Definition at line 241 of file bridge_channel.h.

242{
243 __ao2_unlock(bridge_channel, file, function, line, var);
244}
int __ao2_unlock(void *a, const char *file, const char *func, int line, const char *var)
Unlock an object.
Definition: astobj2.c:288

References __ao2_unlock(), ast_channel::bridge_channel, make_ari_stubs::file, and var.

◆ ast_bridge_channel_feature_digit()

void ast_bridge_channel_feature_digit ( struct ast_bridge_channel bridge_channel,
int  digit 
)

Add a DTMF digit to the collected digits to match against DTMF features.

Since
12.8.0
Parameters
bridge_channelChannel that received a DTMF digit.
digitDTMF digit to add to collected digits or 0 for timeout event.
Note
Neither the bridge nor the bridge_channel locks should be held when entering this function.
This is intended to be called by bridge hooks and the bridge channel thread.
This is intended to be called by non-DTMF bridge hooks and the bridge channel thread. Calling from a DTMF bridge hook can potentially cause unbounded recursion.

Definition at line 1695 of file bridge_channel.c.

1696{
1697 struct ast_bridge_features *features = bridge_channel->features;
1698 struct ast_bridge_hook_dtmf *hook = NULL;
1699 size_t dtmf_len;
1700
1701 struct sanity_check_of_dtmf_size {
1702 char check[1 / (ARRAY_LEN(bridge_channel->dtmf_hook_state.collected) == ARRAY_LEN(hook->dtmf.code))];
1703 };
1704
1705 dtmf_len = strlen(bridge_channel->dtmf_hook_state.collected);
1706 if (!dtmf_len && !digit) {
1707 /* Nothing to do */
1708 return;
1709 }
1710
1711 if (digit) {
1712 dtmf_len = bridge_channel_feature_digit_add(bridge_channel, digit, dtmf_len);
1713 }
1714
1715 while (digit) {
1716 /* See if a DTMF feature hook matches or can match */
1717 hook = ao2_find(features->dtmf_hooks, bridge_channel->dtmf_hook_state.collected,
1719 if (!hook) {
1720 ast_debug(1, "No DTMF feature hooks on %p(%s) match '%s'\n",
1721 bridge_channel, ast_channel_name(bridge_channel->chan),
1722 bridge_channel->dtmf_hook_state.collected);
1723 break;
1724 } else if (dtmf_len != strlen(hook->dtmf.code)) {
1725 unsigned int digit_timeout;
1726 /* Need more digits to match */
1727 ao2_ref(hook, -1);
1728 digit_timeout = bridge_channel_feature_digit_timeout(bridge_channel);
1729 bridge_channel->dtmf_hook_state.interdigit_timeout =
1730 ast_tvadd(ast_tvnow(), ast_samp2tv(digit_timeout, 1000));
1731 return;
1732 } else {
1733 int remove_me;
1734 int already_suspended;
1735
1736 ast_debug(1, "DTMF feature hook %p matched DTMF string '%s' on %p(%s)\n",
1737 hook, bridge_channel->dtmf_hook_state.collected, bridge_channel,
1738 ast_channel_name(bridge_channel->chan));
1739
1740 /*
1741 * Clear the collected digits before executing the hook
1742 * in case the hook starts another sequence.
1743 */
1744 bridge_channel->dtmf_hook_state.collected[0] = '\0';
1745
1746 ast_bridge_channel_lock_bridge(bridge_channel);
1747 already_suspended = bridge_channel->suspended;
1748 if (!already_suspended) {
1750 }
1751 ast_bridge_unlock(bridge_channel->bridge);
1752 ast_indicate(bridge_channel->chan, AST_CONTROL_SRCUPDATE);
1753
1754 /* Execute the matched hook on this channel. */
1755 remove_me = hook->generic.callback(bridge_channel, hook->generic.hook_pvt);
1756 if (remove_me) {
1757 ast_debug(1, "DTMF hook %p is being removed from %p(%s)\n",
1758 hook, bridge_channel, ast_channel_name(bridge_channel->chan));
1759 ao2_unlink(features->dtmf_hooks, hook);
1760 }
1761 testsuite_notify_feature_success(bridge_channel->chan, hook->dtmf.code);
1762 ao2_ref(hook, -1);
1763
1764 ast_indicate(bridge_channel->chan, AST_CONTROL_SRCUPDATE);
1765 if (!already_suspended) {
1766 bridge_channel_unsuspend(bridge_channel);
1767 }
1768
1769 /*
1770 * If we are handing the channel off to an external hook for
1771 * ownership, we are not guaranteed what kind of state it will
1772 * come back in. If the channel hungup, we need to detect that
1773 * here if the hook did not already change the state.
1774 */
1775 if (bridge_channel->chan && ast_check_hangup_locked(bridge_channel->chan)) {
1776 ast_bridge_channel_kick(bridge_channel, 0);
1777 bridge_channel->dtmf_hook_state.collected[0] = '\0';
1778 return;
1779 }
1780
1781 /* if there is dtmf that has been collected then loop back through,
1782 but set digit to -1 so it doesn't try to do an add since the dtmf
1783 is already in the buffer */
1784 dtmf_len = strlen(bridge_channel->dtmf_hook_state.collected);
1785 if (!dtmf_len) {
1786 return;
1787 }
1788 }
1789 }
1790
1791 if (!digit) {
1792 ast_debug(1, "DTMF feature string collection on %p(%s) timed out\n",
1793 bridge_channel, ast_channel_name(bridge_channel->chan));
1794 }
1795
1796 /* Timeout or DTMF digit didn't allow a match with any hooks. */
1797 if (features->dtmf_passthrough) {
1798 /* Stream the collected DTMF to the other channels. */
1799 bridge_channel_write_dtmf_stream(bridge_channel,
1800 bridge_channel->dtmf_hook_state.collected);
1801 }
1802 bridge_channel->dtmf_hook_state.collected[0] = '\0';
1803
1804 ast_test_suite_event_notify("FEATURE_DETECTION", "Result: fail");
1805}
char digit
#define ao2_unlink(container, obj)
Remove an object from a container.
Definition: astobj2.h:1578
#define ao2_find(container, arg, flags)
Definition: astobj2.h:1736
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:459
@ OBJ_SEARCH_PARTIAL_KEY
The arg parameter is a partial search key similar to OBJ_SEARCH_KEY.
Definition: astobj2.h:1116
#define ast_bridge_unlock(bridge)
Unlock the bridge.
Definition: bridge.h:481
static void testsuite_notify_feature_success(struct ast_channel *chan, const char *dtmf)
void bridge_channel_internal_suspend_nolock(struct ast_bridge_channel *bridge_channel)
void ast_bridge_channel_lock_bridge(struct ast_bridge_channel *bridge_channel)
Lock the bridge associated with the bridge channel.
void ast_bridge_channel_kick(struct ast_bridge_channel *bridge_channel, int cause)
Kick the channel out of the bridge.
static void bridge_channel_unsuspend(struct ast_bridge_channel *bridge_channel)
static int bridge_channel_write_dtmf_stream(struct ast_bridge_channel *bridge_channel, const char *dtmf)
static unsigned int bridge_channel_feature_digit_timeout(struct ast_bridge_channel *bridge_channel)
static int bridge_channel_feature_digit_add(struct ast_bridge_channel *bridge_channel, int digit, size_t dtmf_len)
const char * ast_channel_name(const struct ast_channel *chan)
int ast_check_hangup_locked(struct ast_channel *chan)
Definition: channel.c:459
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
Definition: channel.c:4296
@ AST_CONTROL_SRCUPDATE
#define ast_debug(level,...)
Log a DEBUG message.
#define NULL
Definition: resample.c:96
unsigned int suspended
struct ast_bridge_channel::@195 dtmf_hook_state
struct ast_bridge * bridge
Bridge this channel is participating in.
struct timeval interdigit_timeout
char collected[MAXIMUM_DTMF_FEATURE_STRING]
struct ast_bridge_features * features
struct ast_channel * chan
Structure that contains features information.
struct ao2_container * dtmf_hooks
unsigned int dtmf_passthrough
char code[MAXIMUM_DTMF_FEATURE_STRING]
struct ast_bridge_hook generic
struct ast_bridge_hook_dtmf_parms dtmf
ast_bridge_hook_callback callback
#define ast_test_suite_event_notify(s, f,...)
Definition: test.h:189
struct timeval ast_samp2tv(unsigned int _nsamp, unsigned int _rate)
Returns a timeval corresponding to the duration of n samples at rate r. Useful to convert samples to ...
Definition: time.h:282
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
Definition: extconf.c:2282
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Definition: time.h:159
#define ARRAY_LEN(a)
Definition: utils.h:666

References ao2_find, ao2_ref, ao2_unlink, ARRAY_LEN, ast_bridge_channel_kick(), ast_bridge_channel_lock_bridge(), ast_bridge_unlock, ast_channel_name(), ast_check_hangup_locked(), AST_CONTROL_SRCUPDATE, ast_debug, ast_indicate(), ast_samp2tv(), ast_test_suite_event_notify, ast_tvadd(), ast_tvnow(), ast_bridge_channel::bridge, bridge_channel_feature_digit_add(), bridge_channel_feature_digit_timeout(), bridge_channel_internal_suspend_nolock(), bridge_channel_unsuspend(), bridge_channel_write_dtmf_stream(), ast_bridge_hook::callback, ast_bridge_channel::chan, ast_bridge_hook_dtmf_parms::code, ast_bridge_channel::collected, digit, ast_bridge_hook_dtmf::dtmf, ast_bridge_channel::dtmf_hook_state, ast_bridge_features::dtmf_hooks, ast_bridge_features::dtmf_passthrough, ast_bridge_channel::features, ast_bridge_hook_dtmf::generic, ast_bridge_hook::hook_pvt, ast_bridge_channel::interdigit_timeout, NULL, OBJ_SEARCH_PARTIAL_KEY, ast_bridge_channel::suspended, and testsuite_notify_feature_success().

Referenced by agent_alert(), bridge_channel_handle_feature_timeout(), bridge_channel_internal_join(), and bridge_handle_dtmf().

◆ ast_bridge_channel_feature_digit_add()

void ast_bridge_channel_feature_digit_add ( struct ast_bridge_channel bridge_channel,
int  digit 
)

Add a DTMF digit to the collected digits.

Since
13.3.0
Parameters
bridge_channelChannel that received a DTMF digit.
digitDTMF digit to add to collected digits
Note
Neither the bridge nor the bridge_channel locks should be held when entering this function.
This is can only be called from within DTMF bridge hooks.

Definition at line 1687 of file bridge_channel.c.

1688{
1689 if (digit) {
1691 bridge_channel, digit, strlen(bridge_channel->dtmf_hook_state.collected));
1692 }
1693}

References bridge_channel_feature_digit_add(), ast_bridge_channel::collected, digit, and ast_bridge_channel::dtmf_hook_state.

Referenced by play_file().

◆ ast_bridge_channel_get_chan()

struct ast_channel * ast_bridge_channel_get_chan ( struct ast_bridge_channel bridge_channel)

Get a ref to the bridge_channel's ast_channel.

Parameters
bridge_channelThe bridge channel
Note
The returned channel NEEDS to be unref'd once you are done with it. In general, this function is best used when accessing the bridge_channel chan from outside of a bridging thread.
Return values
ref'dast_channel on success
NULLotherwise

Definition at line 212 of file bridge_channel.c.

213{
214 struct ast_channel *chan;
215
219
220 return chan;
221}
#define ao2_unlock(a)
Definition: astobj2.h:729
#define ao2_lock(a)
Definition: astobj2.h:717
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
Definition: astobj2.h:480
Main Channel structure associated with a channel.
struct ast_bridge_channel * bridge_channel

References ao2_bump, ao2_lock, ao2_unlock, ast_channel::bridge_channel, and ast_bridge_channel::chan.

Referenced by ast_bridge_channel_write_unhold().

◆ ast_bridge_channel_kick()

void ast_bridge_channel_kick ( struct ast_bridge_channel bridge_channel,
int  cause 
)

Kick the channel out of the bridge.

Since
12.0.0
Parameters
bridge_channelWhich channel is being kicked or hungup.
causeCause of channel being kicked. If cause <= 0 then use cause on channel if cause still <= 0 use AST_CAUSE_NORMAL_CLEARING.
Note
This is intended to be called by bridge hooks and the bridge channel thread.

Definition at line 592 of file bridge_channel.c.

593{
594 struct ast_bridge_features *features = bridge_channel->features;
595 struct ast_bridge_hook *hook;
596 struct ao2_iterator iter;
597
598 ast_bridge_channel_lock(bridge_channel);
599 if (bridge_channel->state == BRIDGE_CHANNEL_STATE_WAIT) {
600 channel_set_cause(bridge_channel->chan, cause);
601 cause = 0;
602 }
603 ast_bridge_channel_unlock(bridge_channel);
604
605 /* Run any hangup hooks. */
606 iter = ao2_iterator_init(features->other_hooks, 0);
607 for (; (hook = ao2_iterator_next(&iter)); ao2_ref(hook, -1)) {
608 int remove_me;
609
610 if (hook->type != AST_BRIDGE_HOOK_TYPE_HANGUP) {
611 continue;
612 }
613 remove_me = hook->callback(bridge_channel, hook->hook_pvt);
614 if (remove_me) {
615 ast_debug(1, "Hangup hook %p is being removed from %p(%s)\n",
616 hook, bridge_channel, ast_channel_name(bridge_channel->chan));
617 ao2_unlink(features->other_hooks, hook);
618 }
619 }
621
622 /* Default hangup action. */
624}
#define ao2_iterator_next(iter)
Definition: astobj2.h:1911
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
static int channel_set_cause(struct ast_channel *chan, int cause)
void ast_bridge_channel_leave_bridge(struct ast_bridge_channel *bridge_channel, enum bridge_channel_state new_state, int cause)
Set bridge channel state to leave bridge (if not leaving already).
#define ast_bridge_channel_unlock(bridge_channel)
Unlock the bridge_channel.
#define ast_bridge_channel_lock(bridge_channel)
Lock the bridge_channel.
@ AST_BRIDGE_HOOK_TYPE_HANGUP
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Definition: astobj2.h:1821
enum bridge_channel_state state
struct ao2_container * other_hooks
Structure that is the essence of a feature hook.
enum ast_bridge_hook_type type

References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ao2_unlink, ast_bridge_channel_leave_bridge(), ast_bridge_channel_lock, ast_bridge_channel_unlock, AST_BRIDGE_HOOK_TYPE_HANGUP, ast_channel_name(), ast_debug, BRIDGE_CHANNEL_STATE_END, BRIDGE_CHANNEL_STATE_WAIT, ast_bridge_hook::callback, ast_bridge_channel::chan, channel_set_cause(), ast_bridge_channel::features, ast_bridge_hook::hook_pvt, ast_bridge_features::other_hooks, ast_bridge_channel::state, and ast_bridge_hook::type.

Referenced by ast_bridge_channel_feature_digit(), ast_bridge_channel_run_app(), bridge_channel_attended_transfer(), bridge_channel_blind_transfer(), bridge_channel_handle_action(), bridge_channel_internal_join(), bridge_handle_trip(), and kick_it().

◆ ast_bridge_channel_leave_bridge()

void ast_bridge_channel_leave_bridge ( struct ast_bridge_channel bridge_channel,
enum bridge_channel_state  new_state,
int  cause 
)

Set bridge channel state to leave bridge (if not leaving already).

Parameters
bridge_channelChannel to change the state on
new_stateThe new state to place the channel into
causeCause of channel leaving bridge. If cause <= 0 then use cause on channel if cause still <= 0 use AST_CAUSE_NORMAL_CLEARING.

Example usage:

void ast_bridge_channel_leave_bridge(struct ast_bridge_channel *bridge_channel, enum bridge_channel_state new_state, int cause)
Set bridge channel state to leave bridge (if not leaving already).
#define AST_CAUSE_NORMAL_CLEARING
Definition: causes.h:106

This places the channel pointed to by bridge_channel into the state BRIDGE_CHANNEL_STATE_END if it was BRIDGE_CHANNEL_STATE_WAIT before.

Definition at line 315 of file bridge_channel.c.

316{
317 ast_bridge_channel_lock(bridge_channel);
318 ast_bridge_channel_leave_bridge_nolock(bridge_channel, new_state, cause);
319 ast_bridge_channel_unlock(bridge_channel);
320}
void ast_bridge_channel_leave_bridge_nolock(struct ast_bridge_channel *bridge_channel, enum bridge_channel_state new_state, int cause)
Set bridge channel state to leave bridge (if not leaving already).

References ast_bridge_channel_leave_bridge_nolock(), ast_bridge_channel_lock, and ast_bridge_channel_unlock.

Referenced by agent_connect_caller(), ast_bridge_channel_kick(), ast_bridge_depart(), ast_bridge_remove(), basic_hangup_hook(), bridge_agent_hold_heartbeat(), bridge_agent_hold_push(), bridge_channel_complete_join(), bridge_channel_dissolve_check(), bridge_channel_internal_push_full(), bridge_dissolve(), bridge_do_merge(), bridge_do_move(), bridge_features_duration_callback(), bridge_swap_attended_transfer(), bridgewait_timeout_callback(), caller_joined_bridge(), caller_safety_timeout(), feature_hangup(), parking_duration_callback(), say_parking_space(), set_softmix_bridge_data(), try_swap_optimize_out(), and user_timeout().

◆ ast_bridge_channel_leave_bridge_nolock()

void ast_bridge_channel_leave_bridge_nolock ( struct ast_bridge_channel bridge_channel,
enum bridge_channel_state  new_state,
int  cause 
)

Set bridge channel state to leave bridge (if not leaving already).

Parameters
bridge_channelChannel to change the state on
new_stateThe new state to place the channel into
causeCause of channel leaving bridge. If cause <= 0 then use cause on channel if cause still <= 0 use AST_CAUSE_NORMAL_CLEARING.

Example usage:

This places the channel pointed to by bridge_channel into the state BRIDGE_CHANNEL_STATE_END if it was BRIDGE_CHANNEL_STATE_WAIT before.

Definition at line 293 of file bridge_channel.c.

294{
295 if (bridge_channel->state != BRIDGE_CHANNEL_STATE_WAIT) {
296 return;
297 }
298
299 ast_debug(1, "Setting %p(%s) state from:%u to:%u\n",
300 bridge_channel, ast_channel_name(bridge_channel->chan), bridge_channel->state,
301 new_state);
302
303 channel_set_cause(bridge_channel->chan, cause);
304
305 ast_channel_lock(bridge_channel->chan);
306 ast_bridge_vars_set(bridge_channel->chan, NULL, NULL);
307 ast_channel_unlock(bridge_channel->chan);
308
309 /* Change the state on the bridge channel */
310 bridge_channel->state = new_state;
311
312 bridge_channel_poke(bridge_channel);
313}
void ast_bridge_vars_set(struct ast_channel *chan, const char *name, const char *pvtid)
Sets BRIDGECHANNEL and BRIDGEPVTCALLID for a channel.
Definition: bridge.c:1212
static void bridge_channel_poke(struct ast_bridge_channel *bridge_channel)
#define ast_channel_lock(chan)
Definition: channel.h:2968
#define ast_channel_unlock(chan)
Definition: channel.h:2969

References ast_bridge_vars_set(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_debug, bridge_channel_poke(), BRIDGE_CHANNEL_STATE_WAIT, ast_bridge_channel::chan, channel_set_cause(), NULL, and ast_bridge_channel::state.

Referenced by ast_bridge_channel_leave_bridge(), bridge_do_merge(), and caller_abort_agent().

◆ ast_bridge_channel_lock_bridge()

void ast_bridge_channel_lock_bridge ( struct ast_bridge_channel bridge_channel)

Lock the bridge associated with the bridge channel.

Since
12.0.0
Parameters
bridge_channelChannel that wants to lock the bridge.

This is an upstream lock operation. The defined locking order is bridge then bridge_channel.

Note
On entry, neither the bridge nor bridge_channel is locked.
The bridge_channel->bridge pointer changes because of a bridge-merge/channel-move operation between bridges.

Definition at line 223 of file bridge_channel.c.

224{
225 struct ast_bridge *bridge;
226
227 for (;;) {
228 /* Safely get the bridge pointer */
229 ast_bridge_channel_lock(bridge_channel);
230 bridge = bridge_channel->bridge;
231 ao2_ref(bridge, +1);
232 ast_bridge_channel_unlock(bridge_channel);
233
234 /* Lock the bridge and see if it is still the bridge we need to lock. */
235 ast_bridge_lock(bridge);
236 if (bridge == bridge_channel->bridge) {
237 ao2_ref(bridge, -1);
238 return;
239 }
240 ast_bridge_unlock(bridge);
241 ao2_ref(bridge, -1);
242 }
243}
#define ast_bridge_lock(bridge)
Lock the bridge.
Definition: bridge.h:470
Structure that contains information about a bridge.
Definition: bridge.h:349

References ao2_ref, ast_bridge_channel_lock, ast_bridge_channel_unlock, ast_bridge_lock, ast_bridge_unlock, and ast_bridge_channel::bridge.

Referenced by action_toggle_binaural(), agent_alert(), ast_bridge_channel_feature_digit(), ast_bridge_channel_merge_inhibit(), ast_bridge_notify_masquerade(), basic_hangup_hook(), bridge_channel_handle_control(), bridge_channel_internal_join(), bridge_channel_suspend(), bridge_channel_unsuspend(), bridge_channel_wait(), bridge_channel_write_frame(), bridge_handle_trip(), check_binaural_position_change(), deferred_action(), feature_automixmonitor(), and parking_blind_transfer_park().

◆ ast_bridge_channel_merge_inhibit()

struct ast_bridge * ast_bridge_channel_merge_inhibit ( struct ast_bridge_channel bridge_channel,
int  request 
)

Adjust the bridge_channel's bridge merge inhibit request count.

Since
12.0.0
Parameters
bridge_channelWhat to operate on.
requestInhibit request increment. (Positive to add requests. Negative to remove requests.)
Note
This API call is meant for internal bridging operations.
Return values
bridgeadjusted merge inhibit with reference count.

Definition at line 370 of file bridge_channel.c.

371{
372 struct ast_bridge *bridge;
373
374 ast_bridge_channel_lock_bridge(bridge_channel);
375 bridge = bridge_channel->bridge;
376 ao2_ref(bridge, +1);
378 ast_bridge_unlock(bridge);
379 return bridge;
380}
void bridge_merge_inhibit_nolock(struct ast_bridge *bridge, int request)
Definition: bridge.c:2991
static int request(void *obj)
Definition: chan_pjsip.c:2604

References ao2_ref, ast_bridge_channel_lock_bridge(), ast_bridge_unlock, ast_bridge_channel::bridge, bridge_merge_inhibit_nolock(), and request().

Referenced by feature_attended_transfer().

◆ ast_bridge_channel_notify_talking()

int ast_bridge_channel_notify_talking ( struct ast_bridge_channel bridge_channel,
int  started_talking 
)

Lets the bridging indicate when a bridge channel has stopped or started talking.

Note
All DSP functionality on the bridge has been pushed down to the lowest possible layer, which in this case is the specific bridging technology being used. Since it is necessary for the knowledge of which channels are talking to make its way up to the application, this function has been created to allow the bridging technology to communicate that information with the bridging core.
Parameters
bridge_channelThe bridge channel that has either started or stopped talking.
started_talkingset to 1 when this indicates the channel has started talking set to 0 when this indicates the channel has stopped talking.
Return values
0on success.
-1on error.

Definition at line 245 of file bridge_channel.c.

246{
247 struct ast_frame action = {
249 .subclass.integer = started_talking
251 };
252
253 return ast_bridge_channel_queue_frame(bridge_channel, &action);
254}
int ast_bridge_channel_queue_frame(struct ast_bridge_channel *bridge_channel, struct ast_frame *fr)
Write a frame to the specified bridge_channel.
@ BRIDGE_CHANNEL_ACTION_TALKING_STOP
@ BRIDGE_CHANNEL_ACTION_TALKING_START
@ AST_FRAME_BRIDGE_ACTION
Data structure associated with a single frame of data.
enum ast_frame_type frametype

References ast_bridge_channel_queue_frame(), AST_FRAME_BRIDGE_ACTION, BRIDGE_CHANNEL_ACTION_TALKING_START, BRIDGE_CHANNEL_ACTION_TALKING_STOP, and ast_frame::frametype.

Referenced by clear_talking(), and softmix_bridge_write_voice().

◆ ast_bridge_channel_peer()

struct ast_bridge_channel * ast_bridge_channel_peer ( struct ast_bridge_channel bridge_channel)

Get the peer bridge channel of a two party bridge.

Since
12.0.0
Parameters
bridge_channelWhat to get the peer of.
Note
On entry, bridge_channel->bridge is already locked.
This is an internal bridge function.
Return values
peeron success.
NULLno peer channel.

Definition at line 322 of file bridge_channel.c.

323{
324 struct ast_bridge *bridge = bridge_channel->bridge;
325 struct ast_bridge_channel *other = NULL;
326
327 if (bridge_channel->in_bridge && bridge->num_channels == 2) {
329 if (other != bridge_channel) {
330 break;
331 }
332 }
333 }
334
335 return other;
336}
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:491
Structure that contains information regarding a channel in a bridge.
unsigned int in_bridge
struct ast_bridge_channels_list channels
Definition: bridge.h:363
unsigned int num_channels
Definition: bridge.h:373
Definition: search.h:40

References AST_LIST_TRAVERSE, ast_bridge_channel::bridge, ast_bridge::channels, ast_bridge_channel::in_bridge, NULL, and ast_bridge::num_channels.

Referenced by bridge_reconfigured_connected_line_update(), bridge_swap_attended_transfer(), parking_blind_transfer_park(), and try_swap_optimize_out().

◆ ast_bridge_channel_playfile()

void ast_bridge_channel_playfile ( struct ast_bridge_channel bridge_channel,
ast_bridge_custom_play_fn  custom_play,
const char *  playfile,
const char *  moh_class 
)

Play a file on the bridge channel.

Since
12.0.0
Parameters
bridge_channelWhich channel to play the file on
custom_playCall this function to play the playfile. (NULL if normal sound file to play)
playfileSound filename to play.
moh_classMOH class to request bridge peers to hear while file is played. NULL if no MOH. Empty if default MOH class.
Note
This is intended to be called by bridge hooks.

Definition at line 1262 of file bridge_channel.c.

1263{
1264 if (moh_class) {
1265 ast_bridge_channel_write_hold(bridge_channel, moh_class);
1266 }
1267 if (custom_play) {
1268 custom_play(bridge_channel, playfile);
1269 } else {
1270 ast_stream_and_wait(bridge_channel->chan, playfile, AST_DIGIT_NONE);
1271 }
1272 if (moh_class) {
1273 ast_bridge_channel_write_unhold(bridge_channel);
1274 }
1275
1276 /*
1277 * It may be necessary to resume music on hold after we finish
1278 * playing the announcment.
1279 */
1280 if (ast_test_flag(ast_channel_flags(bridge_channel->chan), AST_FLAG_MOH)) {
1281 const char *latest_musicclass;
1282
1283 ast_channel_lock(bridge_channel->chan);
1284 latest_musicclass = ast_strdupa(ast_channel_latest_musicclass(bridge_channel->chan));
1285 ast_channel_unlock(bridge_channel->chan);
1286 ast_moh_start(bridge_channel->chan, latest_musicclass, NULL);
1287 }
1288}
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:298
int ast_bridge_channel_write_unhold(struct ast_bridge_channel *bridge_channel)
Write an unhold frame into the bridge.
int ast_bridge_channel_write_hold(struct ast_bridge_channel *bridge_channel, const char *moh_class)
Write a hold frame into the bridge.
const char * ast_channel_latest_musicclass(const struct ast_channel *chan)
struct ast_flags * ast_channel_flags(struct ast_channel *chan)
@ AST_FLAG_MOH
Definition: channel.h:1011
int ast_stream_and_wait(struct ast_channel *chan, const char *file, const char *digits)
stream file until digit If the file name is non-empty, try to play it.
Definition: file.c:1878
#define AST_DIGIT_NONE
Definition: file.h:47
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
Definition: channel.c:7788
#define ast_test_flag(p, flag)
Definition: utils.h:63

References ast_bridge_channel_write_hold(), ast_bridge_channel_write_unhold(), ast_channel_flags(), ast_channel_latest_musicclass(), ast_channel_lock, ast_channel_unlock, AST_DIGIT_NONE, AST_FLAG_MOH, ast_moh_start(), ast_strdupa, ast_stream_and_wait(), ast_test_flag, ast_bridge_channel::chan, and NULL.

Referenced by bridge_channel_playfile().

◆ ast_bridge_channel_queue_app()

int ast_bridge_channel_queue_app ( struct ast_bridge_channel bridge_channel,
const char *  app_name,
const char *  app_args,
const char *  moh_class 
)

Queue a bridge action run application frame onto the bridge channel.

Since
12.0.0
Parameters
bridge_channelWhich channel to put the frame onto
app_nameDialplan application name.
app_argsArguments for the application. (NULL or empty for no arguments)
moh_classMOH class to request bridge peers to hear while application is running. NULL if no MOH. Empty if default MOH class.
Note
This is intended to be called by bridge hooks.
Return values
0on success.
-1on error.

Definition at line 1256 of file bridge_channel.c.

1257{
1259 bridge_channel, app_name, app_args, moh_class);
1260}
static int bridge_channel_queue_action_data(struct ast_bridge_channel *bridge_channel, enum bridge_channel_action_type action, const void *data, size_t datalen)
static int payload_helper_app(ast_bridge_channel_post_action_data post_it, struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class)
const char * app_name(struct ast_app *app)
Definition: pbx_app.c:463

References app_name(), bridge_channel_queue_action_data(), and payload_helper_app().

◆ ast_bridge_channel_queue_callback()

int ast_bridge_channel_queue_callback ( struct ast_bridge_channel bridge_channel,
enum ast_bridge_channel_custom_callback_option  flags,
ast_bridge_custom_callback_fn  callback,
const void *  payload,
size_t  payload_size 
)

Queue a bridge action custom callback frame onto the bridge channel.

Since
12.0.0
Parameters
bridge_channelWhich channel to put the frame onto.
flagsCustom callback option flags.
callbackCustom callback run on a bridge channel.
payloadData to pass to the callback. (NULL if none).
payload_sizeSize of the payload if payload is non-NULL. A number otherwise.
Note
The payload MUST NOT have any resources that need to be freed.
This is intended to be called by bridge hooks.
Return values
0on success.
-1on error.

Definition at line 1429 of file bridge_channel.c.

1432{
1434 bridge_channel, flags, callback, payload, payload_size);
1435}
static int payload_helper_cb(ast_bridge_channel_post_action_data post_it, struct ast_bridge_channel *bridge_channel, enum ast_bridge_channel_custom_callback_option flags, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size)

References bridge_channel_queue_action_data(), bridge_custom_callback::callback, bridge_custom_callback::flags, bridge_custom_callback::payload, payload_helper_cb(), and bridge_custom_callback::payload_size.

Referenced by ast_bridge_kick(), defer_action(), handle_bridge_kick_channel(), and send_alert_to_agent().

◆ ast_bridge_channel_queue_control_data()

int ast_bridge_channel_queue_control_data ( struct ast_bridge_channel bridge_channel,
enum ast_control_frame_type  control,
const void *  data,
size_t  datalen 
)

Queue a control frame onto the bridge channel with data.

Since
12.0.0
Parameters
bridge_channelWhich channel to queue the frame onto.
controlType of control frame.
dataFrame payload data to pass.
datalenFrame payload data length to pass.
Return values
0on success.
-1on error.

Definition at line 1104 of file bridge_channel.c.

1105{
1106 struct ast_frame frame = {
1108 .subclass.integer = control,
1109 .datalen = datalen,
1110 .data.ptr = (void *) data,
1111 };
1112
1113 return ast_bridge_channel_queue_frame(bridge_channel, &frame);
1114}
@ AST_FRAME_CONTROL
union ast_frame::@226 data

References ast_bridge_channel_queue_frame(), AST_FRAME_CONTROL, ast_frame::data, ast_frame::datalen, and ast_frame::frametype.

Referenced by bridge_reconfigured_connected_line_update(), and send_colp_to_agent().

◆ ast_bridge_channel_queue_frame()

int ast_bridge_channel_queue_frame ( struct ast_bridge_channel bridge_channel,
struct ast_frame fr 
)

Write a frame to the specified bridge_channel.

Since
12.0.0
Parameters
bridge_channelChannel to queue the frame.
frFrame to write.
Return values
0on success.
-1on error.

Definition at line 1005 of file bridge_channel.c.

1006{
1007 struct ast_frame *dup;
1008
1009 if (bridge_channel->suspended
1010 /* Also defer DTMF frames. */
1013 && !ast_is_deferrable_frame(fr)) {
1014 /* Drop non-deferable frames when suspended. */
1015 return 0;
1016 }
1017 if (fr->frametype == AST_FRAME_NULL) {
1018 /* "Accept" the frame and discard it. */
1019 return 0;
1020 }
1021
1022 if ((fr->frametype == AST_FRAME_VOICE || fr->frametype == AST_FRAME_VIDEO ||
1024 fr->frametype == AST_FRAME_RTCP) && fr->stream_num > -1) {
1025 int num = -1;
1026
1027 ast_bridge_channel_lock(bridge_channel);
1028 if (fr->stream_num < (int)AST_VECTOR_SIZE(&bridge_channel->stream_map.to_channel)) {
1029 num = AST_VECTOR_GET(&bridge_channel->stream_map.to_channel, fr->stream_num);
1030 }
1031 ast_bridge_channel_unlock(bridge_channel);
1032
1033 if (num == -1) {
1034 /* We don't have a mapped stream so just discard this frame. */
1035 return 0;
1036 }
1037 }
1038
1039 dup = ast_frdup(fr);
1040 if (!dup) {
1041 return -1;
1042 }
1043
1044 ast_bridge_channel_lock(bridge_channel);
1045 if (bridge_channel->state != BRIDGE_CHANNEL_STATE_WAIT) {
1046 /* Drop frames on channels leaving the bridge. */
1047 ast_bridge_channel_unlock(bridge_channel);
1048 bridge_frame_free(dup);
1049 return 0;
1050 }
1051
1052 if ((fr->frametype == AST_FRAME_TEXT || fr->frametype == AST_FRAME_TEXT_DATA) &&
1053 !bridge_channel->features->text_messaging) {
1054 /* This channel is not accepting text messages. */
1055 ast_bridge_channel_unlock(bridge_channel);
1056 bridge_frame_free(dup);
1057 return 0;
1058 }
1059
1060 if (DEBUG_ATLEAST(1)) {
1061 if (fr->frametype == AST_FRAME_TEXT) {
1062 ast_log(LOG_DEBUG, "Queuing TEXT frame to '%s': %*.s\n", ast_channel_name(bridge_channel->chan),
1063 fr->datalen, (char *)fr->data.ptr);
1064 } else if (fr->frametype == AST_FRAME_TEXT_DATA) {
1065 struct ast_msg_data *msg = fr->data.ptr;
1066 ast_log(LOG_DEBUG, "Queueing TEXT_DATA frame from '%s' to '%s:%s': %s\n",
1069 ast_channel_name(bridge_channel->chan),
1071 }
1072 }
1073
1074 AST_LIST_INSERT_TAIL(&bridge_channel->wr_queue, dup, frame_list);
1075 if (ast_alertpipe_write(bridge_channel->alert_pipe)) {
1076 ast_log(LOG_ERROR, "We couldn't write alert pipe for %p(%s)... something is VERY wrong\n",
1077 bridge_channel, ast_channel_name(bridge_channel->chan));
1078 }
1079 ast_bridge_channel_unlock(bridge_channel);
1080 return 0;
1081}
ssize_t ast_alertpipe_write(int alert_pipe[2])
Write an event to an alert pipe.
Definition: alertpipe.c:120
#define ast_log
Definition: astobj2.c:42
static void bridge_frame_free(struct ast_frame *frame)
int ast_is_deferrable_frame(const struct ast_frame *frame)
Should we keep this frame for later?
Definition: channel.c:1486
const char * ast_msg_data_get_attribute(struct ast_msg_data *msg, enum ast_msg_data_attribute_type attribute_type)
Get attribute from ast_msg_data.
@ AST_MSG_DATA_ATTR_BODY
Definition: message.h:458
@ AST_MSG_DATA_ATTR_TO
Definition: message.h:455
@ AST_MSG_DATA_ATTR_FROM
Definition: message.h:456
#define ast_frdup(fr)
Copies a frame.
@ AST_FRAME_VIDEO
@ AST_FRAME_NULL
@ AST_FRAME_IMAGE
@ AST_FRAME_DTMF_END
@ AST_FRAME_DTMF_BEGIN
@ AST_FRAME_VOICE
@ AST_FRAME_RTCP
@ AST_FRAME_TEXT_DATA
@ AST_FRAME_TEXT
#define DEBUG_ATLEAST(level)
#define LOG_DEBUG
#define LOG_ERROR
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
Definition: linkedlists.h:731
struct ast_bridge_channel::@198 stream_map
struct ast_vector_int to_channel
struct ast_bridge_channel::@192 wr_queue
unsigned int text_messaging
Structure used to transport a message through the frame core.
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
Definition: vector.h:609
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.
Definition: vector.h:680

References ast_bridge_channel::alert_pipe, ast_alertpipe_write(), ast_bridge_channel_lock, ast_bridge_channel_unlock, ast_channel_name(), AST_FRAME_DTMF_BEGIN, AST_FRAME_DTMF_END, AST_FRAME_IMAGE, AST_FRAME_NULL, AST_FRAME_RTCP, AST_FRAME_TEXT, AST_FRAME_TEXT_DATA, AST_FRAME_VIDEO, AST_FRAME_VOICE, ast_frdup, ast_is_deferrable_frame(), AST_LIST_INSERT_TAIL, ast_log, AST_MSG_DATA_ATTR_BODY, AST_MSG_DATA_ATTR_FROM, AST_MSG_DATA_ATTR_TO, ast_msg_data_get_attribute(), AST_VECTOR_GET, AST_VECTOR_SIZE, BRIDGE_CHANNEL_STATE_WAIT, bridge_frame_free(), ast_bridge_channel::chan, ast_frame::data, ast_frame::datalen, DEBUG_ATLEAST, ast_bridge_channel::features, ast_frame::frametype, LOG_DEBUG, LOG_ERROR, ast_frame::ptr, ast_bridge_channel::state, ast_bridge_channel::stream_map, ast_frame::stream_num, ast_bridge_channel::suspended, ast_bridge_features::text_messaging, ast_bridge_channel::to_channel, and ast_bridge_channel::wr_queue.

Referenced by ast_bridge_channel_notify_talking(), ast_bridge_channel_queue_control_data(), ast_bridge_queue_everyone_else(), bridge_channel_queue_action_data(), bridge_channel_queue_action_data_sync(), remb_send_report(), send_message(), softmix_mixing_loop(), and softmix_pass_video_top_priority().

◆ ast_bridge_channel_queue_playfile()

int ast_bridge_channel_queue_playfile ( struct ast_bridge_channel bridge_channel,
ast_bridge_custom_play_fn  custom_play,
const char *  playfile,
const char *  moh_class 
)

Queue a bridge action play file frame onto the bridge channel.

Since
12.0.0
Parameters
bridge_channelWhich channel to put the frame onto.
custom_playCall this function to play the playfile. (NULL if normal sound file to play)
playfileSound filename to play.
moh_classMOH class to request bridge peers to hear while file is played. NULL if no MOH. Empty if default MOH class.
Note
This is intended to be called by bridge hooks.
Return values
0on success.
-1on error.

Definition at line 1343 of file bridge_channel.c.

1344{
1346 bridge_channel, custom_play, playfile, moh_class);
1347}
static int payload_helper_playfile(ast_bridge_channel_post_action_data post_it, struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class)

References bridge_channel_queue_action_data(), bridge_playfile::custom_play, payload_helper_playfile(), and bridge_playfile::playfile.

Referenced by ast_bridge_add_channel(), bridge_parking_pull(), bridge_parking_push(), check_bridge_play_sound(), feature_automixmonitor(), parker_parked_call_message_response(), play_sound(), start_automixmonitor(), and stop_automixmonitor().

◆ ast_bridge_channel_queue_playfile_sync()

int ast_bridge_channel_queue_playfile_sync ( struct ast_bridge_channel bridge_channel,
ast_bridge_custom_play_fn  custom_play,
const char *  playfile,
const char *  moh_class 
)

Synchronously queue a bridge action play file frame onto the bridge channel.

Since
12.2.0
Parameters
bridge_channelWhich channel to put the frame onto.
custom_playCall this function to play the playfile. (NULL if normal sound file to play)
playfileSound filename to play.
moh_classMOH class to request bridge peers to hear while file is played. NULL if no MOH. Empty if default MOH class.

This function will block until the queued frame has been destroyed. This will happen either if an error occurs or if the queued playback finishes.

Note
No locks may be held when calling this function.
Return values
0The playback was successfully queued.
-1The playback could not be queued.

Definition at line 1349 of file bridge_channel.c.

1351{
1353 bridge_channel, custom_play, playfile, moh_class);
1354}
static int bridge_channel_queue_action_data_sync(struct ast_bridge_channel *bridge_channel, enum bridge_channel_action_type action, const void *data, size_t datalen)

References bridge_channel_queue_action_data_sync(), bridge_playfile::custom_play, payload_helper_playfile(), and bridge_playfile::playfile.

Referenced by parker_parked_call_message_response(), and play_uri().

◆ ast_bridge_channel_restore_formats()

void ast_bridge_channel_restore_formats ( struct ast_bridge_channel bridge_channel)

Restore the formats of a bridge channel's channel to how they were before bridge_channel_internal_join.

Since
12.0.0
Parameters
bridge_channelChannel to restore

Definition at line 338 of file bridge_channel.c.

339{
340 ast_assert(bridge_channel->read_format != NULL);
341 ast_assert(bridge_channel->write_format != NULL);
342
343 ast_channel_lock(bridge_channel->chan);
344
345 /* Restore original formats of the channel as they came in */
346 if (ast_format_cmp(ast_channel_readformat(bridge_channel->chan), bridge_channel->read_format) == AST_FORMAT_CMP_NOT_EQUAL) {
347 ast_debug(1, "Bridge is returning %p(%s) to read format %s\n",
348 bridge_channel, ast_channel_name(bridge_channel->chan),
349 ast_format_get_name(bridge_channel->read_format));
350 if (ast_set_read_format(bridge_channel->chan, bridge_channel->read_format)) {
351 ast_debug(1, "Bridge failed to return %p(%s) to read format %s\n",
352 bridge_channel, ast_channel_name(bridge_channel->chan),
353 ast_format_get_name(bridge_channel->read_format));
354 }
355 }
356 if (ast_format_cmp(ast_channel_writeformat(bridge_channel->chan), bridge_channel->write_format) == AST_FORMAT_CMP_NOT_EQUAL) {
357 ast_debug(1, "Bridge is returning %p(%s) to write format %s\n",
358 bridge_channel, ast_channel_name(bridge_channel->chan),
359 ast_format_get_name(bridge_channel->write_format));
360 if (ast_set_write_format(bridge_channel->chan, bridge_channel->write_format)) {
361 ast_debug(1, "Bridge failed to return %p(%s) to write format %s\n",
362 bridge_channel, ast_channel_name(bridge_channel->chan),
363 ast_format_get_name(bridge_channel->write_format));
364 }
365 }
366
367 ast_channel_unlock(bridge_channel->chan);
368}
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
Definition: channel.c:5781
struct ast_format * ast_channel_writeformat(struct ast_channel *chan)
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
Definition: channel.c:5822
struct ast_format * ast_channel_readformat(struct ast_channel *chan)
enum ast_format_cmp_res ast_format_cmp(const struct ast_format *format1, const struct ast_format *format2)
Compare two formats.
Definition: format.c:201
@ AST_FORMAT_CMP_NOT_EQUAL
Definition: format.h:38
const char * ast_format_get_name(const struct ast_format *format)
Get the name associated with a format.
Definition: format.c:334
struct ast_format * write_format
struct ast_format * read_format
#define ast_assert(a)
Definition: utils.h:739

References ast_assert, ast_channel_lock, ast_channel_name(), ast_channel_readformat(), ast_channel_unlock, ast_channel_writeformat(), ast_debug, ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_name(), ast_set_read_format(), ast_set_write_format(), ast_bridge_channel::chan, NULL, ast_bridge_channel::read_format, and ast_bridge_channel::write_format.

Referenced by bridge_channel_internal_join(), and participant_reaction_announcer_leave().

◆ ast_bridge_channel_run_app()

void ast_bridge_channel_run_app ( struct ast_bridge_channel bridge_channel,
const char *  app_name,
const char *  app_args,
const char *  moh_class 
)

Run an application on the bridge channel.

Since
12.0.0
Parameters
bridge_channelWhich channel to run the application on.
app_nameDialplan application name.
app_argsArguments for the application. (NULL tolerant)
moh_classMOH class to request bridge peers to hear while application is running. NULL if no MOH. Empty if default MOH class.
Note
This is intended to be called by bridge hooks.

Definition at line 1184 of file bridge_channel.c.

1185{
1186 if (moh_class) {
1187 ast_bridge_channel_write_hold(bridge_channel, moh_class);
1188 }
1189 if (run_app_helper(bridge_channel->chan, app_name, S_OR(app_args, ""))) {
1190 /* Break the bridge if the app returns non-zero. */
1192 }
1193 if (moh_class) {
1194 ast_bridge_channel_write_unhold(bridge_channel);
1195 }
1196}
static int run_app_helper(struct ast_channel *chan, const char *app_name, const char *app_args)
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
Definition: strings.h:80

References app_name(), ast_bridge_channel_kick(), ast_bridge_channel_write_hold(), ast_bridge_channel_write_unhold(), AST_CAUSE_NORMAL_CLEARING, ast_channel::bridge_channel, ast_bridge_channel::chan, run_app_helper(), and S_OR.

Referenced by bridge_channel_run_app(), and dynamic_dtmf_hook_callback().

◆ ast_bridge_channel_stream_map()

void ast_bridge_channel_stream_map ( struct ast_bridge_channel bridge_channel)

Maps a channel's stream topology to and from the bridge.

Since
15.0.0

When a channel joins a bridge or its associated stream topology is updated, each stream in the topology needs to be mapped according to its media type to the bridge. Calling this method creates a mapping of each stream on the channel indexed to the bridge's supported media types and vice versa (i.e. bridge's media types indexed to channel streams).

The first channel to join the bridge creates the initial order for the bridge's media types (e.g. a one to one mapping is made). Subsequently added channels are mapped to that order adding more media types if/when the newly added channel has more streams and/or media types specified by the bridge.

Parameters
bridge_channelChannel to map
Note
The bridge_channel's bridge must be locked prior to calling this function.

Definition at line 3119 of file bridge_channel.c.

3120{
3121 ast_bridge_channel_lock(bridge_channel);
3122 ast_channel_lock(bridge_channel->chan);
3124 &bridge_channel->bridge->media_types, &bridge_channel->stream_map.to_bridge,
3125 &bridge_channel->stream_map.to_channel);
3126 ast_channel_unlock(bridge_channel->chan);
3127 ast_bridge_channel_unlock(bridge_channel);
3128}
struct ast_stream_topology * ast_channel_get_stream_topology(const struct ast_channel *chan)
Retrieve the topology of streams on a channel.
void ast_stream_topology_map(const struct ast_stream_topology *topology, struct ast_vector_int *types, struct ast_vector_int *v0, struct ast_vector_int *v1)
Map a given topology's streams to the given types.
Definition: stream.c:988
struct ast_vector_int to_bridge
struct ast_vector_int media_types
Definition: bridge.h:404

References ast_bridge_channel_lock, ast_bridge_channel_unlock, ast_channel_get_stream_topology(), ast_channel_lock, ast_channel_unlock, ast_stream_topology_map(), ast_bridge_channel::bridge, ast_bridge_channel::chan, ast_bridge::media_types, ast_bridge_channel::stream_map, ast_bridge_channel::to_bridge, and ast_bridge_channel::to_channel.

Referenced by bridge_channel_complete_join(), bridge_handle_trip(), native_rtp_stream_topology_changed(), simple_bridge_stream_topology_changed(), and softmix_bridge_stream_topology_changed().

◆ ast_bridge_channel_update_accountcodes()

void ast_bridge_channel_update_accountcodes ( struct ast_bridge_channel joining,
struct ast_bridge_channel leaving 
)

Definition at line 583 of file bridge_channel.c.

584{
585 if (joining) {
587 } else {
589 }
590}
static void bridge_channel_update_accountcodes_joining(struct ast_bridge_channel *joining, struct ast_bridge_channel *swap)
static void bridge_channel_update_accountcodes_leaving(struct ast_bridge_channel *leaving)

References bridge_channel_update_accountcodes_joining(), and bridge_channel_update_accountcodes_leaving().

Referenced by bridge_basic_pull(), bridge_basic_push(), bridge_stasis_pull(), and bridge_stasis_push().

◆ ast_bridge_channel_update_linkedids()

void ast_bridge_channel_update_linkedids ( struct ast_bridge_channel bridge_channel,
struct ast_bridge_channel swap 
)

Definition at line 382 of file bridge_channel.c.

383{
384 struct ast_bridge_channel *other;
385 struct ast_bridge *bridge = bridge_channel->bridge;
386 struct ast_channel *oldest_linkedid_chan = bridge_channel->chan;
387
389 if (other == swap) {
390 continue;
391 }
392 oldest_linkedid_chan = ast_channel_internal_oldest_linkedid(
393 oldest_linkedid_chan, other->chan);
394 }
395
400 if (other == swap) {
401 continue;
402 }
403 ast_channel_lock(other->chan);
404 ast_channel_internal_copy_linkedid(other->chan, oldest_linkedid_chan);
405 ast_channel_unlock(other->chan);
406 }
407}
void ast_channel_internal_copy_linkedid(struct ast_channel *dest, struct ast_channel *source)
Copy the full linkedid channel id structure from one channel to another.
struct ast_channel * ast_channel_internal_oldest_linkedid(struct ast_channel *a, struct ast_channel *b)
Determine which channel has an older linkedid.
struct ast_bridge * bridge

References ast_channel_internal_copy_linkedid(), ast_channel_internal_oldest_linkedid(), ast_channel_lock, ast_channel_unlock, AST_LIST_TRAVERSE, ast_bridge_channel::bridge, ast_channel::bridge, ast_channel::bridge_channel, ast_bridge_channel::chan, and ast_bridge::channels.

Referenced by bridge_basic_push(), and bridge_stasis_push().

◆ ast_bridge_channel_write_app()

int ast_bridge_channel_write_app ( struct ast_bridge_channel bridge_channel,
const char *  app_name,
const char *  app_args,
const char *  moh_class 
)

Write a bridge action run application frame into the bridge.

Since
12.0.0
Parameters
bridge_channelWhich channel is putting the frame into the bridge
app_nameDialplan application name.
app_argsArguments for the application. (NULL or empty for no arguments)
moh_classMOH class to request bridge peers to hear while application is running. NULL if no MOH. Empty if default MOH class.
Note
This is intended to be called by bridge hooks.
Return values
0on success.
-1on error.

Definition at line 1250 of file bridge_channel.c.

1251{
1253 bridge_channel, app_name, app_args, moh_class);
1254}
static int bridge_channel_write_action_data(struct ast_bridge_channel *bridge_channel, enum bridge_channel_action_type action, const void *data, size_t datalen)

References app_name(), bridge_channel_write_action_data(), and payload_helper_app().

◆ ast_bridge_channel_write_callback()

int ast_bridge_channel_write_callback ( struct ast_bridge_channel bridge_channel,
enum ast_bridge_channel_custom_callback_option  flags,
ast_bridge_custom_callback_fn  callback,
const void *  payload,
size_t  payload_size 
)

Write a bridge action custom callback frame into the bridge.

Since
12.0.0
Parameters
bridge_channelWhich channel is putting the frame into the bridge
flagsCustom callback option flags.
callbackCustom callback run on a bridge channel.
payloadData to pass to the callback. (NULL if none).
payload_sizeSize of the payload if payload is non-NULL. A number otherwise.
Note
The payload MUST NOT have any resources that need to be freed.
This is intended to be called by bridge hooks.
Return values
0on success.
-1on error.

Definition at line 1421 of file bridge_channel.c.

1424{
1426 bridge_channel, flags, callback, payload, payload_size);
1427}

References bridge_channel_write_action_data(), bridge_custom_callback::callback, bridge_custom_callback::flags, bridge_custom_callback::payload, payload_helper_cb(), and bridge_custom_callback::payload_size.

Referenced by agent_connect_caller(), and dynamic_dtmf_hook_trip().

◆ ast_bridge_channel_write_control_data()

int ast_bridge_channel_write_control_data ( struct ast_bridge_channel bridge_channel,
enum ast_control_frame_type  control,
const void *  data,
size_t  datalen 
)

Write a control frame into the bridge with data.

Since
12.0.0
Parameters
bridge_channelWhich channel is putting the frame into the bridge.
controlType of control frame.
dataFrame payload data to pass.
datalenFrame payload data length to pass.
Return values
0on success.
-1on error.

Definition at line 1116 of file bridge_channel.c.

1117{
1118 struct ast_frame frame = {
1120 .subclass.integer = control,
1121 .datalen = datalen,
1122 .data.ptr = (void *) data,
1123 };
1124
1125 return bridge_channel_write_frame(bridge_channel, &frame);
1126}
static int bridge_channel_write_frame(struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)

References AST_FRAME_CONTROL, bridge_channel_write_frame(), ast_frame::data, ast_frame::datalen, and ast_frame::frametype.

Referenced by agent_connect_caller(), ast_bridge_channel_write_hold(), ast_bridge_channel_write_unhold(), and ringing().

◆ ast_bridge_channel_write_hold()

int ast_bridge_channel_write_hold ( struct ast_bridge_channel bridge_channel,
const char *  moh_class 
)

Write a hold frame into the bridge.

Since
12.0.0
Parameters
bridge_channelWhich channel is putting the hold into the bridge.
moh_classThe suggested music class for the other end to use.
Return values
0on success.
-1on error.

Definition at line 1128 of file bridge_channel.c.

1129{
1130 struct ast_json *blob;
1131 int res;
1132 size_t datalen;
1133
1134 if (!ast_strlen_zero(moh_class)) {
1135 datalen = strlen(moh_class) + 1;
1136
1137 blob = ast_json_pack("{s: s}",
1138 "musicclass", moh_class);
1139 } else {
1140 moh_class = NULL;
1141 datalen = 0;
1142 blob = NULL;
1143 }
1144
1146
1148 moh_class, datalen);
1149
1150 ast_json_unref(blob);
1151 return res;
1152}
int ast_bridge_channel_write_control_data(struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen)
Write a control frame into the bridge with data.
struct stasis_message_type * ast_channel_hold_type(void)
Message type for when a channel is placed on hold.
void ast_channel_publish_cached_blob(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
Publish a channel blob message using the latest snapshot from the cache.
@ AST_CONTROL_HOLD
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
Definition: json.c:73
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
Definition: json.c:612
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Definition: strings.h:65
Abstract JSON element (object, array, string, int, ...).

References ast_bridge_channel_write_control_data(), ast_channel_hold_type(), ast_channel_publish_cached_blob(), AST_CONTROL_HOLD, ast_json_pack(), ast_json_unref(), ast_strlen_zero(), ast_bridge_channel::chan, and NULL.

Referenced by ast_bridge_channel_playfile(), ast_bridge_channel_run_app(), feature_attended_transfer(), feature_blind_transfer(), and hold().

◆ ast_bridge_channel_write_park()

int ast_bridge_channel_write_park ( struct ast_bridge_channel bridge_channel,
const char *  parkee_uuid,
const char *  parker_uuid,
const char *  app_data 
)

Have a bridge channel park a channel in the bridge.

Since
12.0.0
Parameters
bridge_channelBridge channel performing the parking
parkee_uuidUnique id of the channel we want to park
parker_uuidUnique id of the channel parking the call
app_datastring indicating data used for park application (NULL allowed)
Note
This is intended to be called by bridge hooks.
Return values
0on success.
-1on error.

Definition at line 1492 of file bridge_channel.c.

1493{
1495 bridge_channel, parkee_uuid, parker_uuid, app_data);
1496}
static int payload_helper_park(ast_bridge_channel_post_action_data post_it, struct ast_bridge_channel *bridge_channel, const char *parkee_uuid, const char *parker_uuid, const char *app_data)

References bridge_channel_write_action_data(), bridge_park::parkee_uuid, and payload_helper_park().

Referenced by manager_park_bridged(), and parking_blind_transfer_park().

◆ ast_bridge_channel_write_playfile()

int ast_bridge_channel_write_playfile ( struct ast_bridge_channel bridge_channel,
ast_bridge_custom_play_fn  custom_play,
const char *  playfile,
const char *  moh_class 
)

Write a bridge action play file frame into the bridge.

Since
12.0.0
Parameters
bridge_channelWhich channel is putting the frame into the bridge
custom_playCall this function to play the playfile. (NULL if normal sound file to play)
playfileSound filename to play.
moh_classMOH class to request bridge peers to hear while file is played. NULL if no MOH. Empty if default MOH class.
Note
This is intended to be called by bridge hooks.
Return values
0on success.
-1on error.

Definition at line 1337 of file bridge_channel.c.

1338{
1340 bridge_channel, custom_play, playfile, moh_class);
1341}

References bridge_channel_write_action_data(), bridge_playfile::custom_play, payload_helper_playfile(), and bridge_playfile::playfile.

Referenced by ast_bridge_transfer_attended(), start_automixmonitor(), and stop_automixmonitor().

◆ ast_bridge_channel_write_unhold()

int ast_bridge_channel_write_unhold ( struct ast_bridge_channel bridge_channel)

Write an unhold frame into the bridge.

Since
12.0.0
Parameters
bridge_channelWhich channel is putting the hold into the bridge.
Return values
0on success.
-1on error.

Definition at line 1154 of file bridge_channel.c.

1155{
1157
1158 if (!chan) {
1159 return -1;
1160 }
1161
1163 ao2_ref(chan, -1);
1164
1166}
struct ast_channel * ast_bridge_channel_get_chan(struct ast_bridge_channel *bridge_channel)
Get a ref to the bridge_channel's ast_channel.
struct stasis_message_type * ast_channel_unhold_type(void)
Message type for when a channel is removed from hold.
@ AST_CONTROL_UNHOLD

References ao2_ref, ast_bridge_channel_get_chan(), ast_bridge_channel_write_control_data(), ast_channel_publish_cached_blob(), ast_channel_unhold_type(), AST_CONTROL_UNHOLD, ast_channel::bridge_channel, and NULL.

Referenced by ast_bridge_channel_playfile(), ast_bridge_channel_run_app(), ast_bridge_transfer_attended(), ast_bridge_transfer_blind(), feature_attended_transfer(), feature_blind_transfer(), and unhold().