#----------------------------------------------------------------#
#                                                                #
# 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 1000 dest-interface IF_FXS_000
    route 1001 dest-interface IF_FXS_001
    route 1002 dest-interface IF_FXS_002
    route 1003 dest-interface IF_FXS_003
    route 1004 dest-interface IF_FXS_004
    route 1005 dest-interface IF_FXS_005
    route 1006 dest-interface IF_FXS_006
    route 1007 dest-interface IF_FXS_007
    route 1008 dest-interface IF_FXS_008
    route 1009 dest-interface IF_FXS_009
    route 1010 dest-interface IF_FXS_010
    route 1011 dest-interface IF_FXS_011
    route 1012 dest-interface IF_FXS_012
    route 1013 dest-interface IF_FXS_013
    route 1014 dest-interface IF_FXS_014
    route 1015 dest-interface IF_FXS_015
    route 1016 dest-interface IF_FXS_016
    route 1017 dest-interface IF_FXS_017
    route 1018 dest-interface IF_FXS_018
    route 1019 dest-interface IF_FXS_019
    route 1020 dest-interface IF_FXS_020
    route 1021 dest-interface IF_FXS_021
    route 1022 dest-interface IF_FXS_022
    route 1023 dest-interface IF_FXS_023
    route 1024 dest-interface IF_FXS_024
    route 1025 dest-interface IF_FXS_025
    route 1026 dest-interface IF_FXS_026
    route 1027 dest-interface IF_FXS_027
    route 1028 dest-interface IF_FXS_028
    route 1029 dest-interface IF_FXS_029
    route 1030 dest-interface IF_FXS_030
    route 1031 dest-interface IF_FXS_031
    route 1032 dest-interface IF_FXS_032
    route 1033 dest-interface IF_FXS_033
    route 1034 dest-interface IF_FXS_034
    route 1035 dest-interface IF_FXS_035
    route 1036 dest-interface IF_FXS_036
    route 1037 dest-interface IF_FXS_037
    route 1038 dest-interface IF_FXS_038
    route 1039 dest-interface IF_FXS_039
    route 1040 dest-interface IF_FXS_040
    route 1041 dest-interface IF_FXS_041
    route 1042 dest-interface IF_FXS_042
    route 1043 dest-interface IF_FXS_043
    route 1044 dest-interface IF_FXS_044
    route 1045 dest-interface IF_FXS_045
    route 1046 dest-interface IF_FXS_046
    route 1047 dest-interface IF_FXS_047
    route 1048 dest-interface IF_FXS_048
    route 1049 dest-interface IF_FXS_049
    route 1050 dest-interface IF_FXS_050
    route 1051 dest-interface IF_FXS_051
    route 1052 dest-interface IF_FXS_052
    route 1053 dest-interface IF_FXS_053
    route 1054 dest-interface IF_FXS_054
    route 1055 dest-interface IF_FXS_055
    route 1056 dest-interface IF_FXS_056
    route 1057 dest-interface IF_FXS_057
    route 1058 dest-interface IF_FXS_058
    route 1059 dest-interface IF_FXS_059
    route 1060 dest-interface IF_FXS_060
    route 1061 dest-interface IF_FXS_061
    route 1062 dest-interface IF_FXS_062
    route 1063 dest-interface IF_FXS_063

  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_000
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_001
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_002
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_003
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_004
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_005
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_006
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_007
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_008
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_009
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_010
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_011
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_012
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_013
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_014
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_015
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_016
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_017
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_018
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_019
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_020
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_021
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_022
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_023
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_024
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_025
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_026
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_027
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_028
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_029
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_030
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_031
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_032
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_033
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_034
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_035
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_036
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_037
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_038
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_039
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_040
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_041
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_042
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_043
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_044
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_045
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_046
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_047
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_048
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_049
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_050
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_051
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_052
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_053
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_054
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_055
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_056
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_057
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_058
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_059
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_060
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_061
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_062
    route call dest-table RT_to_SIP

  interface fxs IF_FXS_063
    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 1000
  bind interface SWITCH IF_FXS_000
  no shutdown

port fxs 0 1
  subscriber-number 1001
  bind interface SWITCH IF_FXS_001
  no shutdown

port fxs 0 2
  subscriber-number 1002
  bind interface SWITCH IF_FXS_002
  no shutdown

port fxs 0 3
  subscriber-number 1003
  bind interface SWITCH IF_FXS_003
  no shutdown

port fxs 0 4
  subscriber-number 1004
  bind interface SWITCH IF_FXS_004
  no shutdown

port fxs 0 5
  subscriber-number 1005
  bind interface SWITCH IF_FXS_005
  no shutdown

port fxs 0 6
  subscriber-number 1006
  bind interface SWITCH IF_FXS_006
  no shutdown

port fxs 0 7
  subscriber-number 1007
  bind interface SWITCH IF_FXS_007
  no shutdown

port fxs 0 8
  subscriber-number 1008
  bind interface SWITCH IF_FXS_008
  no shutdown

port fxs 0 9
  subscriber-number 1009
  bind interface SWITCH IF_FXS_009
  no shutdown

port fxs 0 10
  subscriber-number 1010
  bind interface SWITCH IF_FXS_010
  no shutdown

port fxs 0 11
  subscriber-number 1011
  bind interface SWITCH IF_FXS_011
  no shutdown

port fxs 0 12
  subscriber-number 1012
  bind interface SWITCH IF_FXS_012
  no shutdown

port fxs 0 13
  subscriber-number 1013
  bind interface SWITCH IF_FXS_013
  no shutdown

port fxs 0 14
  subscriber-number 1014
  bind interface SWITCH IF_FXS_014
  no shutdown

