几个简单的voip的小例子

转载 2007年10月13日 22:31:00
 几个简单的voip的小例子
Jul 22, 2006
实验拓扑 

(phone A & phone B)-fxs-local router-----------(serial link,voip link)-------
remote router-fxo-PBX--phone C 


配置实例: 
1、基本配置: 



远端: Remote_Router#sh running-config 
Building configuration... 




hostname Remote_Router 
..................................................... 

interface Ethernet0 
ip address 192.168.1.2 255.255.255.0 
no ip directed-broadcast 
! 




router eigrp 100 
network 192.168.1.0 
no auto-summary 
! 
ip classless 
no ip http server 
! 
! 
! 
voice-port 1/1 
! 
voice-port 1/2 
! 
voice-port 1/3 
! 
dial-peer voice 10 pots 
destination-pattern 2203 
port 1/1 
! 

end 

本端: Local_Router#sh running-config 
Building configuration... 

.................................................... 
hostname Local_Router 

interface Ethernet0/0 
ip address 192.168.1.1 255.255.255.0 
half-duplex 
no clns route-cache 
! 
router eigrp 100 
network 192.168.1.0 
no auto-summary 

voice-port 1/0/0 
! 
voice-port 1/0/1 
! 
voice-port 1/1/0 
! 
voice-port 1/1/1 
! 

dial-peer voice 10 pots 
destination-pattern 2201 
port 1/0/0 
! 
dial-peer voice 20 pots 
destination-pattern 2202 
port 1/0/1 
! 
dial-peer voice 30 voip 
destination-pattern 2203 
session target ipv4:192.168.1.2 

end 




测试命令: 



call 通本端的两部电话机 
Local_Router#csim start 2201 
csim: called number = 2201, loop count = 1 ping count = 0 
. 
csim: loop = 1, failed = 0 
csim: call attempted = 1, setup failed = 0, tone failed = 1 
检查本地配置 
Local_Router#sh dial-peer voice summary 
dial-peer hunt 0 
AD PRE PASS OUT 
TAG TYPE MIN OPER PREFIX DEST-PATTERN FER THRU SESS-TARGET STAT PORT 
10 pots up up 2201 0 up 1/0/0 
20 pots up up 2202 0 up 1/0/1 
30 voip up up 2203 0 syst ipv4:192.168.1.2 
call 通远端的电话机(2203call通pbx,pbx提供2次拨号音,然后拨号468,对端电话号码响) 
Local_Router#csim start 2203,468 
csim: called number = 2203,468, loop count = 1 ping count = 0 
. 
csim: loop = 1, failed = 0 
csim: call attempted = 1, setup failed = 0, tone failed = 1 
其中","的含义是等待2秒 




下面给出几个需求可以稍作验证: 
1、需要配置语音网关的传真速率为9600,同时要消除舒服噪音。 

Local_Router#conf t 
Enter configuration commands, one per line. End with CNTL/Z. 
Local_Router(config)#dial-peer voice 30 
Local_Route(config-dial-peer)#fax rate 9600 
Local_Route(config-dial-peer)#end 
Local_Router#sh dial-peer voice 30 | in fax 
Cisc NSE=100, fax=96, fax-ack=97, dtmf=121, fax-relay=122 
fax rate = 9600, payload size = 20 bytes 
fax protocol = system 
fax-relay ecm enable 
fax NSF = 0xAD0051 (default) 
--------------------------------------------------------------------- 
针对舒服噪音,默认情况下 
Local_Router#sh voice port 1/0/0 



Foreign Exchange Station 1/0/0 Slot is 1, Sub-unit is 0, Port is 0 
Type of VoicePort is FXS 
Operation State is DORMANT 
Administrative State is UP 
No Interface Down Failure 
Description is not set 
Noise Regeneration is enabled-----------------------------〉打开 
Non Linear Processing is enabled 
。 
。 
。 
。 
配置后: 
Local_Router#conf t 
Enter configuration commands, one per line. End with CNTL/Z. 
Local_Router(config)#voice-port 1/0/0 
Local_Route(config-voiceport)#no comfort-noise 
Local_Route(config-voiceport)#end 
Local_Router# 
*Mar 1 00:37:19.735: %SYS-5-CONFIG_I: Configured from console by console 
Local_Router#sh voice port 1/0/0 



Foreign Exchange Station 1/0/0 Slot is 1, Sub-unit is 0, Port is 0 
Type of VoicePort is FXS 
Operation State is DORMANT 
Administrative State is UP 
No Interface Down Failure 
Description is not set 
Noise Regeneration is disabled---------------------------〉关掉了 
Non Linear Processing is enabled 



2、需求配置所有跑到VOIP上面的流量将优先级设置为1(我的设备不支持这一个所以没有作),同时采
用缩位拨号。 
Local_Router#conf t 
Enter configuration commands, one per line. End with CNTL/Z. 
Local_Router(config)#num-exp 0 2201 
Local_Router(config)#end 
Local_Router#sh num-exp 
Dest Digit Pattern = '0' Translation = 
'2201' 



