!
! Set the hostname
!
hostname cisco3845
!
! Setup the ethernet
!
interface GigabitEthernet0/0
 ip address 172.24.0.2 255.255.255.0
 no shut
!
! turn on routing and set up BGP
!
ip routing
router bgp 64823
 neighbor 172.24.0.1 remote-as 64823 ! VyOS
!
! Setup SSH keys and choose SSH version
!
crypto key generate rsa label cisco3845 modulus 2048
ip ssh version 2
!
! and enable SCP too
!
ip scp server enable
!
! Create a user to use with SSH
! privilege 15 gives enable access
! 'secret' will hash the password as opposed to 'password' which stores in plaintext
!
username admin privilege 15 secret redacted
!
! setup the vty devices, used for ssh, telnet, LAT, etc.
! login local does local auth
!
line vty 0 4
 exec-timeout 60
 login local
 transport input all
!
! Set up some numbering translations
!
! 100 used for incoming called and most VCF-local calling number translations
! other translations may be required for incoming calling number from other sources
! basically if it's a local number, strip to 4 digits
! in all cases covered, set hopefully appropriate numbering plan and type
!
voice translation-rule 100
 rule 10 /^\([2-9]...\)$/ /\1/ type any subscriber plan any private ! VCF local
 rule 20 /^1200323\([2-9]...\)$/ /\1/ type any subscriber plan any private ! VCF local C*NET 
 rule 30 /^1222823\([2-9]...\)$/ /\1/ type any subscriber plan any private ! VCF local SCDP
 rule 40 /^\(1200.......\)$/ /\1/ type any national plan any private ! non-local C*NET
 rule 50 /^\(1222.......\)$/ /\1/ type any national plan any private ! non-local SCDP
 rule 60 /^\(1[2-9]..[2-9]......\)$/ /\1/ type any national plan any national ! PSTN
 rule 70 /^\(0\)$/ /\1/ type any network plan any private ! operator
 rule 80 /^\([2-9]11\)$/ /\1/ type any network plan any private ! N11 codes
!
! this profile should apply to most/all VCF local stuff (and possibly more)
!
voice translation-profile VCF-local-incoming
 translate calling 100
 translate called 100
!
! set up some class-of-restriction stuff
!
! use restricted as an incoming COR for things that should be more restricted (general VCF)
! use unrestricted as an outgoing COR for things that should not be dialable by those that are restricted (required unrestricted)
! having no COR at all is equivalent to 0 restrictions
!
dial-peer cor custom
 name restricted
 name unrestricted
dial-peer cor list restricted
 member restricted
dial-peer cor list unrestricted
 member unrestricted
!
! choose T1 for the T1/E1 cards
!
card type t1 0 0
card type t1 0 1
card type t1 0 2
card type t1 0 3
card type t1 2
!
! set cards to participate in clocking
!
network-clock-participate wic 0
network-clock-participate wic 1
network-clock-participate wic 2
network-clock-participate wic 3
network-clock-participate slot 2
!
! pick meridian to be the master clock (it has a more accurate oscillator than the cisco)
!
network-clock-select 8 T1 0/0/0
!
! choose default ISDN switch type
!
isdn switch-type primary-ni
!
! Meridian PRI trunking
!
! first the controller
!
controller T1 0/0/0
 description meridian
 clock source line ! meridian is our clock master, since it has a better oscillator than the cisco and definity
 framing esf
 linecode b8zs
 cablelength short 110ft
 pri-group timeslots 1-24
!
! then the interface (PRI)
!
interface Serial0/0/0:23
 isdn protocol-emulate network
 isdn send-alerting
 shut
 isdn switch-type primary-qsig
 no shut
 no isdn outgoing ie connected-number
!
! and the voice port
!
voice-port 0/0/0:23
 no non-linear
 no vad
 no comfort-noise
 translation-profile incoming VCF-local-incoming
!
! lastly, the dial-peers
!
dial-peer voice 100 pots
 description meridian extensions
 destination-pattern 20..
 port 0/0/0:23
 forward-digits all
 huntstop
dial-peer voice 101 pots
 description N11
 destination-pattern [2-9]11
 port 0/0/0:23
 forward-digits all
 huntstop
dial-peer voice 102 pots
 description operator
 destination-pattern 0
 port 0/0/0:23
 forward-digits all
 huntstop
dial-peer voice 103 pots
 description TALK feed
 destination-pattern 8255
 port 0/0/0:23
 forward-digits all
 huntstop
