Asterisk - The Open Source Telephony Project  21.4.1
Data Structures | Functions | Variables
conf_chan_announce.c File Reference

ConfBridge announcer channel driver. More...

#include "asterisk.h"
#include "asterisk/channel.h"
#include "asterisk/bridge.h"
#include "asterisk/core_unreal.h"
#include "include/confbridge.h"

Go to the source code of this file.

Data Structures

struct  announce_pvt
 

Functions

static int announce_call (struct ast_channel *chan, const char *addr, int timeout)
 
static int announce_hangup (struct ast_channel *ast)
 
static void announce_pvt_destructor (void *vdoomed)
 
static struct ast_channelannounce_request (const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause)
 
int conf_announce_channel_push (struct ast_channel *ast)
 Push the announcer channel into the conference. More...
 
struct ast_channel_techconf_announce_get_tech (void)
 Get ConfBridge announce channel technology struct. More...
 

Variables

static struct ast_channel_tech announce_tech
 

Detailed Description

ConfBridge announcer channel driver.

Author
Richard Mudgett rmudg.nosp@m.ett@.nosp@m.digiu.nosp@m.m.co.nosp@m.m

See Also:

Definition in file conf_chan_announce.c.

Function Documentation

int conf_announce_channel_push ( struct ast_channel ast)

Push the announcer channel into the conference.

Since
12.0.0
Parameters
astEither channel in the announcer channel pair.
Return values
0on success.
-1on error.

Definition at line 144 of file conf_chan_announce.c.

References ao2_ref, AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE, ast_bridge_features_new(), ast_bridge_impart(), AST_BRIDGE_IMPART_CHAN_INDEPENDENT, AST_UNREAL_CARETAKER_THREAD, announce_pvt::base, announce_pvt::bridge, ast_unreal_pvt::chan, ast_bridge_features::feature_flags, lock, RAII_VAR, and SCOPED_CHANNELLOCK.

Referenced by push_announcer().

145 {
146  struct ast_bridge_features *features;
147  struct ast_channel *chan;
148  RAII_VAR(struct announce_pvt *, p, NULL, ao2_cleanup);
149 
150  {
151  SCOPED_CHANNELLOCK(lock, ast);
152 
153  p = ast_channel_tech_pvt(ast);
154  if (!p) {
155  return -1;
156  }
157  ao2_ref(p, +1);
158  chan = p->base.chan;
159  if (!chan) {
160  return -1;
161  }
162  }
163 
164  features = ast_bridge_features_new();
165  if (!features) {
166  return -1;
167  }
168  ast_set_flag(&features->feature_flags, AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE);
169 
170  /* Impart the output channel into the bridge */
171  if (ast_bridge_impart(p->bridge, chan, NULL, features,
173  return -1;
174  }
175  ao2_lock(p);
176  ast_set_flag(&p->base, AST_UNREAL_CARETAKER_THREAD);
177  ao2_unlock(p);
178  return 0;
179 }
Main Channel structure associated with a channel.
Structure that contains features information.
#define AST_UNREAL_CARETAKER_THREAD
Definition: core_unreal.h:107
struct ast_flags feature_flags
ast_mutex_t lock
int ast_bridge_impart(struct ast_bridge *bridge, struct ast_channel *chan, struct ast_channel *swap, struct ast_bridge_features *features, enum ast_bridge_impart_flags flags) attribute_warn_unused_result
Impart a channel to a bridge (non-blocking)
Definition: bridge.c:1878
#define SCOPED_CHANNELLOCK(varname, chan)
scoped lock specialization for channels.
Definition: lock.h:619
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:459
struct ast_bridge_features * ast_bridge_features_new(void)
Allocate a new bridge features struct.
Definition: bridge.c:3683
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:941
struct ast_channel_tech* conf_announce_get_tech ( void  )

Get ConfBridge announce channel technology struct.

Since
12.0.0
Returns
ConfBridge announce channel technology.

Definition at line 139 of file conf_chan_announce.c.

Referenced by load_module(), and unload_module().

140 {
141  return &announce_tech;
142 }