Sơ đồ:
Yêu cầu:
Thực hiện:
Bước 1. Cấu hình PSTN Gateway giả lập môi trường PSTN.
Cấu hình PSTN Gateway.
Router(config)#hostname PSTN
PSTN(config)#card type e1 0 2
PSTN(config)#card type e1 0 2
PSTN(config)#card type e1 0 2
PSTN(config)#card type e1 0 2
PSTN(config)#card type e1 0 2
PSTN(config)#network-clock-participate wic 2
PSTN(config)#network-clock-select 1 e1 0/2/0
PSTN(config)#network-clock-select 2 e1 0/2/1
PSTN(config)#isdn switch-type primary-net5
PSTN(config)#controller e1 0/2/0
PSTN(config-controller)# framing NO-CRC4
PSTN(config-controller)# pri-group timeslots 1-31
PSTN(config-controller)# clock source internal
PSTN(config-controller)# description Connect to E1 VnPro
PSTN(config-controller)# exit
PSTN(config)#interface Serial0/2/0:15
PSTN(config-if)# no ip address
PSTN(config-if)# encapsulation hdlc
PSTN(config-if)# isdn switch-type primary-net5
PSTN(config-if)# isdn protocol-emulate network
PSTN(config-if)# isdn incoming-voice voice
PSTN(config-if)# no cdp enable
PSTN(config-if)# exit
PSTN(config)#dial-peer voice 1 pots
PSTN(config-dial-peer)# destination-pattern 0286288721.
PSTN(config-dial-peer)# port 0/2/0:15
PSTN(config-dial-peer)# forward-digit 9
PSTN(config-dial-peer)# exit
PSTN(config)#dial-peer voice 2 pots
PSTN(config-dial-peer)# !destination-pattern 86288722[^2,7]
PSTN(config-dial-peer)# destination-pattern 0286288722[0-1,3-6,8-9]
PSTN(config-dial-peer)# port 0/2/0:15
PSTN(config-dial-peer)# forward-digit 9
PSTN(config-dial-peer)# exit
PSTN(config)#dial-peer voice 3 pots
PSTN(config-dial-peer)# destination-pattern 0286288723.
PSTN(config-dial-peer)# port 0/2/0:15
PSTN(config-dial-peer)# forward-digit 9
PSTN(config-dial-peer)# exit
PSTN(config)#dial-peer voice 4 pots
PSTN(config-dial-peer)# destination-pattern 0286288762[0-1]
PSTN(config-dial-peer)# port 0/2/0:15
PSTN(config-dial-peer)# forward-digit 9
PSTN(config-dial-peer)# exit
PSTN(config)#dial-peer voice 5 pots
PSTN(config-dial-peer)# incoming called-number .
PSTN(config-dial-peer)# direct-inward-dial
PSTN(config-dial-peer)# exit
PSTN(config)#line vty 0 4
PSTN(config-line)# privilege level 15
PSTN(config-line)# no login
PSTN(config-line)# exec-timeout 0 0
PSTN(config-line)# exit
PSTN(config)#line console 0
PSTN(config-line)# logging synchronous
PSTN(config-line)# exec-timeout 0 0
PSTN(config-line)# exit
PSTN(config)#no ip domain-lookup
PSTN(config)#interface f0/0
PSTN(config-if)# description Ket noi toi Phone 01268772021
PSTN(config-if)# ip address 200.0.0.1 255.255.255.0
PSTN(config-if)# no shutdown
PSTN(config-if)# exit
PSTN(config)#ip dhcp excluded-address 200.0.0.1
PSTN(config)#ip dhcp pool Voice
PSTN(dhcp-config)# network 200.0.0.1 255.255.255.0
PSTN(dhcp-config)# default-router 200.0.0.1
PSTN(dhcp-config)# option 150 ip 200.0.0.1
PSTN(dhcp-config)# exit
PSTN(config)#exit
PSTN#clock set 12:00:00 9 Nov 2017
PSTN#configure terminal
PSTN(config)#telephony-service
PSTN(config-telephony)# ip source-address 200.0.0.1 port 2000
PSTN(config-telephony)# max-dn 144
PSTN(config-telephony)# max-ephones 30
PSTN(config-telephony)# no auto-reg-ephone
PSTN(config-telephony)# cnf-file perphone
PSTN(config-telephony)# exit
PSTN(config)#ephone-dn 1 dual-line
PSTN(config-ephone-dn)# number 01268772021
PSTN(config-ephone-dn)# name bqk(01268772021)
PSTN(config-ephone-dn)# exit
PSTN(config)#ephone 1
PSTN(config-ephone)# mac-address 0014.6a4d.37db
PSTN(config-ephone)# type 7960
PSTN(config-ephone)# button 1:1
PSTN(config-ephone)# codec g711ulaw
PSTN(config-ephone)# restart
PSTN(config-ephone)# exit
PSTN(config)#telephony-service
PSTN(config-telephony)# no create cnf-file
PSTN(config-telephony)# create cnf-file
PSTN(config-telephony)# exit
Bước 2. Cấu hình E1 trên Voice Gateway.
Cấu hình Voice Gateway.
Router(config)#hostname VoiceGateway
VoiceGateway(config)#card type e1 0 2
VoiceGateway(config)#card type e1 0 2
VoiceGateway(config)#card type e1 0 2
VoiceGateway(config)#card type e1 0 2
VoiceGateway(config)#card type e1 0 2
VoiceGateway(config)#network-clock-participate wic 2
VoiceGateway(config)#network-clock-participate wic 2
VoiceGateway(config)#network-clock-participate wic 2
VoiceGateway(config)#network-clock-select 1 e1 0/2/0
VoiceGateway(config)#isdn switch-type primary-net5
VoiceGateway(config)#controller e1 0/2/0
VoiceGateway(config-controller)# pri-group timeslots 1-31
VoiceGateway(config-controller)# framing NO-CRC4
VoiceGateway(config-controller)# linecode hdb3
VoiceGateway(config-controller)# clock source line primary
VoiceGateway(config-controller)# exit
VoiceGateway(config)#interface Serial0/2/0:15
VoiceGateway(config-if)# shutdown
VoiceGateway(config-if)# no ip address
VoiceGateway(config-if)# encapsulation hdlc
VoiceGateway(config-if)# isdn switch-type primary-net5
VoiceGateway(config-if)# isdn incoming-voice voice
VoiceGateway(config-if)# no cdp enable
VoiceGateway(config-if)# no shutdown
VoiceGateway(config-if)# exit
VoiceGateway(config)#dial-peer voice 1 pots
VoiceGateway(config-dial-peer)# destination-pattern .T
VoiceGateway(config-dial-peer)# port 0/2/0:15
VoiceGateway(config-dial-peer)# forward-digit all
VoiceGateway(config-dial-peer)# exit
VoiceGateway(config)#interface f0/1
VoiceGateway(config-if)# description Ket noi toi SIP Registrar
VoiceGateway(config-if)# ip address 172.16.1.254 255.255.255.0
VoiceGateway(config-if)# no shutdown
VoiceGateway(config-if)# exit
VoiceGateway(config)#ip route 192.168.1.0 255.255.255.0 172.16.1.1
VoiceGateway(config)#voice service voip
VoiceGateway(conf-voi-serv)# allow-connections h323 to h323
VoiceGateway(conf-voi-serv)# allow-connections sip to h323
VoiceGateway(conf-voi-serv)# allow-connections h323 to sip
VoiceGateway(conf-voi-serv)# exit
VoiceGateway(config)#voice service voip
VoiceGateway(conf-voi-serv)# ip address trusted list
VoiceGateway(cfg-iptrust-list)# ipv4 192.168.1.0 255.255.255.0
VoiceGateway(cfg-iptrust-list)# ipv4 172.16.1.0 255.255.255.0
VoiceGateway(cfg-iptrust-list)# exit
VoiceGateway(conf-voi-serv)# exit
VoiceGateway(config)#dial-peer voice 1000 voip
VoiceGateway(config-dial-peer)# destination-pattern 8...
VoiceGateway(config-dial-peer)# session target ipv4:172.16.1.1
VoiceGateway(config-dial-peer)# session protocol sipv2
VoiceGateway(config-dial-peer)# codec g711ulaw
VoiceGateway(config-dial-peer)# exit
VoiceGateway# csim start 01268772021
VoiceGateway# show ip interface brief
VoiceGateway# show interfaces s0/2/0:15
Serial0/2/0:15 is up, line protocol is up (spoofing)
Hardware is DSX1
MTU 1500 bytes, BW 64 Kbit/sec, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, loopback not set
Keepalive set (10 sec)
Last input 00:00:07, output never, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops:0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 48 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
41 packets input, 186 bytes, 0 no buffer
Received 0 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
41 packets output, 205 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
1 carrier transitions
Timeslot(s) Used:16, SCC: 0, Transmitter delay is 0 flags
VoiceGateway#
VoiceGateway# show ip interface s0/2/0:15
Serial0/2/0:15 is up, line protocol is up
Internet protocol processing disabled
VoiceGateway#
Kiểm tra thông tin Layer 1.
VoiceGateway# show network-clocks
Network Clock Configuration
---------------------------
Priority Clock Source Clock State Clock Type
1 E1 0/2/0 GOOD E1
10 Backplane GOOD PLL
Current Primary Clock Source
---------------------------
Priority Clock Source Clock State Clock Type
1 E1 0/2/0 GOOD E1
VoiceGateway#
VoiceGateway# show voice port 0/2/0:15
ISDN 0/2/0:15 Slot is 0, Subslot is 2, Sub-unit is 0, Port is 15
Type of VoicePort is ISDN-VOICE
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
Non Linear Mute is disabled
Non Linear Threshold is -21 dB
Music On Hold Threshold is Set to -38 dBm
In Gain is Set to 0 dB
Out Attenuation is Set to 0 dB
Echo Cancellation is enabled
Echo Cancellation NLP mute is disabled
Echo Cancellation NLP threshold is -21 dB
Echo Cancel Coverage is set to 128 ms
Echo Cancel worst case ERL is set to 6 dB
Playout-delay Mode is set to adaptive
Playout-delay Nominal is set to 60 ms
Playout-delay Maximum is set to 1000 ms
Playout-delay Minimum mode is set to default, value 40 ms
Playout-delay Fax is set to 300 ms
Connection Mode is normal
Connection Number is not set
Initial Time Out is set to 15 s
Interdigit Time Out is set to 10 s
Call Disconnect Time Out is set to 60 s
Ringing Time Out is set to 180 s
Wait Release Time Out is set to 30 s
Companding Type is A-law
Region Tone is set for US
Station name None, Station number None
Translation profile (Incoming):
Translation profile (Outgoing):
Voice class called number pool:
lpcor (Incoming):
lpcor (Outgoing):
DS0 channel specific status info:
IN OUT
PORT CH SIG-TYPE OPER STATUS STATUS TIP RING
=============== == ============ ==== ====== ====== === ====
0/2/0:15 01 isdn-voice dorm none none
0/2/0:15 02 isdn-voice dorm none none
…
0/2/0:15 31 isdn-voice dorm none none
VoiceGateway#
VoiceGateway# show voice port summary
IN OUT
PORT CH SIG-TYPE ADMIN OPER STATUS STATUS EC
=============== == ============ ===== ==== ======== ======== ==
0/2/0:15 01 isdn-voice up dorm none none y
0/2/0:15 02 isdn-voice up dorm none none y
…
0/2/0:15 30 isdn-voice up dorm none none y
0/2/0:15 31 isdn-voice up dorm none none y
PWR FAILOVER PORT PSTN FAILOVER PORT
================= ==================
VoiceGateway# show controllers e1
E1 0/2/0 is up.
Applique type is Channelized E1 - balanced
No alarms detected.
alarm-trigger is not set
Version info Firmware: 20100222, FPGA: 13, spm_count = 0
Framing is NO-CRC4, Line Code is HDB3, Clock Source is Line Primary.
Data in current interval (511 seconds elapsed):
2 Line Code Violations, 78 Path Code Violations
4 Slip Secs, 0 Fr Loss Secs, 1 Line Err Secs, 0 Degraded Mins
5 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
E1 0/2/1 is down.
Applique type is Channelized E1 - balanced
Transmitter is sending remote alarm.
Receiver has loss of signal.
alarm-trigger is not set
Version info Firmware: 20100222, FPGA: 13, spm_count = 0
Framing is CRC4, Line Code is HDB3, Clock Source is Line.
Data in current interval (511 seconds elapsed):
0 Line Code Violations, 0 Path Code Violations
0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins
0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 511 Unavail Secs
VoiceGateway#
VoiceGateway# show isdn status
Global ISDN Switchtype = primary-net5
ISDN Serial0/2/0:15 interface
dsl 0, interface ISDN Switchtype = primary-net5
Layer 1 Status:
ACTIVE
Layer 2 Status:
TEI = 0, Ces = 1, SAPI = 0, State = MULTIPLE_FRAME_ESTABLISHED
Layer 3 Status:
0 Active Layer 3 Call(s)
Active dsl 0 CCBs = 0
The Free Channel Mask: 0xFFFF7FFF
Number of L2 Discards = 0, L2 Session ID = 1
Total Allocated ISDN CCBs = 0
VoiceGateway#
dial-peer voice 8000 voip
destination-pattern 8...
session target ipv4:172.16.1.1
exit
voice translation-rule 16
rule 1 /862887210/ /3004/
rule 2 /862887211/ /3005/
exit
voice translation-profile callin
translate called 16
voice-port 0/2/0:15
translation-profile incoming callin
exit
Bước 3. Cấu hình SIP Registrar.
Router(config)#hostname SIP_Registrar
SIP_Registrar(config)#interface f0/0
SIP_Registrar(config-if)# description Ket noi toi Phone 8001
SIP_Registrar(config-if)# ip address 192.168.1.1 255.255.255.0
SIP_Registrar(config-if)# no shutdown
SIP_Registrar(config-if)# exit
SIP_Registrar(config)#interface f0/1
SIP_Registrar(config-if)# description Ket noi toi VoiceGateway
SIP_Registrar(config-if)# ip address 172.16.1.1 255.255.255.0
SIP_Registrar(config-if)# no shutdown
SIP_Registrar(config-if)# exit
SIP_Registrar(config)#ip dhcp excluded-address 192.168.1.1
SIP_Registrar(config)#ip dhcp pool Voice
SIP_Registrar(dhcp-config)# network 192.168.1.0 255.255.255.0
SIP_Registrar(dhcp-config)# default-router 192.168.1.1
SIP_Registrar(dhcp-config)# option 150 ip 192.168.1.1
SIP_Registrar(dhcp-config)# dns-server 8.8.8.8
SIP_Registrar(dhcp-config)# exit
SIP_Registrar(config)#line vty 0 4
SIP_Registrar(config-line)# privilege level 15
SIP_Registrar(config-line)# no login
SIP_Registrar(config-line)# exec-timeout 0 0
SIP_Registrar(config-line)# exit
SIP_Registrar(config)#line console 0
SIP_Registrar(config-line)# logging synchronous
SIP_Registrar(config-line)# exec-timeout 0 0
SIP_Registrar(config-line)# exit
SIP_Registrar(config)#no ip domain-lookup
SIP_Registrar(config)#no service timestamps log
SIP_Registrar(config)#no service timestamps debug
SIP_Registrar(config)#no cdp run
SIP_Registrar(config)#exit
clock set 12:00:00 20 Sept 2017
SIP_Registrar#configure terminal
SIP_Registrar(config)#
SIP_Registrar(config)#voice service voip
SIP_Registrar(conf-voi-serv)# allow-connections sip to sip
SIP_Registrar(conf-voi-serv)# allow-connections sip to h323
SIP_Registrar(conf-voi-serv)# allow-connections h323 to sip
SIP_Registrar(conf-voi-serv)# sip
SIP_Registrar(conf-serv-sip)# bind control source-interface f0/0
SIP_Registrar(conf-serv-sip)# bind media source-interface f0/0
SIP_Registrar(conf-serv-sip)# registrar server expires max 600 min 60
SIP_Registrar(conf-serv-sip)# no shutdown
SIP_Registrar(conf-voi-serv)# exit
SIP_Registrar(config)#voice service voip
SIP_Registrar(conf-voi-serv)# ip address trusted list
SIP_Registrar(cfg-iptrust-list)# ipv4 172.16.1.0 255.255.255.0
SIP_Registrar(cfg-iptrust-list)# exit
SIP_Registrar(conf-voi-serv)# exit
SIP_Registrar(config)#voice register global
SIP_Registrar(config-register-global)# mode cme
SIP_Registrar(config-register-global)# source-address 192.168.1.1 port 5060
SIP_Registrar(config-register-global)# max-dn 20
SIP_Registrar(config-register-global)# max-pool 10
SIP_Registrar(config-register-global)# authenticate register
SIP_Registrar(config-register-global)# authenticate realm all
SIP_Registrar(config-register-global)# tftp-path flash:/SIPPHONE
SIP_Registrar(config-register-global)# file text
SIP_Registrar(config-register-global)# creat profile
SIP_Registrar(config-register-global)# restart
SIP_Registrar(config-register-global)# exit
SIP_Registrar(config)#voice register dn 1
SIP_Registrar(config-register-dn)# number 8001
SIP_Registrar(config-register-dn)# name VnPro(8001)
SIP_Registrar(config-register-dn)# label VnPro(8001)
SIP_Registrar(config-register-dn)# exit
SIP_Registrar(config)#voice register pool 1
SIP_Registrar(config-register-pool)# id mac 0000.aaaa.8001
SIP_Registrar(config-register-pool)# number 1 dn 1
SIP_Registrar(config-register-pool)# username 8001 password 8001
SIP_Registrar(config-register-pool)# codec g711ulaw
SIP_Registrar(config-register-pool)# dtmf-relay sip-notify
SIP_Registrar(config-register-pool)# session-transport tcp
SIP_Registrar(config-register-pool)# exit
SIP_Registrar(config)#voice register global
SIP_Registrar(config-register-global)# create profile
SIP_Registrar(config-register-global)# exit
SIP_Registrar(config)#dial-peer voice 1000 voip
SIP_Registrar(config-dial-peer)# destination-pattern .T
SIP_Registrar(config-dial-peer)# session target ipv4:172.16.1.254
SIP_Registrar(config-dial-peer)# session protocol sipv2
SIP_Registrar(config-dial-peer)# codec g711ulaw
SIP_Registrar(config-dial-peer)# exit