Configurare Patton SN4638/5BIS per Asterisk

  • 12 Feb 2015
  • Asterisk, Patton, FreePBX

Scenario

Un gateway Patton SN4638 collegato a 5 linee BRi di Telecom Italia. Ogni linea communica con Asterisk attraverso un trunk SIP indipendente per ogni ISDN.

  • IP Asterisk: 172.16.0.10
  • IP Patton: 172.16.0.12
  • GW: 172.16.0.1

Configurare FreePBX

General Settings

Trunk name

bri0

Outgoing Settings

Trunk name

patton0

Peer details

host=dynamic
username=patton0
secret=patton0
type=friend
dtmfmode=rfc2833
defaultip=172.16.0.12
qualify=yes
port=5060
deny=0.0.0.0/0.0.0.0
permit=172.16.0.0/255.255.255.0
nat=no
t38pt_udptl=no
t38pt_rtp=no
t38pt_tcp=no
insecure=very

Creare altri 4 trunk per patton1, patton2, patton3 e patton4 cambiando il numero di porta corrispondente (5062, 5064...)

File di configurazione per il Patton

Salvare il seguente codice in un file di testo. Modificare tutti gli indirizzi IP e importare dall'interfaccia web del Patton

#----------------------------------------------------------------#
#                                                                #
# SN4638/5BIS                                                    #
# R6.5 2014-01-09 H323 SIP BRI                                   #
# 2015-04-12T18:24:48                                            #
# SN/00A0BA0AA2FD                                                #
# Generated configuration file                                   #
#                                                                #
#----------------------------------------------------------------#

cli version 3.20
clock local default-offset +00:00
dns-relay
webserver port 80 language en
sntp-client
sntp-client server primary 172.16.0.10 port 123 version 4
sntp-client server secondary pool.ntp.org port 123 version 4

system

  ic voice 0
    low-bitrate-codec g729

system
  clock-source 1 bri 0 0
  clock-source 2 bri 0 1
  clock-source 3 bri 0 2
  clock-source 4 bri 0 3
  clock-source 5 bri 0 4

profile napt NAPT_WAN

profile ppp default

profile call-progress-tone IT_Dialtone
  play 1 200 425 -12
  pause 2 200
  play 3 600 425 -12
  pause 4 1000

profile call-progress-tone IT_Alertingtone
  play 1 1000 425 -12
  pause 2 4000

profile call-progress-tone IT_Busytone
  play 1 500 425 -12
  pause 2 500

profile tone-set default
profile tone-set IT
  map call-progress-tone dial-tone IT_Dialtone
  map call-progress-tone ringback-tone IT_Alertingtone
  map call-progress-tone busy-tone IT_Busytone
  map call-progress-tone release-tone IT_Busytone
  map call-progress-tone congestion-tone IT_Busytone

profile voip default
  codec 1 g711alaw64k rx-length 20 tx-length 20
  codec 2 g711ulaw64k rx-length 20 tx-length 20

profile voip T38_Relay
  codec 1 g711alaw64k rx-length 20 tx-length 20
  codec 2 g711ulaw64k rx-length 20 tx-length 20
  fax transmission 1 bypass g711alaw64k rx-length 10 tx-length 10

profile pstn default

profile sip default
  no autonomous-transitioning

profile aaa default
  method 1 local
  method 2 none

context ip router

  interface WAN
    ipaddress 172.16.0.12 255.255.255.0
    use profile napt NAPT_WAN
    tcp adjust-mss rx mtu
    tcp adjust-mss tx mtu

  interface LAN
    ipaddress unnumbered
    tcp adjust-mss rx mtu
    tcp adjust-mss tx mtu

context ip router
  route 0.0.0.0 0.0.0.0 172.16.0.1 0

context cs switch
  national-prefix 0
  international-prefix 00

  routing-table called-e164 RT_OUT0
    route .%T3 dest-interface IF_ISDN0 speech

  routing-table called-e164 RT_OUT1
    route .%T3 dest-interface IF_ISDN1 speech

  routing-table called-e164 RT_OUT2
    route .%T3 dest-interface IF_ISDN2 speech

  routing-table called-e164 RT_OUT3
    route .%T3 dest-interface IF_ISDN3 speech

  routing-table called-e164 RT_OUT4
    route .%T3 dest-interface IF_ISDN4 speech

  routing-table called-e164 RT_IN0
    route .%T3 dest-interface IF_PBX0

  routing-table called-e164 RT_IN1
    route .%T3 dest-interface IF_PBX1

  routing-table called-e164 RT_IN2
    route .%T3 dest-interface IF_PBX2

  routing-table called-e164 RT_IN3
    route .%T3 dest-interface IF_PBX3

  routing-table called-e164 RT_IN4
    route .%T3 dest-interface IF_PBX4

  mapping-table itc to itc speech
    map default to speech

  interface isdn IF_ISDN0
    route call dest-table RT_IN0
    use profile tone-set IT

  interface isdn IF_ISDN1
    route call dest-table RT_IN1
    use profile tone-set IT

  interface isdn IF_ISDN2
    route call dest-table RT_IN2
    use profile tone-set IT

  interface isdn IF_ISDN3
    route call dest-table RT_IN3
    use profile tone-set IT

  interface isdn IF_ISDN4
    route call dest-table RT_IN4
    use profile tone-set IT

  interface sip IF_PBX0
    bind context sip-gateway GW_ASTERISK0
    route call dest-table RT_OUT0
    remote 172.16.0.10 5060
    early-disconnect
    use profile voip T38_Relay

  interface sip IF_PBX1
    bind context sip-gateway GW_ASTERISK1
    route call dest-table RT_OUT1
    remote 172.16.0.10 5062
    early-disconnect
    use profile voip T38_Relay

  interface sip IF_PBX2
    bind context sip-gateway GW_ASTERISK2
    route call dest-table RT_OUT2
    remote 172.16.0.10 5064
    early-disconnect
    use profile voip T38_Relay

  interface sip IF_PBX3
    bind context sip-gateway GW_ASTERISK3
    route call dest-table RT_OUT3
    remote 172.16.0.10 5066
    early-disconnect
    use profile voip T38_Relay

  interface sip IF_PBX4
    bind context sip-gateway GW_ASTERISK4
    route call dest-table RT_OUT4
    remote 172.16.0.10 5068
    early-disconnect
    use profile voip T38_Relay

  service hunt-group SER_HG_ISDN
    drop-cause normal-unspecified
    drop-cause no-circuit-channel-available
    drop-cause network-out-of-order
    drop-cause temporary-failure
    drop-cause switching-equipment-congestion
    drop-cause access-info-discarded
    drop-cause circuit-channel-not-available
    drop-cause resources-unavailable
    drop-cause user-busy
    route call 1 dest-interface IF_ISDN3
    route call 2 dest-interface IF_ISDN4

