#----------------------------------------------------------------#
#                                                                #
# Shipping Configuration                                         #
#                                                                #
#----------------------------------------------------------------#

cli version 4.00
snmp shutdown

actions

  rule PROV_STARTUP
    condition ip address:WAN.DHCP LINKUP initial
    condition system ntp TIME_INITIALIZED
    action 1 "provisioning execute PF_PROVISIONING_CONFIG"

profile aaa DEFAULT
  method 1 local rule required
  method 2 none rule required

console
  use profile aaa DEFAULT

telnet-server
  use profile aaa DEFAULT
  no shutdown

ssh-server
  use profile aaa DEFAULT
  no shutdown

web-server
  protocol http port 80
  protocol https port 443
  use profile aaa DEFAULT
  no shutdown

ntp
  server 0.patton.pool.ntp.org
  server 1.patton.pool.ntp.org
  server 2.patton.pool.ntp.org
  server 3.patton.pool.ntp.org
  no shutdown

profile napt NAPT_WAN

dns-server
  host 192.168.1.1 smartnode.local
  no shutdown

profile dhcp-server DHCPS_LAN
  network 192.168.1.0/24
  lease 24 hours
  default-router 192.168.1.1
  domain-name-server 192.168.1.1
  include 192.168.1.10 192.168.1.99

profile provisioning PF_PROVISIONING_CONFIG
  destination configuration
  use profile tls DEFAULT
  location 1 https://provision.patton.io/$(system.serial);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=Trinity;subDirTrinity=/Trinity;subDirSmartWare=;dhcp66=$(dhcp.66);dhcp67=$(dhcp.67)
  location 2 $(dhcp.66)
  location 3 $(dhcp.66)/$(system.serial).cfg
  location 4 http://$(dhcp.66)/$(dhcp.67)
  location 5 http://$(dhcp.66)/$(system.serial).cfg
  location 6 tftp://$(dhcp.66)/$(dhcp.67)
  location 7 tftp://$(dhcp.66)/$(system.serial).cfg
  activation reload immediate

profile fxs DEFAULT_EU
  electrical-standard etsi
  caller-id standard fsk-etsi presentation mid-ring

profile fxs DEFAULT_US
  electrical-standard bell
  caller-id standard fsk-bell presentation mid-ring

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

profile sip DEFAULT

context ip ROUTER

  interface WAN
    ipaddress DHCP dhcp
    use profile napt NAPT_WAN DHCP

  interface LAN
    ipaddress LAN 192.168.1.1/24

  routing-table DEFAULT

context ip ROUTER
  use profile dhcp-server DHCPS_LAN

profile ppp DEFAULT

cwmp-client
  bind ipaddress ROUTER WAN DHCP
  session-retry-maximum 1
  no shutdown

context cs SWITCH
  no shutdown

  routing-table called-e164 RT_to_SIP
    route .T dest-interface IF_SIP

  routing-table called-e164 RT_to_FXS
    route 100 dest-interface IF_FXS_00
    route 101 dest-interface IF_FXS_01

  interface sip IF_SIP
    bind context sip-gateway GW_SIP
    route call dest-table RT_to_FXS
    remote sip.domain 5060

  interface fxs IF_FXS_00
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_01
    route call dest-table RT_to_SIP

location-service LS
  domain 1 sip.domain
  match-any-domain

context sip-gateway GW_SIP
  bind location-service LS

  interface IF_SIP
    transport-protocol udp+tcp 5060
    bind ipaddress ROUTER WAN DHCP

context sip-gateway GW_SIP
  no shutdown

port ethernet 0 0
  bind interface ROUTER WAN
  no shutdown

port ethernet 0 1
  bind interface ROUTER LAN
  no shutdown

port fxs 0 0
  subscriber-number 100
  bind interface SWITCH IF_FXS_00
  no shutdown

port fxs 0 1
  subscriber-number 101
  bind interface SWITCH IF_FXS_01
  no shutdown


