asterisk简单实用

一、hello wold:

1、启动dadhi、asterisk后,输入下面命令可以进入asterisk的命令行

# asterisk -vvgc
Asterisk already running on /var/run/asterisk/asterisk.ctl.  Use 'asterisk -r' to connect.
# asterisk -r
Asterisk 14.7.6, Copyright (C) 1999 - 2016, Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 14.7.6 currently running on mbd-toutiao-worker-online109-shgq (pid = 8742)
mbd-toutiao-worker-online109-shgq*CLI> 
补充:启动dadhi可以用service dadhi start

2、配置asterisk

1)extensions.conf文件:

cd /etc/asterisk
mv extensions.conf extensions.sample
vim extensions.conf

[from-internal]
exten = 100,1,Answer()
same = n,Wait(1)
same = n,Playback(hello-world)
same = n,Hangup()

2)sip.conf

备份sip.conf,然后

[general]
context=default

[6001]
type=friend
context=from-internal
host=dynamic
secret=unsecurepassword
disallow=all
allow=ulaw
3)重启asterisk

4)查看用户

mbd-toutiao-worker-online109-shgq*CLI> sip show users
Username                   Secret           Accountcode      Def.Context      ACL  Forcerport
6001                       unsecurepasswor                   from-internal    No   No   

每次修改sip.conf后可以使用下面命令重新加载

mbd-toutiao-worker-online109-shgq*CLI> sip reload
mbd-toutiao-worker-online109-shgq*CLI>

每次修改extension.conf文件后可以使用下面命令重新加载

mbd-toutiao-worker-online109-shgq*CLI> dialplan reload
Dialplan reloaded.

3、下载客户端测试

1)在Windows上下载eyeBeam

2)配置eyeBeam:

右键,然后选择sip

3)添加配置

4)保存后,根据extension.conf设置的拨号规则,直接拨打100,就会有反应。


参考:

https://wiki.asterisk.org/wiki/display/AST/Hello+World

http://blog.youkuaiyun.com/u010148712/article/details/53241700

https://my.oschina.net/u/2404183/blog/709215

https://danielfree.net/archives/1081/

https://hello.lanbing.org/post/2013142.html

https://www.zybuluo.com/Lee2011/note/32706

http://blog.duxin.info/sip-setup/

http://blog.youkuaiyun.com/brandon2015/article/details/51811914

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

赶路人儿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值