!
! configure the controllers and pri-groups for the MICA
! 0/0/1 gets looped via T1 crossover into the MICA's interface, which is 2/0
! kludgey, but allows us to put the MICA on the cisco's own dialplan, which
! we can't otherwise do.
!
controller T1 0/0/1
 description to MICA
 clock source internal
 framing esf
 linecode b8zs
 cablelength short 110ft
 pri-group timeslots 1-24
!
controller T1 2/0
 clock source line
 framing ESF
 linecode b8zs
 cablelength short 110ft
 pri-group timeslots 1-24
!
! configure PRI serial interfaces
! note MICA interface (2/0) gets isdn incoming-voice modem
!
interface Serial0/0/1:23
 isdn protocol-emulate network
 isdn send-alerting
!
interface Serial2/0:23
 isdn incoming-voice modem
 isdn send-alerting
!
! configure PRI voice-port
! note MICA interface does not get voice-port
!
voice-port 0/0/1:23
 no non-linear
 no vad
 no comfort-noise
 translation-profile incoming VCF-local-incoming
!
! specify the mica national settings
!
modem country mica t1-default
!
! MICA dial-peer
!
dial-peer voice 200 pots
 destination-pattern 2200
 port 0/0/1:23
 forward-digits 0
 huntstop
!
! MICA serial line configs
!
line 4/0 4/23
 login local
 modem InOut
!
! compu_85 comdial PRI
!
! first the controller
!
controller T1 0/1/0
 description compu_85
 clock source internal
 framing esf
 linecode b8zs
 cablelength short 110ft
 pri-group timeslots 1-24
!
! then the interface (PRI)
!
interface Serial0/1/0:23
 isdn protocol-emulate network
 isdn send-alerting
!
! and the voice port
!
voice-port 0/1/0:23
 no non-linear
 no vad
 no comfort-noise
 translation-profile incoming VCF-local-incoming
!
! lastly, the dial-peers
!
dial-peer voice 300 pots
 description compu_85
 corlist incoming restricted
 destination-pattern 85..
 port 0/1/0:23
 forward-digits all
 huntstop
!
! Asterisk PRI trunking
!
! first the controller
!
controller T1 0/1/1
 description asterisk
 clock source internal
 framing esf
 linecode b8zs
 cablelength short 110ft
 pri-group timeslots 1-24
!
! then the interface (PRI)
!
interface Serial0/1/1:23
 isdn protocol-emulate network
 isdn send-alerting
!
! and the voice port
!
voice-port 0/1/1:23
 no non-linear
 no vad
 no comfort-noise
 translation-profile incoming VCF-local-incoming
!
! lastly the dial-peers
!
dial-peer voice 400 pots
 description asterisk extensions
 destination-pattern 23..
 port 0/1/1:23
 forward-digits all
 huntstop
dial-peer voice 401 pots
 description C*NET
 destination-pattern 1200.......
 port 0/1/1:23
 forward-digits all
 huntstop
!
! VAX11 PRI trunking
!
! first the controller
!
controller T1 0/2/0
 description VAX11
 clock source internal
 framing esf
 linecode b8zs
 cablelength short 110ft
 pri-group timeslots 1-24
!
! then the interface (PRI)
!
interface Serial0/2/0:23
 isdn protocol-emulate network
 isdn send-alerting
!
! and the voice port
!
voice-port 0/2/0:23
 no non-linear
 no vad
 no comfort-noise
 translation-profile incoming VCF-local-incoming
!
! lastly the dial-peers
!
dial-peer voice 700 pots
 description VAX11
 corlist incoming restricted
 destination-pattern 69..
 port 0/1/1:23
 forward-digits all
 huntstop
!
! FXS T1 to Meridian
!
! first the controller
!
controller T1 0/2/1
 description Meridian POTS
 clock source internal
 framing esf
 linecode b8zs
 cablelength short 110ft
 ds0-group 0 timeslots 1 type fxs-loop-start
 no shut
!
! then the voice-port
!
voice-port 0/2/1:0
 no non-linear
 no vad
 no comfort-noise
 output attenuation 0
 connection trunk 12225630000
 shut
 no shut
!
! lastly the dial-peer
!
dial-peer voice 800 pots
 description meridian POTS connection trunk
 destination-pattern 2299
 port 0/2/1:0
 huntstop
!
! Avery Grade's lines
!
voice-port 3/0/0
 no non-linear
 no vad
 no comfort-noise
 ring frequency 20
 battery-reversal
