Configurare Patton SN4661/4BIS4JS per Asterisk

Scenario

Un gateway Patton SN4661 collegato a 4 linee BRi di Telecom Italia. Ogni linea communica con Asterisk attraverso un trunk SIP indipendente per ogni ISDN. Inoltre, un interno SIP di Asterisk è collegato a una delle porte FXS del Patton per l'invio e ricezione dei fax.

  • IP Asterisk: 172.16.0.10
  • Interno SIP su Asterisk per i fax: 220
  • IP Patton: 172.16.0.12
  • GW: 172.16.0.1

Configurare FreePBX

Creare un interno SIP per il fax

Creare l'interno numero 220 che sarà utilizzato dal Patton per una delle porte FXS dove sarà collegato un fax tradizionale. Configurare i seguenti punti:

Display name

220

Secret

superSeCreeT34Pa

Deny

0.0.0.0/0.0.0.0

Permit

172.16.0.0/255.255.0.0

Creare i trunk SIP per ogni linea ISDN

Trunk name

bri0

Outgoing Settings

Trunk name

bri0

Peer details

host=172.16.0.12
username=10000
secret=10000
type=friend
dtmfmode=rfc2833
insecure=port,invite
qualify=yes
deny=0.0.0.0/0.0.0.0
permit=172.16.0.0/255.255.255.0

Creare altri 4 trunk per patton1, patton2, patton3 e patton4

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

#----------------------------------------------------------------#
#                                                                #
# SN4661/4BIS4JS12V/EUI                                          #
# R6.T 2012-05-23 H323 RBS SIP                                   #
# 2015-04-12T18:47:18                                            #
# SN/00A0BA0873AE                                                #
# Generated configuration file                                   #
#                                                                #
#----------------------------------------------------------------#

cli version 3.20
clock local default-offset +00:00
timer PROVISIONING now + 1 minute "provisioning execute PF_PROVISIONING_CONFIG"
dns-relay
webserver port 80 language en
sntp-client
sntp-client server primary pool.ntp.org port 123 version 4

system

  ic voice 0

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

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
  response-preferred-codec g711alaw64k

profile pstn default

profile ringing-cadence default
  play 1 1000
  pause 2 4000

profile sip default
  no autonomous-transitioning

profile dhcp-server DHCPS_LAN


profile aaa default
  method 1 local
  method 2 none

profile provisioning PF_PROVISIONING_CONFIG
  destination configuration
  location 1 http://redirect.patton.com/$(system.mac);mac=$(system.mac);serial=$(system.serial);hwMajor=$(system.hw.major);hwMinor=$(system.hw.minor);swMajor=$(system.sw.major);swMinor=$(system.sw.minor);swDate=$(system.sw.date);productName=$(system.product.name);cliMajor=$(cli.major);cliMinor=$(cli.minor);osName=$(cli.major>=4|Trinity|SmartWare);subDirTrinity=$(cli.major>=4|/Trinity);subDirSmartWare=$(cli.major<4|/SmartWare);dhcp66=$(dhcp.66);dhcp67=$(dhcp.67)
  location 2 $(dhcp.66)
  location 3 $(dhcp.66)/$(system.mac).cfg
  location 4 http://$(dhcp.66)/$(dhcp.67)
  location 5 http://$(dhcp.66)/$(system.mac).cfg
  location 6 tftp://$(dhcp.66)/$(dhcp.67)
  location 7 tftp://$(dhcp.66)/$(system.mac).cfg
  activation reload immediate

context ip router

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

  interface LAN
    ipaddress 172.16.0.12 255.255.255.0
    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

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

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

  interface isdn IF_ISDN1
    route call dest-interface IF_PBX1
    dtmf-dialing
    use profile tone-set IT

  interface isdn IF_ISDN2
    route call dest-interface IF_PBX2
    dtmf-dialing
    use profile tone-set IT

  interface sip IF_PBX3
    bind context sip-gateway GW_PBX3
    route call dest-interface IF_ISDN3
    remote 172.16.0.10 5060
    early-disconnect
    privacy
    use profile tone-set IT

  interface sip IF_PBX1
    bind context sip-gateway GW_PBX
    route call dest-interface IF_ISDN1
    remote 172.16.0.10 5060
    early-disconnect
    use profile tone-set IT

  interface sip IF_PBX2
    bind context sip-gateway GW_PBX
    route call dest-interface IF_ISDN2
    remote 172.16.0.10 5060
    early-disconnect
    use profile tone-set IT

  interface sip IF_PBX0
    bind context sip-gateway GW_PBX
    route call dest-interface IF_ISDN0
    remote 172.16.0.10 5060
    early-disconnect
    use profile tone-set IT

  interface sip IF_PBX_220
    bind context sip-gateway GW_PBX_220
    remote 172.16.0.10 5060
    early-connect
    early-disconnect
    use profile tone-set IT

  interface fxs IF_FXS_0
    route call dest-interface IF_PBX3
    use profile tone-set IT

  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
    route call 1 dest-interface IF_ISDN0

  service hunt-group SER_HG_ISDN3
    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
    route call 1 dest-interface IF_ISDN3

context cs switch
  no shutdown

authentication-service AS_PBX
authentication-service AS_PBX1
authentication-service AS_PBX2
authentication-service AS_PBX3
  username 10003 password 10003

authentication-service AS_PBX_220
  username 220 password superSeCreeT34Pa

location-service LS_PBX
  domain 1 172.16.0.10 5060

location-service LS_PBX3
  domain 1 172.16.0.10 5063

  identity 10003

location-service LS_PBX1

location-service LS_PBX_220
  domain 1 172.16.0.10 5060

  identity-group IG_PBX_220

    authentication outbound
      authenticate 1 authentication-service AS_PBX_220 username 220

    registration outbound
      registrar 172.16.0.10 5060
      lifetime 3600
      retry-timeout on-system-error 10
      retry-timeout on-client-error 10
      retry-timeout on-server-error 10

  identity 220 inherits IG_PBX_220

context sip-gateway GW_PBX

  interface IF_PBX
    bind interface LAN context router port 5060

context sip-gateway GW_PBX
  bind location-service LS_PBX
  no shutdown

context sip-gateway GW_PBX3

  interface IF_PBX3
    bind interface LAN context router port 5063

context sip-gateway GW_PBX3
  bind location-service LS_PBX3
  no shutdown

context sip-gateway GW_PBX1
  no shutdown

context sip-gateway GW_PBX_220
  bind location-service LS_PBX_220
  no shutdown

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

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

port fxs 0 0
  encapsulation cc-fxs
  bind interface IF_FXS_0 switch
  no shutdown

port fxs 0 1
  shutdown

port fxs 0 2
  shutdown

port fxs 0 3
  shutdown

port bri 0 0
  clock auto
  encapsulation q921

  q921
    permanent-layer2
    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
    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
    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
    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