Friday 27 February 2015

Basic Voip

Voice Gateways
  • Any device with one or more TDM PSTN interfaces on them
  • TDM- Time Division Multiplexing  (i-e. traditional telephony)
  • PSTN- Public Switched Telephone Network
  • To be really useful, gateways also need an IP interface on them
  • Many vendors, we'll concentrate on Cisco IOS based voice gateways
  • Both analog and digital interfaces, we'll look at the more common ones
Interface Types - Digital
  • ISDN primary rate circuits (there are others , but we will look at ISDN)
  • E1 (Primarily used in Europe and Oceania)
    •   2 Mbit/s bearer
    • 32x64 kbit/s channels. 30 for voice, 1 for signaling (timeslot 16), 1 framing
  • T1 (primarily used in North America)
    • 1.5 Mbit/s bearer
    • 24x64 kbit/s channels. 23 for voice , 1 for signaling (timeslot 24)
  • Common interfaces for ISP dial-in, PBX to carrier trunks, ets. 
  • Basic Rate ISDN
    • 144 kbit/s bearer
    • 2x 64 kbit/s channels + 1 x 16 kbit/s signalling channel
    • 2B + D
      • B channel s = 64 kbit/s  voice/data channels
      • D channel(s) =signalling data channels
Interface Types - Analog
  • Only really two types
  • FXO interface - plugs into your telco (Foreign eXchange central office)
    • Uses FXS signalling !
  • FSX interface - plugs into a telephone. e.g ATAs (Foreign eXchange station)
    • Uses FXO signalling !
  • Uses analog signalling,  limited to one DDI per line
  • Signalling is generally more ambiguous and harder to work with than digital signalling
AS 5300 / AS 5350 / AS 5400
  • Multi-port E1/T1 access servers
  • Popular ISP dial-in boxes
  • 5300 - can be used for VoIP when loaded with DSP cards
  • 5350/5400 has universal ports- modem or VoIP
  • Dial-up ISPs often well placed to provide VoIP services
  • POPs in many locations, with the right hardware!
IOS Voice  Configuration
  • For VoIP we need to configure:
    • Voice -port - the voice "interface"
      • FXS / FXO - e.g, voice-port 1/0/0
      • E1 / T1 signalling channel - e.g. voice-port 1/0/0
    • Dial-peer - tells the gateway how to connect voice ports to VoIP call legs
  • For E1 / T1 links we also need to configure the physical bearer
    • Controller E1 / controller T1
    • Interface serial 0:15 (the signalling timeslot for and E1, 0:23 for T1)
E1 Configuration
! This configuration works with Telecom NZ E1 circuits
!
Isdn switch-type primary-net5
!
Controller E1 0
Clock source line primary
Pri-group timeslots 1 - 10, 16                                              ! Note, timeslots count form 1.
Description link to Telecom
!
!
Interface serial : 15                                                                ! Note, serial channels count form 0.
No ip address
Isdn switch-type primary-net5
Isdn incoming-voice modem                                               ! Treats incoming calls as modem or voice rather than data
!
!
Voice-port 0 : D
Echo-cancel coverage 64
Cptone NZ                                                                              ! Returns NZ progress tones
Bearer-cap Speech
!
T1 Configuration
!
Isdn swith-type primary-ni
!
!
Controller T1 1/0
Framing esf
Linecode b8zs
Pri-group timeslots 1-24
!
!
Interface Serial 1/0:23
No ip address
Encapsulation hdlc
Isdn switch-type primary-ni
Isdn incoming-voice modem
!
!
Voice-port  1/0 :D
Echo-cancel coverage 64
! Default cptone is US
!
FXS / FXO Configuration
! Some useful settings
!
Voice-port 1/0/0
No comfort-noise                                                            ! Needs 'no vad' on VOIP dial-peer
Cptone NZ
Timeouts interdigit 3                                                      ! Timeout when gathering dialled digits
Description Analog phone line
!


! Or , if you're just having a play, the defaults will work:
!
Voice-port 1/0/1 !
Dial Peers
  • Basic building block on Cisco voice gateways, the dial-peer
  • All calls consists of  at least two call legs:
    • Originating device to originating gateway (POTS)
    • Originating gateway to IP Netwrok  (VOIP)
    • ….and / or
    • IP network to destination gateway
    • Destination gateway to destination device
  • Most hardware will also allow TDM switching , i.e. POTS to POTS
    • But not typically VoIP media proxying  (i.e. no VOIP-VOIP)


                                                                                           