port fxs 0 15
  subscriber-number 1015
  bind interface SWITCH IF_FXS_015
  no shutdown

port fxs 0 16
  subscriber-number 1016
  bind interface SWITCH IF_FXS_016
  no shutdown

port fxs 0 17
  subscriber-number 1017
  bind interface SWITCH IF_FXS_017
  no shutdown

port fxs 0 18
  subscriber-number 1018
  bind interface SWITCH IF_FXS_018
  no shutdown

port fxs 0 19
  subscriber-number 1019
  bind interface SWITCH IF_FXS_019
  no shutdown

port fxs 0 20
  subscriber-number 1020
  bind interface SWITCH IF_FXS_020
  no shutdown

port fxs 0 21
  subscriber-number 1021
  bind interface SWITCH IF_FXS_021
  no shutdown

port fxs 0 22
  subscriber-number 1022
  bind interface SWITCH IF_FXS_022
  no shutdown

port fxs 0 23
  subscriber-number 1023
  bind interface SWITCH IF_FXS_023
  no shutdown

port fxs 0 24
  subscriber-number 1024
  bind interface SWITCH IF_FXS_024
  no shutdown

port fxs 0 25
  subscriber-number 1025
  bind interface SWITCH IF_FXS_025
  no shutdown

port fxs 0 26
  subscriber-number 1026
  bind interface SWITCH IF_FXS_026
  no shutdown

port fxs 0 27
  subscriber-number 1027
  bind interface SWITCH IF_FXS_027
  no shutdown

port fxs 0 28
  subscriber-number 1028
  bind interface SWITCH IF_FXS_028
  no shutdown

port fxs 0 29
  subscriber-number 1029
  bind interface SWITCH IF_FXS_029
  no shutdown

port fxs 0 30
  subscriber-number 1030
  bind interface SWITCH IF_FXS_030
  no shutdown

port fxs 0 31
  subscriber-number 1031
  bind interface SWITCH IF_FXS_031
  no shutdown

port fxs 0 32
  subscriber-number 1032
  bind interface SWITCH IF_FXS_032
  no shutdown

port fxs 0 33
  subscriber-number 1033
  bind interface SWITCH IF_FXS_033
  no shutdown

port fxs 0 34
  subscriber-number 1034
  bind interface SWITCH IF_FXS_034
  no shutdown

port fxs 0 35
  subscriber-number 1035
  bind interface SWITCH IF_FXS_035
  no shutdown

port fxs 0 36
  subscriber-number 1036
  bind interface SWITCH IF_FXS_036
  no shutdown

port fxs 0 37
  subscriber-number 1037
  bind interface SWITCH IF_FXS_037
  no shutdown

port fxs 0 38
  subscriber-number 1038
  bind interface SWITCH IF_FXS_038
  no shutdown

port fxs 0 39
  subscriber-number 1039
  bind interface SWITCH IF_FXS_039
  no shutdown

port fxs 0 40
  subscriber-number 1040
  bind interface SWITCH IF_FXS_040
  no shutdown

port fxs 0 41
  subscriber-number 1041
  bind interface SWITCH IF_FXS_041
  no shutdown

port fxs 0 42
  subscriber-number 1042
  bind interface SWITCH IF_FXS_042
  no shutdown

port fxs 0 43
  subscriber-number 1043
  bind interface SWITCH IF_FXS_043
  no shutdown

port fxs 0 44
  subscriber-number 1044
  bind interface SWITCH IF_FXS_044
  no shutdown

port fxs 0 45
  subscriber-number 1045
  bind interface SWITCH IF_FXS_045
  no shutdown

port fxs 0 46
  subscriber-number 1046
  bind interface SWITCH IF_FXS_046
  no shutdown

port fxs 0 47
  subscriber-number 1047
  bind interface SWITCH IF_FXS_047
  no shutdown

port fxs 0 48
  subscriber-number 1048
  bind interface SWITCH IF_FXS_048
  no shutdown

port fxs 0 49
  subscriber-number 1049
  bind interface SWITCH IF_FXS_049
  no shutdown

port fxs 0 50
  subscriber-number 1050
  bind interface SWITCH IF_FXS_050
  no shutdown

port fxs 0 51
  subscriber-number 1051
  bind interface SWITCH IF_FXS_051
  no shutdown

port fxs 0 52
  subscriber-number 1052
  bind interface SWITCH IF_FXS_052
  no shutdown

port fxs 0 53
  subscriber-number 1053
  bind interface SWITCH IF_FXS_053
  no shutdown

port fxs 0 54
  subscriber-number 1054
  bind interface SWITCH IF_FXS_054
  no shutdown

port fxs 0 55
  subscriber-number 1055
  bind interface SWITCH IF_FXS_055
  no shutdown

port fxs 0 56
  subscriber-number 1056
  bind interface SWITCH IF_FXS_056
  no shutdown

port fxs 0 57
  subscriber-number 1057
  bind interface SWITCH IF_FXS_057
  no shutdown

port fxs 0 58
  subscriber-number 1058
  bind interface SWITCH IF_FXS_058
  no shutdown

port fxs 0 59
  subscriber-number 1059
  bind interface SWITCH IF_FXS_059
  no shutdown

port fxs 0 60
  subscriber-number 1060
  bind interface SWITCH IF_FXS_060
  no shutdown

port fxs 0 61
  subscriber-number 1061
  bind interface SWITCH IF_FXS_061
  no shutdown

port fxs 0 62
  subscriber-number 1062
  bind interface SWITCH IF_FXS_062
  no shutdown

port fxs 0 63
  subscriber-number 1063
  bind interface SWITCH IF_FXS_063
  no shutdown
