如何在 Ubuntu 上安装 Asterisk 22.04 LTS

Linux命令 Edge插件网 1年前 (2023-12-03) 419次浏览 已收录 0个评论

Asterisk是一个强大的开源PBX平台,已经彻底改变了电信世界。从小型企业到大型企业,Asterisk都是IP PBX系统、VoIP网关和会议服务器的首选解决方案。它具有呼叫队列、交互式语音应答、电话会议、保持音乐和语音邮件等众多功能,为所有电信需求提供了全面的解决方案。

如何在 Ubuntu 上安装 Asterisk 22.04 LTS

在 Ubuntu 上安装星号 22.04 LTS Jammy Jellyfish

步骤 1。在进入安装过程之前,确保您的系统是最新的至关重要。更新的系统不仅确保了顺利安装,而且还提供了增强的安全性和性能。运行以下命令以更新系统程序包:

<span class="pln">sudo apt update
sudo apt upgrade
sudo apt install wget apt</span><span class="pun">-</span><span class="pln">transport</span><span class="pun">-</span><span class="pln">https gnupg2 software</span><span class="pun">-</span><span class="pln">properties</span><span class="pun">-</span><span class="pln">common</span>

第2步。安装 N个必需的依赖项

接下来,安装必要的依赖项。这些对于成功编译和安装Asterisk至关重要: 

<span class="pln">sudo apt</span><span class="pun">-</span><span class="kwd">get</span><span class="pln"> install build</span><span class="pun">-</span><span class="pln">essential
sudo apt</span><span class="pun">-</span><span class="kwd">get</span><span class="pln"> install git</span><span class="pun">-</span><span class="pln">core subversion wget libjansson</span><span class="pun">-</span><span class="pln">dev sqlite autoconf automake libxml2</span><span class="pun">-</span><span class="pln">dev libncurses5</span><span class="pun">-</span><span class="pln">dev libtool</span>

第 3 步。在 Ubuntu 上安装 Asterisk 22.04.

系统准备好后,就可以下载 Asterisk 源了。使用以下命令下载最新版本的 Asterisk:

<span class="pln">wget http</span><span class="pun">:</span><span class="com">//downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz</span>

下载完成后,使用以下命令解压缩 Asterisk 文件:

<span class="pln">tar xvf asterisk</span><span class="pun">-</span><span class="lit">16</span><span class="pun">-</span><span class="pln">current</span><span class="pun">.</span><span class="pln">tar</span><span class="pun">.</span><span class="pln">gz</span>

导航到 Asterisk 目录:

<span class="pln">cd asterisk</span><span class="pun">-</span><span class="lit">20</span><span class="pun">*</span>

现在,启动编译过程。这可能需要一些时间,具体取决于系统的性能:

<span class="pln">sudo make </span><span class="pun">-</span><span class="pln">j2</span>

编译过程完成后,安装 Asterisk 及其模块:

<span class="pln">sudo make install</span>

成功安装Asterisk后,就可以创建一个Asterisk用户和组了。这增强了Asterisk安装的安全性:

<span class="pln">sudo adduser </span><span class="pun">--</span><span class="pln">system </span><span class="pun">--</span><span class="kwd">group</span> <span class="pun">--</span><span class="pln">home </span><span class="pun">/</span><span class="kwd">var</span><span class="pun">/</span><span class="pln">lib</span><span class="pun">/</span><span class="pln">asterisk </span><span class="pun">--</span><span class="kwd">no</span><span class="pun">-</span><span class="pln">create</span><span class="pun">-</span><span class="pln">home </span><span class="pun">--</span><span class="pln">gecos </span><span class="str">"Asterisk PBX"</span><span class="pln"> asterisk</span>

为 Asterisk 用户设置正确的权限:

<span class="pln">sudo chown </span><span class="pun">-</span><span class="pln">R asterisk</span><span class="pun">:</span> <span class="str">/var/</span><span class="pun">{</span><span class="pln">lib</span><span class="pun">,</span><span class="pln">log</span><span class="pun">,</span><span class="pln">run</span><span class="pun">,</span><span class="pln">spool</span><span class="pun">}/</span><span class="pln">asterisk </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">lib</span><span class="pun">/</span><span class="pln">asterisk </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">asterisk
sudo chmod </span><span class="pun">-</span><span class="pln">R </span><span class="lit">750</span> <span class="pun">/</span><span class="kwd">var</span><span class="pun">/{</span><span class="pln">lib</span><span class="pun">,</span><span class="pln">log</span><span class="pun">,</span><span class="pln">run</span><span class="pun">,</span><span class="pln">spool</span><span class="pun">}/</span><span class="pln">asterisk </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">lib</span><span class="pun">/</span><span class="pln">asterisk </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">asterisk</span>

重新启动 Asterisk 服务:

<span class="pln">sudo systemctl restart asterisk</span>

启用 Asterisk 服务以在系统引导时启动:

<span class="pln">sudo systemctl enable asterisk</span>

第 4 步。配置 Asterisk。

要使 Asterisk 正常运行,您需要根据需要对其进行配置。首先编辑用户会议 文件:

<span class="pln">sudo nano </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">asterisk</span><span class="pun">/</span><span class="pln">users</span><span class="pun">.</span><span class="pln">conf</span>

将用户添加到文件:

<span class="pun">[</span><span class="lit">6001</span><span class="pun">]</span><span class="pln">
fullname </span><span class="pun">=</span> <span class="typ">Example</span> <span class="typ">Bob</span><span class="pln">
secret </span><span class="pun">=</span> <span class="lit">1234</span><span class="pln">
hassip </span><span class="pun">=</span><span class="pln"> yes
context </span><span class="pun">=</span><span class="pln"> users
host </span><span class="pun">=</span> <span class="kwd">dynamic</span>

<span class="pun">[</span><span class="lit">6002</span><span class="pun">]</span><span class="pln">
fullname </span><span class="pun">=</span> <span class="typ">Example</span> <span class="typ">Joe</span><span class="pln">
secret </span><span class="pun">=</span> <span class="lit">1234</span><span class="pln">
hassip </span><span class="pun">=</span><span class="pln"> yes
context </span><span class="pun">=</span><span class="pln"> users
host </span><span class="pun">=</span> <span class="kwd">dynamic</span>

保存文件并重新加载配置:

<span class="pln">sudo asterisk </span><span class="pun">-</span><span class="pln">rx </span><span class="str">'core reload'</span>

第 5 步。连接到 Asterisk CLI。

要管理您的Asterisk服务器,您需要连接到Asterisk CLI。使用以下命令:

<span class="pln">sudo asterisk </span><span class="pun">-</span><span class="pln">rvv</span>

感谢您使用本教程在 Ubuntu 22.04 LTS Jammy Jellyfish 系统上安装 Asterisk 开源 PBX 平台。如需更多帮助或有用信息,我们建议您查看 Asterisk 官方网站


Edge插件网 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:如何在 Ubuntu 上安装 Asterisk 22.04 LTS
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址