Asterisk——part 1

Asterisk

Russell Bryant

Asterisk1 is an open source telephony applications platform distributed under the GPLv2. In short, it is a server application for making, receiving, and performing custom processing of phone calls.

The project was started by Mark Spencer in 1999. Mark had a company called Linux Support Services and he needed a phone system to help operate his business. He did not have a lot of money to spend on buying one, so he just made his own. As the popularity of Asterisk grew, Linux Support Services shifted focus to Asterisk and changed its name to Digium, Inc.

The name Asterisk comes from the Unix wildcard character, *. The goal for the Asterisk project is to do everything telephony. Through pursuing this goal, Asterisk now supports a long list of technologies for making and receiving phone calls. This includes many VoIP (Voice over IP) protocols, as well as both analog and digital connectivity to the traditional telephone network, or the PSTN (Public Switched Telephone Network). This ability to get many different types of phone calls into and out of the system is one of Asterisk‘s main strengths.

Once phone calls are made to and from an Asterisk system, there are many additional features that can be used to customize the processing of the phone call. Some features are larger pre-built common applications, such as voicemail. There are other smaller features that can be combined together to create custom voice applications, such as playing back a sound file, reading digits, or speech recognition.

1.1. Critical Architectural Concepts

This section discusses some architectural concepts that are critical to all parts of Asterisk. These ideas are at the foundation of the Asterisk architecture.

1.1.1. Channels

A channel in Asterisk represents a connection between the Asterisk system and some telephony endpoint (Figure 1.1). The most common example is when a phone makes a call into an Asterisk system. This connection is represented by a single channel. In the Asterisk code, a channel exists as an instance of the ast_channel data structure. This call scenario could be a caller interacting with voicemail, for example.

Figure 1.1: A Single Call Leg, Represented by a Single Channel

1.1.2. Channel Bridging

Perhaps a more familiar call scenario would be a connection between two phones, where a person using phone A has called a person on phone B. In this call scenario, there are two telephony endpoints connected to the Asterisk system, so two channels exist for this call (Figure 1.2).

Figure 1.2: Two Call Legs Represented by Two Channels

When Asterisk channels are connected like this, it is referred to as a channel bridge. Channel bridging is the act of connecting channels together for the purpose of passing media between them. The media stream is most commonly an audio stream. However, there may also be a video or a text stream in the call. Even in the case where there is more than one media stream (such as both audio and video), it is still handled by a single channel for each end of the call in Asterisk. In Figure 1.2, where there are two channels for phones A and B, the bridge is responsible for passing the media coming from phone A to phone B, and similarly, for passing the media coming from phone B to phone A. All media streams are negotiated through Asterisk. Anything that Asterisk does not understand and have full control over is not allowed. This means that Asterisk can do recording, audio manipulation, and translation between different technologies.

When two channels are bridged together, there are two methods that may be used to accomplish this: generic bridging and native bridging. A generic bridge is one that works regardless of what channel technologies are in use. It passes all audio and signalling through the Asterisk abstract channel interfaces. While this is the most flexible bridging method, it is also the least efficient due to the levels of abstraction necessary to accomplish the task. Figure 1.2 illustrates a generic bridge.

A native bridge is a technology specific method of connecting channels together. If two channels are connected to Asterisk using the same media transport technology, there may be a way to connect them that is more efficient than going through the abstraction layers in Asterisk that exist for connecting different technologies together. For example, if specialized hardware is being used for connecting to the telephone network, it may be possible to bridge the channels on the hardware so that the media does not have to flow up through the application at all. In the case of some VoIP protocols, it is possible to have endpoints send their media streams to each other directly, such that only the call signalling information continues to flow through the server.

The decision between generic bridging and native bridging is done by comparing the two channels when it is time to bridge them. If both channels indicate that they support the same native bridging method, then that will be used. Otherwise, the generic bridging method will be used. To determine whether or not two channels support the same native bridging method, a simple C function pointer comparison is used. It‘s certainly not the most elegant method, but we have not yet hit any cases where this was not sufficient for our needs. Providing a native bridge function for a channel is discussed in more detail in Section 1.2Figure 1.3 illustrates an example of a native bridge.

Figure 1.3: Example of a Native Bridge

总结:Asterisk使用了两种传输方式,一个是通过服务器中转的方式进行客户端交互;另外一个就是类似当初FBT的架构,如果客户端之间可以通过p2p连接,就使用p2p进行Media传输。

时间: 2024-10-11 21:45:41

Asterisk——part 1的相关文章

Asterisk[1]

