Asterist搭建步骤
环境:
# cat /proc/version
Linux version 2.6.18-308.el5 (mockbuild@x86-010.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Fri Jan 27 17:21:15 EST 2012
步骤:
1、下载安装文件
asterisk-11-current.tar.gz
地址:http://www.asterisk.org/downloads
http://downloads.asterisk.org/pub/telephony/asterisk/
相关解释:
Asterisk Downloads
Download the currently supported versions of Asterisk and various Asterisk-related open source projects.
Asterisk Communications Framework • AsteriskNOW Software PBX • DAHDI • LIBPRIAsterisk Communications Framework
Asterisk is an open source toolkit for building communications applications. For a more detailed explanation, check out the Get Started section.
For more information on how to use Asterisk, see the Configuration and Operation section of the wiki.What is LIBPRI?
LIBPRI is an open source library that encapsulates the protocols used to communicate over ISDN Primary Rate Interfaces (T1, E1, J1).LIBPRI is a dependency for Asterisk and DAHDI if PRI signaling is used. http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gzWhat is DAHDI?
DAHDI (Digium/Asterisk Hardware Device Interface) is the open source device interface technology used to control Digium and other legacy telephony interface cards. DAHDI Linux / DAHDI Tools
DAHDI Linux is the open source device driver framework used to interface Asterisk with telephony hardware.DAHDI Tools is a package of utilities for managing and monitoring DAHDI devices.The download on this page provides a combined package of the latest DAHDI Linux with the latest DAHDI Tools.
http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz2、安装过程将asterisk-11-current.tar.gz放到目录/opt/asterisk/(这个路径可以随意指定,只要空间足够即可)下解压缩:tar –xzvf asterisk-11-current.tar.gz进行源文件目录asterisk-11.5.1执行下列命令./configure执行结果的最后几行:.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }make执行结果的最后几行:tline/libedit.a -> asterisk
Building Documentation For: channels pbx apps codecs formats cdr cel bridges funcs tests main res addons
+--------- Asterisk Build Complete ---------+
+ Asterisk has successfully been built, and +
+ can be installed by running: +
+ +
+ make install +
+-------------------------------------------+.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }make install执行结果的最后几行:for x in images/*.jpg; do \
/usr/bin/install -c -m 644 $x "/var/lib/asterisk/images" ; \
done
make -C sounds install
make[1]: Entering directory `/opt/drivers2/asterisk-11.5.1/sounds'
make[1]: Leaving directory `/opt/drivers2/asterisk-11.5.1/sounds'
+---- Asterisk Installation Complete -------+
+ +
+ YOU MUST READ THE SECURITY DOCUMENT +
+ +
+ Asterisk has successfully been installed. +
+ If you would like to install the sample +
+ configuration files (overwriting any +
+ existing config files), run: +
+ +
+ make samples +
+ +
+----------------- or ---------------------+
+ +
+ You can go ahead and install the asterisk +
+ program documentation now or later run: +
+ +
+ make progdocs +
+ +
+ **Note** This requires that you have +
+ doxygen installed on your local system +
+-------------------------------------------+.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }make samples执行结果的最后几行:/usr/bin/install -c -m 644 "/etc/asterisk/asterisk.conf.tmp" "/etc/asterisk/asterisk.conf" ; \
rm -f "/etc/asterisk/asterisk.conf.tmp" ; \
fi ; \
/usr/bin/install -c -d "/var/spool/asterisk/voicemail/default/1234/INBOX"
Updating asterisk.conf
build_tools/make_sample_voicemail "//var/lib/asterisk" "//var/spool/asterisk"
Installing file phoneprov/000000000000.cfg
Installing file phoneprov/000000000000-directory.xml
Installing file phoneprov/000000000000-phone.cfg
Installing file phoneprov/polycom_line.xml
Installing file phoneprov/polycom.xml
Installing file phoneprov/snom-mac.xml.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }make config3、安装完成后asterisk进程也启起来了/bin/sh /usr/sbin/safe_asterisk4、修改sip.conf和extendsion.conf文件sip.conf的最下方增加小节(添加用户,本例增加两个用户9001和9002):[9001]
type=friend
username=9001
secret=9001
host=dynamic
context=demo
disallow=all
allow=alaw;这个地方需要注意一定要和客户端(eyeBeam或X-Lite)保持一致,此例都设为alaw
dtmfmode=rfc2833
canreinvite=no
maxcallbitrate=384
[9002]
type=friend
username=9002
secret=9002
host=dynamic
context=demo
disallow=all
allow=alaw
dtmfmode=rfc2833
canreinvite=no
maxcallbitrate=384.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }extensions.conf的最下面增加一个小节:[demo]//上面用到
exten => _9.,1,Dial(SIP/${EXTEN},20,r).csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }说明:
(1)规则就一条,使得9001 和9002 可以互相拨打。当中的格式简要讲述一下。更多的请参考
Asterisk 的手册,这里不详细展开。
(2)开头部分“exten =>”表示,也可以用“exten =”表示。并且在一个小节内可以定义多
条exten 语句。
(3)之后的“_9”表示匹配上所有“9”开头的拨号,“.”表示不限制长度的任意字符。
(4)然后的“1”表示优先级,我喜欢称作为“执行次序”。“1”表示第一步执行的意思,如果
后续还需要执行其他动作的话,可以继续写多条exten 语句,并且用递增执行次序依次设计下去。
(5)接着的“Dail()”表示“执行动作”,这里是表示拨号的执行动作。更规范的说,这个是
APP 应用程序。
(6)括号当中又分成3 个部分。第一个SIP 表示拨号动作中拨向的通道是SIP 协议的通道。$
{EXTEN}则一个变量,其值就是用户实际拨打的号码。如果你拨打9001 那么${EXTEN}的值就是
9001。
(7)括号内的“20”,表示等待时间单位秒,如果有多个执行次序,即一组拨号规则的话,如果
过了20 秒,就跳跃执行次序(跳跃的幅度是101 个优先级)。
(最后的“r”表示强行播放振铃。在拨打对方等待对方接通的时候,就能听到回振铃音。.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }4、进行asterist的控制台重新加载文件sip.conf,extensions.confasterisk –gcrvvvvvv
直接启动后连接到Asterisk控制台
注意,启动脚本是“safe_asterisk”,当启动起来后察看进程也能看到这个名字的进程。.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }IVRServer*CLI> sip reload
Reloading SIP
== Parsing '/etc/asterisk/sip.conf': Found
== Parsing '/etc/asterisk/users.conf': Found
== Using SIP CoS mark 4
== Parsing '/etc/asterisk/sip_notify.conf': Found.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }控制台相关命令:; Useful CLI commands to check peers/users:
; sip show peers Show all SIP peers (including friends)
; sip show registry Show status of hosts we register with
;
; sip set debug on Show all SIP messages
;
; sip reload Reload configuration file
; sip show settings Show the current channel configuration.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }5、然后使用eyeBeam或X-Lite注册sip,然后拨打电话即可如果编码客户端和服务器设置的不一致,就会报错:IVRServer*CLI>
== Using SIP RTP CoS mark 5
[Sep 4 16:52:47] NOTICE[2680][C-00000001]: chan_sip.c:10523 process_sdp: No compatible codecs, not accepting this offer!
== Using SIP RTP CoS mark 5
-- Executing [9002@demo:1] Dial("SIP/9001-00000002", "SIP/9002,20,r") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/9002
== Everyone is busy/congested at this time (1:0/0/1)
-- Auto fallthrough, channel 'SIP/9001-00000002' status is 'CHANUNAVAIL'.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }解决办法就是将编码设置一致,本例中都设为G.711Alaw语音编解码.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
Asterist搭建步骤的更多相关文章
- Java Web 环境搭建步骤(超详细,包括前期安装步骤)
Java Web 环境搭建步骤 安装对应版本的JDK 配置环境变量 本人安装的路径是C盘,在path中加入C:\Program Files\Java\jdk1.8.0_65\bin 测试配置成功,cm ...
- Linux vagrant+virtualbox环境搭建步骤
Linux vagrant+virtualbox环境搭建步骤 Vagrant 是一款用来构建虚拟开发环境的工具,非常适合 php/python/ruby/java 这类语言开发 web 应用. 我们可 ...
- SSH三大框架合辑的搭建步骤
v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VM ...
- cocos2d-lua 3.5 android搭建步骤
cocos2d-lua 3.5 android搭建步骤 如何安装eclipse,jdk,android sdk,ndk这里都不说了,资料很多,而且以前用eclipse搭建cocos2d-x-c++的时 ...
- IIS HTTP文件服务器搭建步骤
利用IIS搭建HTTP文件服务器,可下载.上传(用户名验证) 1.右键网站,添加应用程序 2.物理路径,选择系统的目录配置,上一层 别名:CAPI3FileService 3.效果如下: 4.(以下步 ...
- [转]MonkeyRunner在Windows下的Eclipse开发环境搭建步骤(兼解决网上Jython配置出错的问题)
MonkeyRunner在Windows下的Eclipse开发环境搭建步骤(兼解决网上Jython配置出错的问题) 网上有一篇shangdong_chu网友写的文章介绍如何在Eclipse上配置M ...
- mysql 主从搭建步骤
mysql 主从搭建步骤 1:主库开启master端bin-log 2:主库创建备份用户 3:主库全备 4:从库导入全备数据 5:从库修改change master to信息 6:从库slave st ...
- Hadoop集群搭建步骤
实验性操作是在虚拟机里进行的,除了搭建hadoop本身的操作之外,遇到的其它问题总结如下: 1. 虚拟机挂载windows磁盘: 添加硬件,要保证该硬件此时没有被读写访问等,因为挂载后,该磁盘在宿主机 ...
- 在Android Studio上测试运行,Unity发布成Android包的环境搭建步骤
我用的是unity5.4.3版本,jdk是1.8.0_131版本,Android-SDK是r24.4.1版本,Android-NDK是r13b版本,作者是刚开始写博客,希望对在unity摸索的人有 ...
随机推荐
- ASP.NET MVC Ajax 伪造请求
1.前言 CSRF(Cross-site request forgery)跨站请求伪造,ASP.NET MVC 应用通过使用AJAX请求来提升用户体验,浏览器开发者工具可以一览众山小,就很容易伪造了请 ...
- 解决:无法将文件“obj\x86\Debug\Windows123.exe”复制到“bin\Debug\Windows123.exe”。
警告 加载属性“OutputPath”失败. 输入的路径不是有效的输出路径. 解决方案: 先项目打包备份一下哦,再执行以下操作哦. 1.右键项目属性, 发布,发布位置修改成 publish\ 生成 , ...
- net_framework-EF CodeFirst
CodeFirst——手动创建POCO类(Plain Old CLR Object,即平时认识的ado.net实体类),类之间的关系使用代码定义.当应用程序首次执行时,EF将在数据库服务器中自动生成数 ...
- (一)Mahapps安装与使用
一.Mahapps安装 1.NuGet程序包安装 右击项目-->选择 “管理Nuget程序包”-->搜索“MahApps.Metro” 2.包管理控制台 选择“工具”-->“NuGe ...
- Kettle 使用入门
Kettle是一款国外开源的ETL工具,纯java编写,可以在Window.Linux.Unix上运行,数据抽取高效稳定. 本文介绍一个入门例子:使用Kettle从动态指定的文件名对应的文本文件里抽取 ...
- Day44 数据库的操作
视图操作: 1.左连接查询 select * from person left join dept on person.dept_id = dept.did 2. 右连接 3. 内连接 inner ...
- Java的入门知识和环境配置
JVM(Java Virtual Machine)Java虚拟机 JVM是一种用于计算设备的规范,它是一个虚构出来的计算机,是通过在实际的计算机上仿真模拟各种计算机功能来实现的. JAVA语言非常重要 ...
- Android代码编译出现的错误
一.decoupled apps failed 解耦应用程序失败 2.每次编译时候一定先扩充内存 export JACK_SERVER_VM_ARGUMENTS="-Dfile.encod ...
- Access 2010 应用基础 单元三:SQL查询
导语:Access查询中拉差距的部分 简单查询 [是基于单个表的查询] 无条件从数据表中选择部分字段 Select 字段列表 from 数据表 无条件从数据表中选择全部字段 Select 字段列表 f ...
- javaweb 项目的异常处理
首先关于异常的分类: java 中关于异常的分类情况是:throwable 是所有异常和错误的基类,下面在分为Error 和 Exception: 简单的异常体系结构如下图所示: 其中Exceptio ...