几个简单的voip的小例子

  几个简单的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 





以上是一个初级配置,以后有好的再贴。
VoIPDemo is intended as a sample to show how to use the RTC API for Windows CE, but also as a working application for demonstration and use (taking note of the limitations described below). Limitiations ============= Currently supports 1 IM and/or 1 voice call at a time. 1 Voice call limitation due to RTC spec. 1 IM call simplifies event handling + need for multiple session windows Simultaneous voice and IM calls are only allowed from one source, currently identified by SIP URI. Callback functionality is currently not implemented. Component Requirements ====================== SYSGEN_VOIP will bring in all the components required by VoIPDemo. The target device needs to have audio capture and play capabilities and a network interface. Overview of program flow and source ==================================== VoIPDemo is separated into three main functional parts: User Interface, use of the RTC API (including RTC event handling), and the code to interface between RTC and the UI. The intent of this quasi- layering approach is to limit the direct hooks from the RTC backend to the UI and make it easier to re-use the RTC code in a different UI. The program goes through the following phases: Window Initialization RTC Initialization Main Message Loop RTC Termination Window Termination The main message loop manages all main window UI related messages and events. This includes contact list changes by the user, UI for call placement, etc. When the main window finishes its setup of an outgoing call, it calls the SessionWindow Callback to actually initiate the call. The SessionWindow is where all voice and IM session UI takes place. It is called directly by our RTC event handler to display call/IM status information, notify the user of incoming calls/messages, parse user input for outgoing messages, and calls the interface code to initi
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值