bridge_simple.c File Reference

Simple two channel bridging module. More...

#include "asterisk.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/bridge.h"
#include "asterisk/bridge_technology.h"
#include "asterisk/frame.h"

Include dependency graph for bridge_simple.c:

Go to the source code of this file.

Functions

static void __reg_module (void)
static void __unreg_module (void)
static int load_module (void)
static int simple_bridge_join (struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
static int simple_bridge_write (struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
static int unload_module (void)

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Simple two channel bridging module" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, }
static struct ast_module_infoast_module_info = &__mod_info
static struct ast_bridge_technology simple_bridge


Detailed Description

Simple two channel bridging module.

Author:
Joshua Colp <jcolp@digium.com>

Definition in file bridge_simple.c.


Function Documentation

static void __reg_module ( void   )  [static]

Definition at line 92 of file bridge_simple.c.

static void __unreg_module ( void   )  [static]

Definition at line 92 of file bridge_simple.c.

static int load_module ( void   )  [static]

static int simple_bridge_join ( struct ast_bridge bridge,
struct ast_bridge_channel bridge_channel 
) [static]

Definition at line 48 of file bridge_simple.c.

References ast_channel_make_compatible(), AST_LIST_FIRST, AST_LIST_LAST, and ast_bridge::channels.

00049 {
00050    struct ast_channel *c0 = AST_LIST_FIRST(&bridge->channels)->chan;
00051    struct ast_channel *c1 = AST_LIST_LAST(&bridge->channels)->chan;
00052 
00053    /*
00054     * If this is the first channel we can't make it compatible...
00055     * unless we make it compatible with itself.  O.o
00056     */
00057    if (c0 == c1) {
00058       return 0;
00059    }
00060 
00061    return ast_channel_make_compatible(c0, c1);
00062 }

static int simple_bridge_write ( struct ast_bridge bridge,
struct ast_bridge_channel bridge_channel,
struct ast_frame frame 
) [static]

Definition at line 64 of file bridge_simple.c.

References ast_bridge_queue_everyone_else().

00065 {
00066    return ast_bridge_queue_everyone_else(bridge, bridge_channel, frame);
00067 }

static int unload_module ( void   )  [static]

Definition at line 77 of file bridge_simple.c.

References ast_bridge_technology_unregister().

00078 {
00079    ast_bridge_technology_unregister(&simple_bridge);
00080    return 0;
00081 }


Variable Documentation

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Simple two channel bridging module" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } [static]

Definition at line 92 of file bridge_simple.c.

Definition at line 92 of file bridge_simple.c.

Definition at line 69 of file bridge_simple.c.


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