voice-port 3/0/1
 no non-linear
 no vad
 no comfort-noise
 ring frequency 20
 battery-reversal
dial-peer voice 900 pots
 description avery grade
 corlist incoming restricted
 destination-pattern 2210
 port 3/0/0
 translation-profile incoming VCF-local-incoming
 huntstop
dial-peer voice 901 pots
 description avery grade
 corlist incoming restricted
 destination-pattern 2211
 port 3/0/1
 translation-profile incoming VCF-local-incoming
 huntstop
!
! VoIP stuff
! note fax protocol none to counteract the fax detection doing stupid things to the MICA over VoIP
!
voice service voip
 allow-connections h323 to h323
 allow-connections h323 to sip
 allow-connections sip to h323
 allow-connections sip to sip
 redirect ip2ip
 signaling forward unconditional
 fax protocol none
 sip
  bind control source-interface GigabitEthernet0/0
  bind media source-interface GigabitEthernet0/0
  bearer-capability clear-channel audio
 ip address trusted authenticate
!
! of course we prefer ulaw
!
voice class codec 1
 codec preference 1 g711ulaw
!
! do our best to turn off VAD
!
voice vad-time 65536
!
! trmg H323 SCDP trunking
!
! set up a source-group to match trmg on inbound and apply translations
!
access-list 1 permit 64.71.190.130
voice source-group trmg
 access-list 1
 translation-profile incoming SCDP-incoming-7D
!
! Set up some numbering translations
!
! 200 used for SCDP incoming calls
! basically if it's a local number, strip to 4 digits
!
voice translation-rule 200
 rule 10 /^823\([2-9]...\)$/ /\1/ type any subscriber plan any private ! VCF local
 rule 20 /^8230000$/ /0/ type any national plan any private ! operator
 rule 30 /^\(.......\)$/ /1222\1/ type any national plan any private ! non-local SCDP
voice translation-rule 201
 rule 10 /^1222\(.......\)$/ /\1/ type any national plan any private ! 7 digit SCDP
 rule 20 /^\(....\)$/ /823\1/ type any national plan any private
voice translation-profile SCDP-incoming-7D
 translate calling 200
 translate called 200
voice translation-profile SCDP-outgoing-7D
 translate calling 201
 translate called 201
!
! trmg dial-peer
!
dial-peer voice 500 voip
 no vad
 corlist outgoing unrestricted
 voice-class codec 1
 description trmg h323 SCDP
 destination-pattern 1222.......
 session target ipv4:64.71.190.130
 translation-profile outgoing SCDP-outgoing-7D
 huntstop
dial-peer voice 501 voip
 no vad
 voice-class codec 1
 description trmg h323 SCDP
 destination-pattern 122287[01]....
 session target ipv4:64.71.190.130
 translation-profile outgoing SCDP-outgoing-7D
 huntstop
dial-peer voice 502 voip
 no vad
 voice-class codec 1
 description trmg h323 SCDP
 destination-pattern 1222415....
 session target ipv4:64.71.190.130
 translation-profile outgoing SCDP-outgoing-7D
 huntstop
dial-peer voice 503 voip
 no vad
 voice-class codec 1
 description trmg h323 SCDP
 destination-pattern 1222458....
 session target ipv4:64.71.190.130
 translation-profile outgoing SCDP-outgoing-7D
 huntstop
dial-peer voice 504 voip
 no vad
 voice-class codec 1
 description trmg h323 SCDP
 destination-pattern 1222696....
 session target ipv4:64.71.190.130
 translation-profile outgoing SCDP-outgoing-7D
 huntstop
!
! home H323 trunking
!
! set up a source-group to match the home ISR on inbound and apply translations
!
access-list 2 permit 172.23.255.2
voice source-group home
 access-list 2
 translation-profile incoming VCF-local-incoming
!
! Set up some numbering translations
!
! 300 used for SCDP outgoing call
! basically append 1222823 to 4 digit internal stuff
!
voice translation-rule 300
 rule 10 /^\(....\)$/ /1222823\1/ type any national plan any private ! 1222 + 7 digit SCDP
voice translation-profile SCDP-outgoing-1222-7D
 translate calling 300
!
! home dial-peer
!
dial-peer voice 600 voip
 no vad
 voice-class codec 1
 description home h323
 destination-pattern 1222563....
 session target ipv4:172.23.255.2
 translation-profile outgoing SCDP-outgoing-1222-7D
 huntstop
 
