PRI
Материал из Xgu.ru
PRI —
телекоммуникационный стандарт, предназначенный для переноса множества отдельных телефонных потоков (голосовых или потоков данных)
по каналу между станцией и пользователем. Отдельные потоки имеют величину 64 кбит/с, а суммарная величина PRI потока отличается
для Европы (E1, 32 канала) и США (T1, 24 канала).
Чаще всего PRI используется для соединения частных АТС с телефонной сетью общего пользования.
Обработка PRI-потока с Астериск выполняется с помощью драйвера DAHDI (Zaptel) и соответствующей карты расширения[1].
%# m-a a-i zaptel
Параметры платы, для E1[2][3]:
#vi /etc/zaptel.conf span=1,1,0,ccs,hdb3,crc4 bchan=1-15 dchan=16
Формат параметра span:
- span=(spannum),(timing),(LBO),(framing),(coding)
- spannum — номер спана (от 1го и выше)
- timing —
- LBO — Line Build Out. Длина кабеля. Должна быть равна 0 за исключением случаев, когда кабель действительно длинный.
- framing — для T1: d4 или esf; для E1: cas или ccs.
- coding — для T1: ami или b8zs; для E1: ami или hdb3 (E1 может быть crc4).
%# /etc/init.d/zaptel restart
ztcfg -vvvv Zaptel Version: 1.4.11 Echo Canceller: MG2 Configuration ====================== SPAN 1: CCS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1) Channel map: Channel 01: Clear channel (Default) (Slaves: 01) Channel 02: Clear channel (Default) (Slaves: 02) Channel 03: Clear channel (Default) (Slaves: 03) Channel 04: Clear channel (Default) (Slaves: 04) ...
#ztscan [1] active=yes alarms=OK description=Wildcard TE122 Card 0 name=WCT1/0 manufacturer=Digium devicetype=Wildcard TE122 location=PCI Bus 02 Slot 03 basechan=1 totchans=31 irq=17 type=digital-E1 syncsrc=0 lbo=0 db (CSU)/0-133 feet (DSX-1) coding_opts=HDB3 framing_opts=CCS,CRC4 coding=HDB3 framing=CCS
vim /etc/asterisk/zapata.conf --- /tmp/l3-saved-3300.28530.25096 2009-11-28 10:07:41.000000000 -0500 +++ /etc/asterisk/zapata.conf 2009-11-28 10:11:04.000000000 -0500 @@ -59,7 +59,7 @@ ; ni1: Old National ISDN 1 ; qsig: Q.SIG ; -switchtype=national +switchtype=euroisdn ; ; Some switches (AT&T especially) require network specific facility IE ; supported values are currently 'none', 'sdn', 'megacom', 'tollfreemegacom', 'accunet' @@ -210,7 +210,7 @@ ; (2-way) ; sf_rxtx: Same as sf_txrx (for our dyslexic friends) ; -signalling=fxo_ls +signalling=pri_cpe ; ; If you have an outbound signalling format that is different from format ; specified above (but compatible), you can specify outbound signalling format, @@ -680,3 +680,7 @@ ;context=default ;channel => 1 +group=1 +context=demo1 +channel => 1-15 +
Отправляем звонки на номера, начинающиеся на 9 и состоящие из трёх цифр, через группу каналов 1:
exten => _9XX,1,Dial(ZAP/G1/${EXTEN},60) exten => _9XX,n,Hangup
%$ /etc/init.d/asterisk restart
Проверьте состояние PRI-канала:
%$ asterisk -rv node1*CLI> pri show span 1 ... Status: Provisioned, Up, Active
Содержание |
[править] Настройка PRI-интерфейса на маршрутизаторе Cisco
Current configuration : 3212 bytes ! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname PSTN ! boot-start-marker boot-end-marker ! card type e1 0 1 enable secret 5 $1$FDNB$R.iIwj9s2V/DmyZ1BxPjo0 ! no aaa new-model memory-size iomem 10 network-clock-participate wic 1 ! ip cef ! ip auth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3 ! multilink bundle-name authenticated ! isdn switch-type primary-net5 ! voice-card 0 no dspfarm ! voice translation-rule 111 rule 1 /^911/ /111/ rule 2 /^011.*/ /111/ rule 3 /^\([2-9]..\)[2-9]....../ /111/ rule 4 /^\(133[1-4]55[1-4]....\)/ /\1/ rule 5 /^1[2-9]..[2-9]....../ /111/ ! voice translation-profile pod1-callednumber-translation translate called 111 ! archive log config hidekeys ! controller E1 0/1/0 clock source internal pri-group timeslots 1-4,16,24 description Pod1 HQ PRI (HQ-1, T1 PRI) ! controller E1 0/1/1 clock source internal ds0-group 2 timeslots 3-4 type e&m-fgd description Pod1 BR T1 CAS (BR-1 T1 CAS) ! interface FastEthernet0/0 ip address dhcp duplex auto speed auto ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! interface Serial0/0/0 no ip address shutdown ! interface Serial0/0/1 no ip address shutdown clock rate 2000000 ! interface Serial0/1/0:15 description Pod1 HQ PRI D-channel (HQ-1, E1 PRI) no ip address encapsulation hdlc isdn switch-type primary-net5 isdn protocol-emulate network isdn incoming-voice voice no cdp enable ! ip forward-protocol nd ! ip http server no ip http secure-server ! control-plane ! ! voice-port 0/1/0:15 translation-profile incoming pod1-callednumber-translation description Pod1 HQ PRI D-channel (HQ-1, E1 PRI) ! voice-port 0/1/1:2 translation-profile incoming pod1-callednumber-translation timing dialout-delay 300 ! voice-port 0/3/0 ! voice-port 0/3/1 ! voice-port 0/3/2 ! voice-port 0/3/3 ! dial-peer voice 11 pots description To Pod1 HQ phones (primary via PRI) destination-pattern 133155111.. direct-inward-dial port 0/1/0:15 forward-digits 10 ! dial-peer voice 13 pots description To Pod1 HQ phones (secondary, via BR-1) preference 1 destination-pattern 133155111.. forward-digits 10 prefix , ! dial-peer voice 12 pots description To Pod1 BR phone destination-pattern 133155212.. forward-digits 10 prefix , ! dial-peer voice 111 pots description To Pod1 Analog PSTN telephone destination-pattern 111 port 0/3/0 ! dial-peer voice 222 pots description To Pod1 Analog PSTN telephone destination-pattern 222 port 0/3/1 ! dial-peer voice 14 pots incoming called-number . direct-inward-dial port 0/1/1:2 ! dial-peer voice 666 pots destination-pattern [1-4]... port 0/1/0:15 forward-digits all ! gatekeeper shutdown ! line con 0 exec-timeout 0 0 privilege level 15 password cisco logging synchronous login ip netmask-format decimal line aux 0 line vty 0 4 exec-timeout 0 0 privilege level 15 password cisco logging synchronous no login line vty 5 988 exec-timeout 0 0 privilege level 15 no login ! scheduler allocate 20000 1000 ! webvpn context Default_context ssl authenticate verify all ! no inservice ! end
Другой вариант:
PSTN#sh run Building configuration... Current configuration : 4871 bytes ! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname PSTN ! boot-start-marker boot-end-marker ! card type e1 0 1 logging message-counter syslog enable password cisco ! no aaa new-model memory-size iomem 10 network-clock-participate wic 1 ! dot11 syslog ip source-route ! ip cef ! ! ip name-server 10.0.1.7 ip name-server 10.0.1.4 no ipv6 cef ! multilink bundle-name authenticated ! ! ! ! isdn switch-type primary-net5 ! ! voice translation-rule 111 rule 1 /^911/ /111/ rule 2 /^011.*/ /111/ rule 3 /^\([2-9]..\)[2-9]....../ /111/ rule 4 /^\(15[2,3][1,2][2-9]......\)/ /\1/ rule 5 /^1[2-9]..[2-9]....../ /111/ ! voice translation-rule 222 rule 1 /^911/ /222/ rule 2 /^011.*/ /222/ rule 3 /^\([2-9]..\)[2-9]....../ /222/ rule 4 /^\(15[2,3][1,2][2-9]......\)/ /\1/ rule 5 /^1[2-9]..[2-9]....../ /222/ ! ! voice translation-profile pod1-callednumber-translation translate called 111 ! voice translation-profile pod2-callednumber-translation translate called 222 ! ! voice-card 0 ! ! archive log config hidekeys ! ! controller E1 0/1/0 clock source internal pri-group timeslots 1-2,16 description Pod1 HQ PRI (HQ-1, E1 PRI) ! controller E1 0/1/1 clock source internal ds0-group 0 timeslots 1-2 type r2-digital r2-compelled ani description Pod2 HQ PRI (BR-1, E1 R2 CAS) ! ! interface Loopback0 ip address 10.1.250.103 255.255.255.255 ! interface FastEthernet0/0 ip address 10.0.35.111 255.255.0.0 ip nat outside ip virtual-reassembly duplex auto speed auto ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! interface Serial0/0/0 description To HQ bandwidth 256 ip address 10.12.1.102 255.255.0.0 ip nat inside ip virtual-reassembly encapsulation ppp shutdown no fair-queue clock rate 256000 ! interface Serial0/0/1 description To BR bandwidth 128 ip address 10.1.4.101 255.255.255.0 ip nat inside ip virtual-reassembly encapsulation ppp shutdown clock rate 256000 ! interface Serial0/1/0:15 description Pod1 HQ PRI D-channel (HQ-1, E1 PRI) no ip address encapsulation hdlc isdn switch-type primary-net5 isdn protocol-emulate network isdn incoming-voice voice no cdp enable ! router ospf 1 log-adjacency-changes redistribute static network 10.1.4.0 0.0.0.255 area 0 network 10.12.0.0 0.0.255.255 area 0 default-information originate ! ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 10.0.3.4 ip http server no ip http secure-server ! ! ip nat inside source list 1 interface FastEthernet0/0 overload ! access-list 1 permit 10.1.0.0 0.0.255.255 ! ! control-plane ! ! voice-port 0/1/0:15 translation-profile incoming pod1-callednumber-translation description Pod1 HQ PRI D-channel (HQ-1, E1 PRI) ! voice-port 0/1/1:0 translation-profile incoming pod1-callednumber-translation description Pod1 BR E1 CAS (BR-1 E1 R2 CAS) ! voice-port 0/3/0 description Pod1 Analog PSTN telephone ! voice-port 0/3/1 ! voice-port 0/3/2 ! voice-port 0/3/3 ! ! dial-peer voice 521 pots description To Pod1 HQ phones (primary via PRI) destination-pattern 15215552... direct-inward-dial port 0/1/0:15 forward-digits 10 ! dial-peer voice 5212 pots description To Pod1 HQ phones (secondary, via BR-1) preference 1 destination-pattern 15215552... direct-inward-dial port 0/1/1:0 forward-digits 10 prefix , ! dial-peer voice 531 pots description To Pod1 BR phone destination-pattern 15315553... direct-inward-dial port 0/1/1:0 forward-digits 10 prefix , ! dial-peer voice 111 pots description To Pod1 Analog PSTN telephone destination-pattern 111 port 0/3/0 forward-digits 0 ! ! dial-peer voice 11 voip translation-profile incoming pod1-callednumber-translation destination-pattern 11.. session protocol sipv2 session target ipv4:10.12.1.101 codec g711ulaw ! dial-peer voice 12 voip translation-profile incoming pod1-callednumber-translation destination-pattern 12.. session protocol sipv2 session target ipv4:10.1.4.102 codec g711ulaw ! dial-peer voice 123 pots destination-pattern 123 port 0/3/1 forward-digits 0 ! dial-peer voice 125 pots destination-pattern 125 port 0/3/2 forward-digits 0 ! dial-peer voice 666 pots destination-pattern 6.. direct-inward-dial port 0/1/0:15 forward-digits all ! dial-peer voice 222 pots destination-pattern 2.. direct-inward-dial port 0/1/0:15 forward-digits all ! dial-peer voice 151 pots destination-pattern 15. direct-inward-dial port 0/1/0:15 forward-digits 3 ! dial-peer voice 150 pots destination-pattern 150 port 0/1/0:15 ! ! gatekeeper shutdown ! ! line con 0 exec-timeout 0 0 privilege level 15 password cisco logging synchronous login line aux 0 line vty 0 4 privilege level 15 password cisco logging synchronous login ! scheduler allocate 20000 1000 end
[править] Кабели
Кросс-кабель для PRI — можно сделать из обычной витой пары категории 5 с разъёмами RJ-45[4]:
1 -- 4 2 -- 5 4 -- 1 5 -- 2
[править] Дополнительная информация
- Asterisk PRI (англ.)
[править] Примечания
- ↑ Например: Digium Wildcard TE210P (англ.)
- ↑ http://www.voip-info.org/wiki/view/Asterisk+config+zaptel.conf
- ↑ http://www.voip-info.org/wiki/view/Zaptel.conf+span+syntax — подробнее о параметре span
- ↑ http://www.voip-info.org/wiki/view/crossover+T1+cable