# Asterisk（软件）

**Asterisk** 是一款自由开源的专用交换机（PBX）与电话工具包，运行于 Linux 平台，用于发起、维持和操控电话等端点之间的通话，并作为企业电话系统、呼叫中心和定制通信应用的核心引擎。它由马克·斯宾塞（Mark Spencer）于 1999 年创建，当时他还是[奥本大学](https://www.edgepedia.org/zh/auburn-university)（Auburn University）计算机工程专业的学生，目前则在 Sangoma 旗下开发。<sup>[1](https://docs.asterisk.org/About-the-Project/A-Brief-History-of-the-Asterisk-Project/)</sup><sup> • </sup><sup>[2](https://www.asterisk.org/products/ip-pbx/)</sup>

| 关键事实 | 详情 |
|---|---|
| 是什么 | 一个开源的混合 TDM 与分组语音 PBX 及 IVR 平台，运行于 GNU/Linux，同时支持传统电话硬件和 VoIP 协议<sup>[3](https://downloads.asterisk.org/pub/telephony/asterisk/misc/asterisk-whitepaper.pdf)</sup><sup> • </sup><sup>[4](https://github.com/asterisk/asterisk/blob/master/README.md)</sup> |
| 起源 | 1999 年由马克·斯宾塞在奥本大学编写；以 GPL 发布；其公司 Linux Support Services 于 2001 年更名为 Digium<sup>[1](https://docs.asterisk.org/About-the-Project/A-Brief-History-of-the-Asterisk-Project/)</sup> |
| 许可证 | GNU 通用公共许可证第 2 版，另可与 Sangoma US Inc. 协商替代商业许可证<sup>[5](https://github.com/asterisk/asterisk/blob/master/LICENSE)</sup> |
| 架构 | 一个 PBX 核心加上动态可加载模块；默认安装附带 150 多个模块<sup>[6](https://docs.asterisk.org/Fundamentals/Asterisk-Architecture/Asterisk-Architecture-The-Big-Picture/)</sup> |
| 控制 API | Asterisk 网关接口（AGI）、Asterisk 管理器接口（AMI）和 Asterisk REST 接口（ARI）<sup>[7](https://docs.asterisk.org/Configuration/Interfaces/Asterisk-REST-Interface-ARI/)</sup> |
| 规模 | 该项目声称在约 170 个国家拥有超过一百万套通信系统<sup>[8](https://www.techradar.com/best/pbx-phone-systems)</sup> |
| 当前版本 | 活跃的主版本系列包括 20、21、22、23，以及一个 24.0.0 候选发布版<sup>[9](https://github.com/asterisk/asterisk/releases)</sup> |

## 历史

1999 年，马克·斯宾塞即将在奥本大学完成计算机工程学位，同时经营着 Linux Support Services——一家为 Linux 操作系统销售商业支持的公司。随着支持业务不断增长，团队需要一套电话系统来分配来电，而当地电话系统供应商的报价十分昂贵，斯宾塞便自己编写了 Asterisk 最初的核心代码，并以 GPL（与 Linux 所使用的相同许可证）在互联网上发布了源码。<sup>[1](https://docs.asterisk.org/About-the-Project/A-Brief-History-of-the-Asterisk-Project/)</sup>

开源 PBX 的理念迅速传播开来，数百名、后来数千名开发者开始提交功能。2001 年，Linux Support Services 更名为 Digium，继续与社区共同开发 Asterisk，同时围绕它销售商业产品和服务。<sup>[1](https://docs.asterisk.org/About-the-Project/A-Brief-History-of-the-Asterisk-Project/)</sup> 2018 年 8 月 23 日，Sangoma Technologies Corporation 签订最终协议，收购 Digium 全部流通股份，交易预计于 2018 年 8 月 31 日前后完成；Sangoma 称自己是 Asterisk 项目的天然归宿，因为两家公司都参与了该项目的历史。<sup>[10](https://sangoma.com/company/press-releases/sangoma-announces-transformative-acquisition-of-digium/)</sup> 如今，Sangoma 是 Asterisk 和 FreePBX 的主要开发者和赞助方。<sup>[11](https://www.freepbx.org/wp-content/uploads/pbxact-brochure.pdf)</sup>

## 架构

Asterisk 系统的核心是 PBX 核心，它读取配置文件（包括拨号方案），并加载所有其他模块。模块是独立的组件，通常是 modules 目录下扩展名为 .so 的共享对象文件，提供核心之外的一切功能：通道驱动、编解码器、文件格式、通话详单后端和应用。模块可以在构建时选择、在启动时按指定顺序加载、在运行时卸载或重新加载，且大多数模块有自己的配置文件，其中一些可以从数据库后端静态或动态（实时）读取。<sup>[6](https://docs.asterisk.org/Fundamentals/Asterisk-Architecture/Asterisk-Architecture-The-Big-Picture/)</sup>

**通道驱动**负责与 Asterisk 外部的设备通信，将其信令或协议转换为核心可理解的形式。常见的通道类型包括 SIP 通道驱动（如 chan_pjsip），用于对接支持 SIP 的 VoIP 设备，包括电话、通道组、其他 PBX 和互联网电话服务提供商；DAHDI 通道，用于连接 Sangoma 的 T1/E1/J1 接口卡等电话硬件；以及 Local 通道，它向内拨回系统自身，在 Asterisk 12 中被移入核心。<sup>[12](https://docs.asterisk.org/Fundamentals/Key-Concepts/Channels/)</sup>

**桥接**是在通道之间共享媒体的构造。当 Asterisk 得知两个或更多通道希望通信时，通常会创建一个桥接，例如 Dial 应用在出站通道应答时。桥接类型分为两方和多方两类。两方变体包括核心桥接——由于 Asterisk 直接处理媒体，它可以转码、录音和操控媒体——以及原生桥接，后者将媒体传输交给通道驱动自身以获得更高性能，代价是失去依赖媒体解读的功能。自 Asterisk 12 起，桥接框架变得智能：它会为涉及的通道自动选择最佳混音技术，并能动态切换，例如在咨询转接将两方桥接合并为三方桥接时。<sup>[13](https://docs.asterisk.org/Fundamentals/Key-Concepts/Bridges/)</sup>

## 拨号方案

拨号方案是引导 Asterisk 行为的主要方式。它以文本文件形式存在，通常是 /etc/asterisk 下的 extensions.conf，使用内置脚本语言、AEL（Asterisk 扩展语言）或 Lua 编写；也可以与其他模块配置一起从数据库读取。<sup>[6](https://docs.asterisk.org/Fundamentals/Asterisk-Architecture/Asterisk-Architecture-The-Big-Picture/)</sup><sup> • </sup><sup>[14](https://docs.asterisk.org/Configuration/Dialplan/)</sup>

拨号方案按上下文组织，上下文是基本的组织单元，用于保持拨号方案各部分相互独立、实施安全边界并提供不同的服务等级。在一个上下文内，扩展是一组命名动作，写作 `exten => number,priority,application(parameters)`，其中每个优先级是按顺序执行的序号，每一步调用一个拨号方案应用，如 Dial 或 [Voicemail](https://www.edgepedia.org/zh/voicemail)。每部电话或外部连接都指向单一上下文，如果所拨扩展在该上下文中不存在，Asterisk 会拒绝该通话。<sup>[15](https://docs.asterisk.org/Configuration/Dialplan/Contexts-Extensions-and-Priorities/)</sup><sup> • </sup><sup>[16](https://docs.asterisk.org/Deployment/Basic-PBX-Functionality/Creating-Dialplan-Extensions/)</sup>

应用模块提供拨号方案中脚本化的通话功能：一个应用可能应答来电，另一个播放声音提示，第三个让来电者留下语音留言。它们的文件命名为 app_xxxxx.so，例如 app_voicemail.so 和 app_confbridge.so，不过应用和函数也可以来自核心或其他模块。<sup>[17](https://docs.asterisk.org/Fundamentals/Asterisk-Architecture/Types-of-Asterisk-Modules/Dialplan-Application-Modules/)</sup>

## 编程接口

有三个 API 可供外部软件控制 Asterisk。Asterisk 网关接口（AGI）允许 Asterisk 启动以任意语言编写的外部程序，通过 AGI 协议控制电话通道、播放音频和读取 DTMF 按键；AsyncAGI 变体则使用 AMI 进行这种控制。<sup>[18](https://docs.asterisk.org/Asterisk_22_Documentation/API_Documentation/Dialplan_Applications/AGI/)</sup> Asterisk 管理器接口（AMI）面向通话控制，而 AGI 面向让远程进程执行拨号方案应用。两者都不是为构建完全定制的通信应用而设计的，因此创建了 Asterisk REST 接口（ARI）：一个异步 REST API，向开发者暴露 Asterisk 的原始基础对象——通道、桥接、端点和媒体，事件通过 [WebSocket](https://www.edgepedia.org/zh/websockets)（RFC 6455）传递。<sup>[7](https://docs.asterisk.org/Configuration/Interfaces/Asterisk-REST-Interface-ARI/)</sup>

## 应用与生态

Asterisk 被用作许多通信应用的核心引擎。企业电话系统（也称 IP PBX）是最常见的用途，但其组件支持广泛的功能，项目在其网站上描述的应用只是用它构建的数千种东西的一小部分。<sup>[19](https://www.asterisk.org/get-started/applications/)</sup> 由于原生 Asterisk 通过配置文件和自定义脚本管理，Sangoma 等公司提供基于 Asterisk 引擎、带图形界面的交钥匙 IP PBX 系统；例子包括 FreePBX（本身是一个开源项目）、其托管商业版本 PBXact Cloud，以及其他托管企业电话系统。<sup>[2](https://www.asterisk.org/products/ip-pbx/)</sup> FreePBX 17 是当前主版本，运行于 Debian，为 Asterisk 提供基于 Web 的图形界面。<sup>[20](https://www.freepbx.org/freepbx17/)</sup>

该项目声称在约 170 个国家拥有超过一百万套通信系统，用户包括小企业、大型企业、呼叫中心、电信网络和政府机构。<sup>[8](https://www.techradar.com/best/pbx-phone-systems)</sup> Asterisk 项目自己的历史页面指出，作为通信工具包，Asterisk 能做的一切范围太广，难以概括。<sup>[1](https://docs.asterisk.org/About-the-Project/A-Brief-History-of-the-Asterisk-Project/)</sup>

## 安全

Asterisk 在信令层和媒体层均提供加密。SIP 通道支持信令的 TLS 加密和媒体的 SRTP 加密；SRTP 支持在 Asterisk 1.8 中加入，TLS 在 1.6 中加入，SRTP 由 libsrtp 库提供，编译前必须安装该库。<sup>[21](https://docs.asterisk.org/Deployment/Important-Security-Considerations/Network-Security/)</sup><sup> • </sup><sup>[22](https://docs.asterisk.org/Deployment/Secure-Calling/Secure-Calling-Tutorial/)</sup> IAX2 协议支持强 RSA 密钥认证以及语音和信令的 AES 加密，访问控制列表可以允许或拒绝网络访问 Asterisk 服务。<sup>[21](https://docs.asterisk.org/Deployment/Important-Security-Considerations/Network-Security/)</sup> 在 Asterisk 20.12.0、21.7.0 和 22.2.0 以及 PJProject 2.15.1 中，chan_pjsip 通道驱动在基础 MD5 算法之外新增了 SHA-256 和 SHA-512-256 认证摘要哈希算法。<sup>[23](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/PJSIP-Authentication/)</sup> 项目通过其网站和 GitHub 发布安全公告，涵盖媒体解析中的缓冲区溢出、日志模块中的 SQL 注入等问题。<sup>[24](https://www.asterisk.org/downloads/security-advisories/)</sup>

容量取决于系统限制：Asterisk 使用[文件描述符](https://www.edgepedia.org/zh/file-descriptor)进行网络通信和硬件访问，在常见的默认上限 1024 下，它大约能处理 150 路并发 SIP 通话。<sup>[4](https://github.com/asterisk/asterisk/blob/master/README.md)</sup>

## 许可

Asterisk 的代码以 GNU 通用公共许可证第 2 版发布，但也可以通过与 Sangoma US Inc.（该软件包各组件的版权或充分许可权利持有者）直接协商，以其他条款授权，后者可授权专有或非 GPL 开源模块在运行时动态链接。项目特别授予 Asterisk 与 OpenSSL、OpenH323、UniMRCP 和 UW IMAP Toolkit 链接的许可。项目的立场是，使用 AMI、AGI 或 ARI 协议管理或控制 Asterisk 实例的应用不必采用 GPL 许可，但若法院另有裁定，项目亦授予此类使用的许可。Asterisk 名称和标识是 Sangoma US Inc. 拥有的商标。<sup>[5](https://github.com/asterisk/asterisk/blob/master/LICENSE)</sup>

## References

1. [A Brief History of the Asterisk Project, Asterisk Documentation](https://docs.asterisk.org/About-the-Project/A-Brief-History-of-the-Asterisk-Project/)
2. [IP PBX, Asterisk.org](https://www.asterisk.org/products/ip-pbx/)
3. [Introduction to Asterisk, Asterisk whitepaper](https://downloads.asterisk.org/pub/telephony/asterisk/misc/asterisk-whitepaper.pdf)
4. [asterisk/asterisk README.md, GitHub](https://github.com/asterisk/asterisk/blob/master/README.md)
5. [asterisk/asterisk LICENSE, GitHub](https://github.com/asterisk/asterisk/blob/master/LICENSE)
6. [Asterisk Architecture, The Big Picture, Asterisk Documentation](https://docs.asterisk.org/Fundamentals/Asterisk-Architecture/Asterisk-Architecture-The-Big-Picture/)
7. [Asterisk REST Interface (ARI) Overview, Asterisk Documentation](https://docs.asterisk.org/Configuration/Interfaces/Asterisk-REST-Interface-ARI/)
8. [Best PBX phone system for small business of 2025, TechRadar](https://www.techradar.com/best/pbx-phone-systems)
9. [Releases, asterisk/asterisk, GitHub](https://github.com/asterisk/asterisk/releases)
10. [Sangoma Announces Transformative Acquisition of Digium, Sangoma Technologies](https://sangoma.com/company/press-releases/sangoma-announces-transformative-acquisition-of-digium/)
11. [PBXact brochure, FreePBX/Sangoma](https://www.freepbx.org/wp-content/uploads/pbxact-brochure.pdf)
12. [Channels, Asterisk Documentation](https://docs.asterisk.org/Fundamentals/Key-Concepts/Channels/)
13. [Bridges, Asterisk Documentation](https://docs.asterisk.org/Fundamentals/Key-Concepts/Bridges/)
14. [Dialplan Overview, Asterisk Documentation](https://docs.asterisk.org/Configuration/Dialplan/)
15. [Contexts, Extensions, and Priorities, Asterisk Documentation](https://docs.asterisk.org/Configuration/Dialplan/Contexts-Extensions-and-Priorities/)
16. [Creating Dialplan Extensions, Asterisk Documentation](https://docs.asterisk.org/Deployment/Basic-PBX-Functionality/Creating-Dialplan-Extensions/)
17. [Dialplan Application Modules, Asterisk Documentation](https://docs.asterisk.org/Fundamentals/Asterisk-Architecture/Types-of-Asterisk-Modules/Dialplan-Application-Modules/)
18. [AGI, Asterisk 22 API Documentation](https://docs.asterisk.org/Asterisk_22_Documentation/API_Documentation/Dialplan_Applications/AGI/)
19. [Asterisk Applications, Asterisk.org](https://www.asterisk.org/get-started/applications/)
20. [FreePBX 17, FreePBX.org](https://www.freepbx.org/freepbx17/)
21. [Network Security, Asterisk Documentation](https://docs.asterisk.org/Deployment/Important-Security-Considerations/Network-Security/)
22. [Secure Calling Tutorial, Asterisk Documentation](https://docs.asterisk.org/Deployment/Secure-Calling/Secure-Calling-Tutorial/)
23. [PJSIP Authentication, Asterisk Documentation](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/PJSIP-Authentication/)
24. [Security Advisories, Asterisk.org](https://www.asterisk.org/downloads/security-advisories/)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 通信与日常技术 › 电话系统与服务 › Switching and exchanges › Automatic exchange systems › Stored-program and digital switching systems

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/asterisk-software

English original: https://www.edgepedia.org/asterisk-software
