Asterisk配置iax服务器
做一个最基本的SIP以及IAX之间互相正常通信的测试。这对Asterisk的工作以及通信流程的了解相当有帮助。
一.配置Asterisk相关文件:
这里的配置我只是列出自己的定制部分,其他部分就不贴出来了。
1.IAX配置文件
[root@asterisk-test1 ~]# vi /etc/asterisk/iax.conf
-------------------------------------------------------------------------------------
[iax](!)
type=friend
context=test
disallow=all
allow=gsm
qualify=yes
host=dynamic
transfer=no
auth=md5
[8801](iax)
username=8801
secret=123456
context=test
[8802](iax)
username=8802
secret=123456
context=test
-------------------------------------------------------------------------------------
2.SIP配置文件
[root@asterisk-test1 ~]# vi /etc/asterisk/sip.conf
-------------------------------------------------------------------------------------
[sip](!)
type=friend
host=dynamic
disallow=all
allow=gsm
context=test
[9901](sip)
username=9901
secret=123456
[9902](sip)
username=9902
secrest=123456
-------------------------------------------------------------------------------------
3.配置拨号方案
[root@asterisk-test1 ~]# vi /etc/asterisk/extensions.conf
-------------------------------------------------------------------------------------
[test]
exten => _880X,1,Dial(IAX2/${EXTEN},,r)
exten => _990X,1,Dial(SIP/${EXTEN},,r)
-------------------------------------------------------------------------------------
二.进入控制台调试:
[root@asterisk-test1 asterisk]# asterisk -crvvv
-------------------------------------------------------------------------------------
Asterisk 1.4.5, Copyright (C) 1999 - 2007 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.
=========================================================================
== Parsing '/etc/asterisk/asterisk.conf': Found
== Parsing '/etc/asterisk/extconfig.conf': Found
Connected to Asterisk 1.4.5 currently running on asterisk-test1 (pid = 19690)
Verbosity is at least 47
Core debug is at least 255
调整Debug级别
asterisk-test1*CLI> core set debug 255
Core debug is at least 255
重新载入IAX配置
asterisk-test1*CLI> iax2 reload
== Parsing '/etc/asterisk/iax.conf': Found
== Parsing '/etc/asterisk/users.conf': Found
== Loaded firmware 'iaxy.bin'
== Parsing '/etc/asterisk/iaxprov.conf': Found
-- Loaded provisioning template 'default'
重新载入SIP配置
asterisk-test1*CLI> sip reload
Reloading SIP*CLI>
== Parsing '/etc/asterisk/sip.conf': Found
== Parsing '/etc/asterisk/users.conf': Found
== Parsing '/etc/asterisk/sip_notify.conf': Found
重新载入拨号规则配置
asterisk-test1*CLI> extensions reload
== Parsing '/etc/asterisk/extensions.conf': Found
== Setting global variable 'CONSOLE' to 'Console/dsp'
== Setting global variable 'IAXINFO' to 'guest'
== Setting global variable 'TRUNK' to 'Zap/g2'
== Setting global variable 'TRUNKMSD' to '1'
-- Registered extension context 'test'
-- Added extension '_880X' priority 1 to test
-- Added extension '_990X' priority 1 to test
-------------------------------------------------------------------------------------
三.注册终端:
-------------------------------------------------------------------------------------
注册SIP终端9901
-- Registered SIP '9901' at 192.168.0.199 port 37624 expires 60
-- Saved useragent "eyeBeam release 1004p stamp 31962" for peer 9901
[Nov 5 14:47:33] NOTICE[19715]: chan_sip.c:12231 handle_response_peerpoke: Peer '9901' is now Reachable. (5ms / 2000ms)
这册SIP终端9902
-- Registered SIP '9902' at 192.168.0.149 port 23260 expires 3600
-- Saved useragent "eyeBeam release 1004p stamp 31962" for peer 9902
[Nov 5 14:48:21] NOTICE[19715]: chan_sip.c:12231 handle_response_peerpoke: Peer '9902' is now Reachable. (7ms / 2000ms)
注册IAX终端8801 (测试iax协议的终端可以去 http://www.zoiper.com/softphone/ 下载)
-- Registered IAX2 '8801' (AUTHENTICATED) at 192.168.0.199:4569
[Nov 5 15:06:32] NOTICE[19708]: chan_iax2.c:5699 update_registry: Restricting registration for peer '8801' to 60 seconds (requested 300)
注册IAX终端8802
-- Registered IAX2 '8802' (AUTHENTICATED) at 192.168.0.149:4569
[Nov 5 15:07:41] NOTICE[19707]: chan_iax2.c:5699 update_registry: Restricting registration for peer '8802' to 60 seconds (requested 300)
-------------------------------------------------------------------------------------
四.测试IAX之间呼叫:
1.IAX被叫方挂断
-------------------------------------------------------------------------------------
-- Accepting AUTHENTICATED call from 192.168.0.199:
接受经过验证的呼叫,接受8801呼叫8802。
> requested format = gsm,
> requested prefs = (),
> actual format = gsm,
> host prefs = (gsm),
> priority = mine
-- Executing [8802@test:1] Dial("IAX2/8801-4", "IAX2/8802||r") in new stack
执行8801通道4向8802进行呼叫。
-- Called 8802>
-- Call accepted by 192.168.0.149 (format gsm)
-- Format for call is gsm
协商编解码为GSM。
-- IAX2/8802-5 is ringing
被叫方8802通道5产生振铃。
-- IAX2/8802-5 answered IAX2/8801-4
被叫方8802通道5应答了主叫方8801通道4。
...通话...
-- Hungup 'IAX2/8802-5'
被叫方8802通道5首先挂断。
== Spawn extension (test, 8802, 1) exited non-zero on 'IAX2/8801-4'
-- Hungup 'IAX2/8801-4'
主叫方8801通道4之后断开。
-------------------------------------------------------------------------------------
2.IAX主叫方挂断
-------------------------------------------------------------------------------------
-- Accepting AUTHENTICATED call from 192.168.0.149:
接受经过验证的呼叫,结合8802呼叫8801。
> requested format = gsm,
> requested prefs = (),
> actual format = gsm,
> host prefs = (gsm),
> priority = mine
-- Executing [8801@test:1] Dial("IAX2/8802-2", "IAX2/8801||r") in new stack
执行8802通道2向8802进行呼叫。
-- Called 8801>
-- Call accepted by 192.168.0.199 (format gsm)
-- Format for call is gsm
协商编码呼叫为GSM。
-- IAX2/8801-5 is ringing
被叫方8801通道5进行振铃。
-- IAX2/8801-5 answered IAX2/8802-2
被叫方8801通道5应答了主叫方8802通道2。
...通话...
-- Hungup 'IAX2/8802-2'
主叫方8802通道2首先挂断。
== Spawn extension (test, 8801, 1) exited non-zero on 'IAX2/8801-5'
-- Hungup 'IAX2/8801-5'
被叫方8801通道5之后断开。
-------------------------------------------------------------------------------------
五.测试SIP 之间呼叫:
1.主叫方挂断
-------------------------------------------------------------------------------------
-- Executing [9902@test:1] Dial("SIP/9901-0854e7c8", "SIP/9902||r") in new stack
执行9901呼叫9902。
-- Called 9902>
-- SIP/9902-08552730 is ringing
被叫方9902振铃。
Internal RTCP NTP clock skew detected: lsr=1110524996, now=1174799434, dlsr=809841730 (12357:204ms), diff=745567292
-- SIP/9902-08552730 answered SIP/9901-0854e7c8
被叫方9902应答了主叫方9901。
-- Native bridging SIP/9901-0854e7c8 and SIP/9902-08552730
Internal RTCP NTP clock skew detected: lsr=1127362869, now=1174802408, dlsr=808530993 (12337:203ms), diff=761091454
建立连接,开始通话。
== Spawn extension (test, 9902, 1) exited non-zero on 'SIP/9901-0854e7c8'
主叫方9901挂断。
-------------------------------------------------------------------------------------
2.被叫方挂断
-------------------------------------------------------------------------------------
-- Executing [9902@test:1] Dial("SIP/9901-08549ad8", "SIP/9902||r") in new stack
执行9901呼叫9902。
-- Called 9902>
-- SIP/9902-0854fc30 is ringing
被叫方9902振铃。
Internal RTCP NTP clock skew detected: lsr=1110524996, now=1183429154, dlsr=809841730 (12357:204ms), diff=736937572
-- SIP/9902-0854fc30 answered SIP/9901-08549ad8
被叫方9902应答主叫方9901。
-- Native bridging SIP/9901-08549ad8 and SIP/9902-0854fc30
Internal RTCP NTP clock skew detected: lsr=1127362869, now=1183429827, dlsr=808530993 (12337:203ms), diff=752464035
建立连接,开始通话。
== Spawn extension (test, 9902, 1) exited non-zero on 'SIP/9901-08549ad8'
被叫方9902挂断。
-------------------------------------------------------------------------------------
六.测试IAX主叫SIP:
1.主叫方挂断
-------------------------------------------------------------------------------------
-- Accepting AUTHENTICATED call from 192.168.0.199:
接受经过验证的呼叫,8801呼叫9901。
> requested format = gsm,
> requested prefs = (),
> actual format = gsm,
> host prefs = (gsm),
> priority = mine
-- Executing [9901@test:1] Dial("IAX2/8801-2", "SIP/9901||r") in new stack
执行8801通道2呼叫9901。
-- Called 9901>
-- SIP/9901-0854e7c8 is ringing
被叫方9901振铃。
Internal RTCP NTP clock skew detected: lsr=1127362869, now=1141816690, dlsr=808530993 (12337:203ms), diff=794077172
-- SIP/9901-0854e7c8 answered IAX2/8801-2
被叫方9901应答主叫方8801通道2,建立连接,开始通话。
Internal RTCP NTP clock skew detected: lsr=1142150038, now=1142224038, dlsr=102498 (1:563ms), diff=28498
Internal RTCP NTP clock skew detected: lsr=1142150038, now=1142423096, dlsr=302972 (4:622ms), diff=29914
Internal RTCP NTP clock skew detected: lsr=1142477782, now=1142604149, dlsr=149422 (2:279ms), diff=23055
Internal RTCP NTP clock skew detected: lsr=1142477782, now=1142741562, dlsr=349962 (5:339ms), diff=86182
Internal RTCP NTP clock skew detected: lsr=1142805424, now=1142875129, dlsr=103874 (1:584ms), diff=34169
Internal RTCP NTP clock skew detected: lsr=1142805424, now=1143037482, dlsr=304414 (4:644ms), diff=72356
通话中。
== Spawn extension (test, 9901, 1) exited non-zero on 'IAX2/8801-2'
-- Hungup 'IAX2/8801-2'
主叫方8801通道2挂断。
-------------------------------------------------------------------------------------
2.被叫方挂断
-------------------------------------------------------------------------------------
-- Accepting AUTHENTICATED call from 192.168.0.199:
接受经过验证的呼叫,8801呼叫9901。
> requested format = gsm,
> requested prefs = (),
> actual format = gsm,
> host prefs = (gsm),
> priority = mine
-- Executing [9901@test:1] Dial("IAX2/8801-1", "SIP/9901||r") in new stack
执行8801通道2呼叫9901。
-- Called 9901>
-- SIP/9901-0854d248 is ringing
被叫方9901振铃。
Internal RTCP NTP clock skew detected: lsr=1127362869, now=1154364407, dlsr=808530993 (12337:203ms), diff=781529455
-- SIP/9901-0854d248 answered IAX2/8801-1
被叫方9901应答主叫方8801通道1。建立连接,开始通话。
Internal RTCP NTP clock skew detected: lsr=1155023403, now=1155058464, dlsr=52756 (0:804ms), diff=17695
Internal RTCP NTP clock skew detected: lsr=1155023403, now=1155203176, dlsr=277217 (4:229ms), diff=97444
Internal RTCP NTP clock skew detected: lsr=1155351087, now=1155366776, dlsr=18415 (0:280ms), diff=2726
Internal RTCP NTP clock skew detected: lsr=1155678855, now=1155767542, dlsr=127074 (1:938ms), diff=38387
Internal RTCP NTP clock skew detected: lsr=1155678855, now=1155914097, dlsr=351469 (5:362ms), diff=116227
通话中。
== Spawn extension (test, 9901, 1) exited non-zero on 'IAX2/8801-1'
-- Hungup 'IAX2/8801-1'
被叫方9901挂断。
-------------------------------------------------------------------------------------
七.测试SIP主叫IAX:
1.主叫方挂断
-------------------------------------------------------------------------------------
-- Executing [8801@test:1] Dial("SIP/9901-08549ad8", "IAX2/8801||r") in new stack
-- Called 8801
-- Call accepted by 192.168.0.199 (format gsm)
-- Format for call is gsm
-- IAX2/8801-1 is ringing
-- IAX2/8801-1 answered SIP/9901-08549ad8
Internal RTCP NTP clock skew detected: lsr=1127362869, now=1160125691, dlsr=808530993 (12337:203ms), diff=775768171
Internal RTCP NTP clock skew detected: lsr=1160782332, now=1160838023, dlsr=81526 (1:243ms), diff=25835
Internal RTCP NTP clock skew detected: lsr=1160782332, now=1160972114, dlsr=308281 (4:703ms), diff=118499
Internal RTCP NTP clock skew detected: lsr=1161109974, now=1161122977, dlsr=16973 (0:258ms), diff=3970
Internal RTCP NTP clock skew detected: lsr=1161109974, now=1161337308, dlsr=243662 (3:717ms), diff=16328
-- Hungup 'IAX2/8801-1'
== Spawn extension (test, 8801, 1) exited non-zero on 'SIP/9901-08549ad8'
-------------------------------------------------------------------------------------
2.被叫方挂断
-------------------------------------------------------------------------------------
-- Executing [8801@test:1] Dial("SIP/9901-0854e7c8", "IAX2/8801||r") in new stack
-- Called 8801>
-- Call accepted by 192.168.0.199 (format gsm)
-- Format for call is gsm
-- IAX2/8801-2 is ringing
-- IAX2/8801-2 answered SIP/9901-0854e7c8
Internal RTCP NTP clock skew detected: lsr=1127362869, now=1167447869, dlsr=808530993 (12337:203ms), diff=768445993
Internal RTCP NTP clock skew detected: lsr=1168103692, now=1168159910, dlsr=86245 (1:315ms), diff=30027
Internal RTCP NTP clock skew detected: lsr=1168103692, now=1168307381, dlsr=312344 (4:765ms), diff=108655
Internal RTCP NTP clock skew detected: lsr=1168431378, now=1168476183, dlsr=52559 (0:801ms), diff=7754
Internal RTCP NTP clock skew detected: lsr=1168431378, now=1168707218, dlsr=278593 (4:250ms), diff=2753
-- Hungup 'IAX2/8801-2'
== Spawn extension (test, 8801, 1) exited non-zero on 'SIP/9901-0854e7c8'
-------------------------------------------------------------------------------------
基本上IAX与SIP之间可以最基本地互相通信了。
本文转自http://blog.csdn.net/net_flyfox/article/details/4126674
有些小的修改
如有疑惑可以留言
转载于:https://www.cnblogs.com/yhyjy/archive/2012/07/25/2607809.html
Asterisk配置iax服务器相关推荐
- asterisk配置文详解
asterisk配置文详解 Configuration GuideYou've installed Asterisk and verified that it will start up.Now ...
- 服务器登录中心,为数据中心配置登陆服务器来进行远程访问
为数据中心配置登陆服务器来进行远程访问 (该功能只对企业版有效.) 概览 一般来说,数据中心限制通过SSH和Telnet直接访问远程设备.这样,要远程管理数据中心的设备,首先要连接到一个"登 ...
- win7怎么配置程序服务器错误日志文件,win7怎么配置程序服务器
win7怎么配置程序服务器 内容精选 换一换 园区智能体服务的边缘算法作业会下发到边缘节点服务器运行,需要在IEF侧注册并纳管边缘节点.园区智能体的算法作业是以容器应用的方式下发到边缘节点运行的,因此 ...
- WINDOWS SERVER 2003从入门到精通之配置DHCP服务器(上)
DHCP(Dynamic Hoat Configure Protocol)动态主机配置协议简称,首先我们先了解DHCP服务器的作用所在. 当企业计算机数量较多时,例如BENET公司中有300台计算机, ...
- 华为 日志服务器 配置文件,配置日志服务器
配置日志服务器 内容精选 换一换 您可以通过云日志服务,查看访问七层共享型负载均衡请求的详细日志记录,分析负载均衡的响应状态码,快速定位异常的后端服务器.您已经创建了七层负载均衡.您已经开通了云日志服 ...
- CentOS 6.4安装配置LNMP服务器(Nginx+PHP+MySQL)
这篇文章主要介绍了CentOS 6.4下配置LNMP服务器的详细步骤,需要的朋友可以参考下 准备篇 1.配置防火墙,开启80端口.3306端口 vi /etc/sysconfig/iptables - ...
- linux 11G R2 RAC 配置NTP服务器
11G RAC 配置NTP服务器tip01的IP:162.20.1.228 NTP服务端 tip02的IP:162.20.1.229 NTP客户端配置NTP服务器之前,确认服务器已装好NTP包[roo ...
- 怎样配置VNC服务器使其能在红帽企业Linux3系统引导时自动启动?
怎样配置VNC服务器使其能在红帽企业Linux3系统引导时自动启动? 解决方法: vncserver服务可以在系统引导时自动启动. 但是需要进行设置才能使之正常自动启动. 首先,编辑/etc/sysc ...
- iOS 下配置XMPP 服务器openfire详解
一.下载并安装openfire 1.到http://www.igniterealtime.org/downloads/index.jsp下载最新openfire for mac版 比如:Openfir ...
最新文章
- python爬微博关键字_一个简单的python爬虫实践,爬取包含关键词的新浪微博
- 小红伞和NOD32基于源码的免杀经验总结
- Jenkins安装入门
- android java判断字符串是否为空和是否是手机号和是否是数字,数字转中文
- OpenGL-坐标系
- P1420 最长连号(python3实现)
- python 矩阵除法_Python线性代数学习笔记——矩阵的基本运算和基本性质,实现矩阵的基本运算...
- 1014.QxORM移植
- IF Exists在Oracle中怎么用?
- 【数据库原理实验(openGauss)】金融场景化实验
- oracle 用户被锁定解决方法
- 保姆级别mysql 基础练习题
- RPM + yum 完美完装tomcat
- HTML5在豆瓣中的应用
- 微型计算机噪声要求国标,中国噪声标准(GB noise standards)
- vue设置网页title
- 【用户运营】滴滴出行活动策划、用户成长体系、用户增长逻辑分析
- 快速搭建Android应用后台服务器
- 【自然语言处理】【文本生成】UniLM:用于自然语言理解和生成的统一语言模型预训练
- Linux下的Html编辑器
热门文章
- 《C语言程序设计-现代方法》 笔记
- 康奈尔大学计算机生物学是,康奈尔生物专业排名2020年:读完一遍这篇就明白了...
- 如何在matlab代码中加一层分隔?
- 2023最新SSM计算机毕业设计选题大全(附源码+LW)之java白酒营销管理gh21y
- Matlab函数:filter(1 维数字滤波器)
- Anaconda/Pycharm下载安装时PIP Error:Cannot determine archive format...
- 【算法题】解数独-用深度优先搜索(DFS)算法解数独
- 乘风破浪IPO的七家科技潜力股,下半年能否在纳斯达克披荆斩棘?
- STM32F103C8T6+带FIFO的OV7670的输出测试图像实例代码
- Unity3D教程宝典之插件篇:Unity3D插件详细评测及教学下载