3、需求配置跑在VOIP上的最大连接数为100,同时要求电话B先响。 
Local_Router#conf t 
Enter configuration commands, one per line. End with CNTL/Z. 
Local_Router(config)#dial-peer voice 30 
Local_Route(config-dial-peer)#max-conn 100 
Local_Route(config-dial-peer)#exit 
Local_Router(config)#dial-peer voice 10 
Local_Route(config-dial-peer)#preference 1 
Local_Route(config-dial-peer)#end 

Local_Router#sh dial-peer voice 30 | in max 
incoming called-number = `', connections/maximum = 0/100, 
incoming COR list:maximum capability 

Local_Router#sh dial-peer voice su 
dial-peer hunt 0 
AD PRE PASS OUT 
TAG TYPE MIN OPER PREFIX DEST-PATTERN FER THRU SESS-TARGET STAT PORT 
10 pots up up 2201 1 up 1/0/0 
20 pots up up 2202 0 up 1/0/1 
30 voip up up 2203 0 syst ipv4:192.168.1.2 



4、需求配置语音网关2为次选 
Local_Router#conf t 
Enter configuration commands, one per line. End with CNTL/Z. 
Local_Router(config)#dial-peer voice 40 voip 
Local_Route(config-dial-peer)#destination-pattern 2203 
Local_Route(config-dial-peer)#session target ipv4:4.1.1.1 
Local_Route(config-dial-peer)#preference 1 
Local_Route(config-dial-peer)#end 



Local_Router#show dial-peer voice summary 
dial-peer hunt 0 
AD PRE PASS OUT 
TAG TYPE MIN OPER PREFIX DEST-PATTERN FER THRU SESS-TARGET STAT PORT 
10 pots up up 2201 1 up 1/0/0 
20 pots up up 2202 0 up 1/0/1 
30 voip up up 2203 0 syst ipv4:192.168.1.2 
40 voip up up 2203 1 syst ipv4:4.1.1.1 





以上是一个初级配置,以后有好的再贴。

voip开源库

最新要做一个移动端视频通话软件,大致看了下现有的开源软件 转 一) sipdroid 1)架构 sip协议栈使用JAVA实现,音频Codec使用skype的silk(Silk编解码是Sky...
  • Bluehzw
  • Bluehzw
  • 2016-07-27 17:43:33
  • 1528

基于Asterisk的VoIP开发指南——Asterisk 模块编写指南(1)

1 开源项目概述Asterisk是一个开源的软件包,通常运行在Linux操作系统平台上。Asterisk可以用三种协议来实现VoIP,同时可以与目前电话使用的标准硬件进行交互通信,Asterisk在实...
  • lin_bei
  • lin_bei
  • 2008-06-11 17:29:00
  • 9195

基于Linux开源VOIP系统LinPhone[一]

LinPhone是一个网络电话或者IP语音电话(VOIP),是一款遵循GPL的开源的网络视频电话系统,其主要如下: 使用linphone,我们可以在互联网上随意的通信,通过语音、视频、即时文本消息。 ...
  • wavemcu
  • wavemcu
  • 2013-01-26 11:56:47
  • 14465

sip-js客户端js框架

  • 2012年06月24日 23:17
  • 594KB
  • 下载

几个简单的voip的小例子

 几个简单的voip的小例子Jul 22, 2006实验拓扑 (phone A & phone B)-fxs-local router-----------(serial link,voip link...
  • xwchen
  • xwchen
  • 2007-10-13 22:31:00
  • 1076

FreeSWITCH+<em>VoIP+</em>实战.pdf

《FreeSWITCH+<em>VoIP+</em>实战》中文PDF版 综合评分:4 收藏(3)评论(25)举报 所需: 10积分/C币 下载个数: 310 开通VIP 立即下载 评论共有25条 hcxheai 2017-09-...
  • 2018年04月09日 00:00

voip及源代码

  • 2008年05月24日 10:33
  • 3.38MB
  • 下载

一些简单的C++小程序。

  • 2015年03月14日 14:07
  • 2KB
  • 下载

VOIP开源项目源码地址

VoIP bookmarks from Klaus Darilion Below you will find descriptions and links to SIP and RTP stac...
  • htt9931
  • htt9931
  • 2015-04-14 16:38:52
  • 1660

<em>VOIP网络电话</em>实例源码与开发文档,支持c#

2016-11-03 上传大小:38.05MB <em>VOIP网络电话</em>c# 最新版本,需要需要注册OCX控件, 支持语言:C#/DELPHI/VB/VB.NET/JS等 文件中包含调用的源码、文档和控件 ...
  • 2018年04月10日 00:00
收藏助手
不良信息举报
您举报文章: 几个简单的voip的小例子
举报原因:
原因补充:

(最多只允许输入30个字)