context cs switch
  no shutdown

authentication-service AUTH_SVC
  username patton0 password yXU+6YwkddMOyDFYP6Y02A== encrypted
  username patton1 password 47q0k6wgmqyG+984NmZbMQ== encrypted
  username patton2 password GEgE5ivOI2H6qAM4QSOyOA== encrypted
  username patton3 password bXxNTVF8Fb+nfIg3z01jyw== encrypted
  username patton4 password D0UpI3M03YKxZHOuBm9x1A== encrypted

location-service LS_PATTON0
  domain 1 172.16.0.10

  identity patton0

    authentication outbound
      authenticate 1 authentication-service AUTH_SVC username patton0

    registration outbound
      registrar 172.16.0.10
      register auto

location-service LS_PATTON1
  domain 1 172.16.0.10

  identity patton1

    authentication outbound
      authenticate 1 authentication-service AUTH_SVC username patton1

    registration outbound
      registrar 172.16.0.10
      register auto

location-service LS_PATTON2
  domain 1 172.16.0.10

  identity patton2

    authentication outbound
      authenticate 1 authentication-service AUTH_SVC username patton2

    registration outbound
      registrar 172.16.0.10
      register auto

location-service LS_PATTON3
  domain 1 172.16.0.10

  identity patton3

    authentication outbound
      authenticate 1 authentication-service AUTH_SVC username patton3

    registration outbound
      registrar 172.16.0.10
      register auto

location-service LS_PATTON4
  domain 1 172.16.0.10

  identity patton4

    authentication outbound
      authenticate 1 authentication-service AUTH_SVC username patton4

    registration outbound
      registrar 172.16.0.10
      register auto

context sip-gateway GW_ASTERISK0

  interface IF_ASTERISK
    bind interface WAN context router port 5060

context sip-gateway GW_ASTERISK0
  bind location-service LS_PATTON0
  no shutdown

context sip-gateway GW_ASTERISK1

  interface IF_ASTERISK
    bind interface WAN context router port 5062

context sip-gateway GW_ASTERISK1
  bind location-service LS_PATTON1
  no shutdown

context sip-gateway GW_ASTERISK2

  interface IF_ASTERISK
    bind interface WAN context router port 5064

context sip-gateway GW_ASTERISK2
  bind location-service LS_PATTON2
  no shutdown

context sip-gateway GW_ASTERISK3

  interface IF_ASTERISK
    bind interface WAN context router port 5066

context sip-gateway GW_ASTERISK3
  bind location-service LS_PATTON3
  no shutdown

context sip-gateway GW_ASTERISK4

  interface IF_ASTERISK
    bind interface WAN context router port 5068

context sip-gateway GW_ASTERISK4
  bind location-service LS_PATTON4
  no shutdown

port ethernet 0 0
  medium auto
  encapsulation ip
  bind interface WAN router
  no shutdown

port ethernet 0 1
  medium auto
  encapsulation ip
  bind interface LAN router
  no shutdown

port bri 0 0
  clock auto
  encapsulation q921

  q921
    permanent-layer2
    protocol pp
    uni-side auto
    encapsulation q931

    q931
      protocol dss1
      uni-side user
      bchan-number-order ascending
      encapsulation cc-isdn
      bind interface IF_ISDN0 switch

port bri 0 0
  no shutdown

port bri 0 1
  clock auto
  encapsulation q921

  q921
    permanent-layer2
    protocol pp
    uni-side auto
    encapsulation q931

    q931
      protocol dss1
      uni-side user
      bchan-number-order ascending
      encapsulation cc-isdn
      bind interface IF_ISDN1 switch

port bri 0 1
  no shutdown

port bri 0 2
  clock auto
  encapsulation q921

  q921
    permanent-layer2
    protocol pp
    uni-side auto
    encapsulation q931

    q931
      protocol dss1
      uni-side user
      bchan-number-order ascending
      encapsulation cc-isdn
      bind interface IF_ISDN2 switch

port bri 0 2
  no shutdown

port bri 0 3
  clock auto
  encapsulation q921

  q921
    permanent-layer2
    protocol pp
    uni-side auto
    encapsulation q931

    q931
      protocol dss1
      uni-side user
      bchan-number-order ascending
      encapsulation cc-isdn
      bind interface IF_ISDN3 switch

port bri 0 3
  no shutdown

port bri 0 4
  clock auto
  encapsulation q921

  q921
    permanent-layer2
    protocol pp
    uni-side auto
    encapsulation q931

    q931
      protocol dss1
      uni-side user
      bchan-number-order ascending
      encapsulation cc-isdn
      bind interface IF_ISDN4 switch

port bri 0 4
  no shutdown