Asterisk[1]是一款GPLv2协议下的开源电话应用平台.简单来说,Asterisk是一个服务器应用,能够完成发起电话呼叫.接受电话呼叫.对电话呼叫进行定制处理. 1.2.1 通道驱动 asterisk的通道驱动接口是最复杂也是最重要的可用接口.asteisk的通道API提供了对各种通信协议的抽象,使得asterisk的各种功能特性不必关心具体的通信协议.该组件主要是负责在asterisk通道抽象和具体的通信协议实现中的通信. asterisk通道驱动接口的定义是ast_channel_t

asterisk接通了没声音

家里现在在用着一台atom Z530的迷你主机,上面跑着centos6.5,前前后后配置了不少东西,最近一个月真的是学了不少,现在就一些遇到的问题,我慢慢说一下,都是菜鸟,希望后来人能少走弯路. 我用asterisk不就是用SIP和RTP么,asterisk1.8很好装,yum装就无压力.具体怎么安装我就不再多说了,网上其他的博文说的很多了,我就说一下安装完之后的事儿. 就是端口问题,SIP端口是5060,TCP和UDP都开就行了,如果仅仅是这样,你会发现,能拨通就是没声音,你说急人不急人吧,搜

asterisk channel driver dev ref

入口函数load_module    load_config    ast_channel_register console_tech    ast_cli_register_multiple    console_tech需要提供一系列的毁掉函数,比如        static struct ast_channel_tech console_tech = {    .type = "Console",    .description = "Console Channel

Huawei E1750 Asterisk

http://wiki.e1550.mobi/doku.php?id=installation https://wiki.asterisk.org/wiki/display/AST/Mobile+Channel+Requirements /usr/sbin/asterisk -vvvgc CLI>module load chan_dongle.so CLI>module unload chan_dongle.so CLI>module reload chan_dongle.so Hell

开源软件架构总结之——Asterisk(DSL、组件、多线程)

Asterisk 1是基于GPLv2协议发布的一款开源电话应用平台.简单地说,这是一个服务端程序,用于处理电话的拨出.接入以及自定义流程. 一个人使用电话A呼叫另一个使用电话B的人.在此场景下,连接到Asterisk系统的有两个电话终端,因而分配了两个通道(如图1.2). 图1.2 两个通道表示两条呼叫线路 媒体传输使用的是P2P方式! 图1.3 专用桥接实例 图1.4 通道技术层和抽象通道层 Asterisk组件抽象 Asterisk是一款高度模块化的软件.其内核程序可由源码树上的main/目

用 Asterisk 搭建自己的免费 VoIP 服务器

原文:用 Asterisk 搭建自己的免费 VoIP 服务器 原文 http://www.yaoblog.info/?p=5021 1. 这里以 Debian 为例子,安装 Asterisk apt-get update apt-get install asterisk 2. 预设置 Asterisk,修改 sip.conf 和 extensions.conf 文件,是为了创建两个可供测试的 SIP 账号 nano /etc/asterisk/sip.conf 在文件的开头部分添加如下信息: [

Asterisk配置文件语法

Asterisk PBX 有一套自定义的配置文件格式,通过一个内置的配置文件解析器(Parser)进行配置文件的读写操作.从 Asterisk 1.2 版本以后,配置文件的格式有了一些改进,增加了配置模板(template configuration)的支持.配置模板(template configuration)极大的提高了配置的灵活性和可扩展性. 配置文件的改进是在通用配置解析器层次实现的,因此,本文件介绍的这 种特性适用于 Asterisk PBX 各个配块的配置文件.本文将简要介绍 As

关于Asterisk无法加载chan_dahdi.so的问题

大致现象是这样: *CLI> module show like chan_dahdi.so Module Description Use Count Statuschan_dahdi.so DAHDI Telephony w/PRI 0 Not Running1 modules loaded *CLI> module load chan_dahdi.soUnable to load module chan_dahdi.soCommand 'module load chan_dahdi.so'

linux服务之asterisk

由于Asterisk过于专业且复杂,所以目前也存在大量衍生自Asterisk但简化过的通信系统,以让用户较容易使用.比如在欧美比较流行的elastix.trixbox.或以简体中文为基础的Freeiris等. Asterisk[1] 是一个开放源代码的软件VoIP PBX系统,它是一个运行在Linux环境下的纯软件实施方案.Asterisk[1]是一种功能非常齐全的应用程序,提供了许多电信功能,能够把你的x86机 器变成你自己的交换机,还能够当作一台企业级的商用交换机.Asterisk[1]让人

Asterisk服务安装配置和启动

2014年11月4日 11:36 注意: 更新源的重要性 源的地址: http://fffo.blog.163.com/blog/static/2119130682014322104136601/ 14.04源 可以用在13.04的ubuntn上 #cd  /etc #cd /apt # gedit sourc.list //编辑源 安装环境 操作系统是 Ubuntu 13.04 ==========================================================