Dial Peer Syntax
! POTS dial peer
!
Dial-peer voice tag pots
Destination-pattern number
Port voiceport #
Other configurable options
!



VOIP dial peer
!
Dial-peer voice tag voip
Destination-pattern nubmer
Session target data address
Other configurable options
!


! Destination Pattern = E.164 number   (i.e. a telephone number)
Dial Peer Matching
  • When a call is made, IOS will select the appropriate dial-peer for an outbound leg depending on call direction
    • Voip ----> pots
    • Pots ----> voip
  • Longest match for destination-pattern is chosen
  • If multiple longest matches exist, the dial-peer with the lowest preference will be chosen
Examples POTS Dial Peers


!  Outbound send-everything-to-the-pstn  POTS dial-peers:
!
Dial-peer voice 1 pots
Destination-pattern T                                                      ! T = digit timeout,  i.e. any string of digits
Direct-inward-dial                                                            ! Allow incoming calls from the POTS prot also
Port 0:D
!
! Only send numbers prefixed with 021 out the POTS port:
!
Dial-peer voice 1 pots
Destination-pattern 021T                                               ! T = digit timeout, i.e. any string of digits
Direct-inward-dial
Port  1:D
!

! Only send seven digit numbers prefixed by 04
!
Dial-peer voice 1 pots
Destination-pattern  04…….                                         !  . = a single digit
Direct-inward-dial
Port 2:D
!
Example VoIP dial-peers
! Send calls to 1234567 to a VoIP PABX or phone at IP address  a.b.c.d
!
Dial-peer voice 11234567 voip
Destination-pattern 1234567
Session protocol sipv2
Session target ipv4:a.b.c.d
Dtmf-relay rtp-nte                                                                ! RFC2833 out of band DTMF signalling
Codec g729br8
No vad
!

!
Dial-peer voice 2001 voip
Huntstop                                                                               ! Don't search for a match past this dial-peer
Preference 2
Destination-pattern 2001
Session protocol sipv2
Session target ipv4:202.53.189.62
Dtmf-relay rtp-nte
Playout-delay mode fixed                                                 ! Sets a fixed jitter buffer , useful for Fax
Codec g711ulaw
No vad                                                                                  !always use this for fax!
!
Failover Routing
  • Failover routing is achieved by 'hunting' on busy, no answer, and a myriad of other causes
  • Works for both pots and voip dial-peers
  • Use preference to step through dial-peers
    • 0 is best and the default, 9 is worst
  • Use huntstop on the 'last' dial-peer
  • Often used in conjunction with translation-patterns to ensure correct dial string for different trunks.
Failover  Example
! Incoming POTS calls first try one VoIP server, then failover to another
! If that server doesn't answer or is busy

!
Voice hunt user-busy
Voice hunt no-answer
!
Dial-peer voice 49896411 voip
Destination-pattern 4989641
Session protocol sipv2
Session target ipv4: a.b.c.1
Dtmf-relay rtp-nte
Codec g711ulaw
!
Dial-peer voice 49896412 voip
Huntstop
Preference 1
Destination-pattern 4989641
Session protocol sipv2
Session target ipv4:a.b.c.2
Dtmf-relay rtp-nte
Codec g711ulaw
!

Translation Patterns
  • Used to translate called and calling numbers
  • Uses basic translation rules to prepend /  strip digits, translate one number into a completely  different number
  • Some basic examples


! Strip 644 from the start of the number for numbers starting 6442 - 6449
!
Translation -rule 100
Rule 2  ^6442 …… 2
Rule  3  ^6443 …… 3
Rule 4  ^ 6444…… 4
Rule 5   ^6445 …… 5
Rule 6   ^6446 ……6
Rule 7   ^6447 ……7
Rule 8   ^6448 ……8
Rule 9   ^6449 ……9
!

!  Prefix  04 to the beginning of any number
!
Translation-rule 101
Rule 1  ^.% 04
Translation Pattern Examples …..ctd


!  Translate any number to 0212304323
!
Translation-rule 120
Rule 1 any 0212304323

! Normalise numbers into a standard format
!
Translation-rule 150
Rule 1  ^644498….498                                            ! 6444981234    ---->    4981234
Rule 2  ^04498 …. 498                                             !  044981234    ----->  4981234
Rule 3  ^00644498 …. 498                                      ! 006444981234 --->  4981234
!

2 comments:

  1. To enable interconnection between GSM/CDMA/WCDMA/LTE network and VoIP network smoothly and safely Dasscom's GSM voip gateways in India are the optimum choice. The product effectively connects wireless networks with IP networks in accordance with the demanding user requirements.

    ReplyDelete