conf_chan_record.c File Reference

ConfBridge recorder channel driver. More...

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

Include dependency graph for conf_chan_record.c:

Go to the source code of this file.

Functions

struct ast_channel_techconf_record_get_tech (void)
 Get ConfBridge record channel technology struct.
static int rec_call (struct ast_channel *chan, const char *addr, int timeout)
static struct ast_framerec_read (struct ast_channel *ast)
static struct ast_channelrec_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)
static int rec_write (struct ast_channel *ast, struct ast_frame *f)

Variables

static unsigned int name_sequence = 0
static struct ast_channel_tech record_tech


Detailed Description

ConfBridge recorder channel driver.

Author:
Richard Mudgett <rmudgett@digium.com>
See Also:

Definition in file conf_chan_record.c.


Function Documentation

struct ast_channel_tech* conf_record_get_tech ( void   )  [read]

Get ConfBridge record channel technology struct.

Since:
12.0.0
Returns:
ConfBridge record channel technology.

Definition at line 104 of file conf_chan_record.c.

Referenced by load_module(), rec_request(), and unload_module().

00105 {
00106    return &record_tech;
00107 }

static int rec_call ( struct ast_channel chan,
const char *  addr,
int  timeout 
) [static]

Definition at line 43 of file conf_chan_record.c.

00044 {
00045    /* Make sure anyone calling ast_call() for this channel driver is going to fail. */
00046    return -1;
00047 }

static struct ast_frame* rec_read ( struct ast_channel ast  )  [static, read]

Definition at line 49 of file conf_chan_record.c.

References ast_null_frame.

00050 {
00051    return &ast_null_frame;
00052 }

static struct ast_channel* rec_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 
) [static, read]

Definition at line 59 of file conf_chan_record.c.

References ao2_cleanup, ast_atomic_fetchadd_int(), ast_channel_add_bridge_role(), ast_channel_alloc, ast_channel_nativeformats_set(), ast_channel_release(), ast_channel_set_rawreadformat(), ast_channel_set_rawwriteformat(), ast_channel_set_readformat(), ast_channel_set_writeformat(), ast_channel_tech_set(), ast_channel_unlock, ast_format_cap_alloc, ast_format_cap_append_by_type(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_slin, AST_MEDIA_TYPE_UNKNOWN, AST_STATE_UP, conf_record_get_tech(), NULL, and RAII_VAR.

00060 {
00061    struct ast_channel *chan;
00062    const char *conf_name = data;
00063    RAII_VAR(struct ast_format_cap *, capabilities, NULL, ao2_cleanup);
00064    int generated_seqno = ast_atomic_fetchadd_int((int *) &name_sequence, +1);
00065 
00066    capabilities = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
00067    if (!capabilities) {
00068       return NULL;
00069    }
00070    ast_format_cap_append_by_type(capabilities, AST_MEDIA_TYPE_UNKNOWN);
00071 
00072    chan = ast_channel_alloc(1, AST_STATE_UP, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0,
00073       "CBRec/%s-%08x",
00074       conf_name, (unsigned) generated_seqno);
00075    if (!chan) {
00076       return NULL;
00077    }
00078    if (ast_channel_add_bridge_role(chan, "recorder")) {
00079       ast_channel_unlock(chan);
00080       ast_channel_release(chan);
00081       return NULL;
00082    }
00083 
00084    ast_channel_tech_set(chan, conf_record_get_tech());
00085    ast_channel_nativeformats_set(chan, capabilities);
00086    ast_channel_set_writeformat(chan, ast_format_slin);
00087    ast_channel_set_rawwriteformat(chan, ast_format_slin);
00088    ast_channel_set_readformat(chan, ast_format_slin);
00089    ast_channel_set_rawreadformat(chan, ast_format_slin);
00090    ast_channel_unlock(chan);
00091    return chan;
00092 }

static int rec_write ( struct ast_channel ast,
struct ast_frame f 
) [static]

Definition at line 54 of file conf_chan_record.c.

00055 {
00056    return 0;
00057 }


Variable Documentation

unsigned int name_sequence = 0 [static]

Definition at line 41 of file conf_chan_record.c.

struct ast_channel_tech record_tech [static]

Definition at line 94 of file conf_chan_record.c.


Generated on Thu Apr 16 06:30:20 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6