notes on setting up tdm and voip on cisco mc3810 routers
the cisco mc3810 is a nifty little "multiservice concentrator" which basically means that it is capable of working with data, voice (tdm), or a mixture of both (say, voip, vofr, etc). you can find these boxes on the secondhand market fairly cheap these days and they offer a lot of bang for the buck. their successors, the cisco iad24xx series of boxes, are very nice, but tend to sell secondhand for at least six to eight hundred dollars or so. similar functionality is available with the mc3810 for less than a hundred dollars.
there are two variants of the mc3810 router. there is the mc3810, which also seems to go by the name mc3810-v. it has a 40 mhz MPC860 processor in it, which makes it computationally equivalent to something like a cisco 2610. these boxes take a single 72 pin EDO SIMM for memory, and the typical 72 pin flash SIMM from a 2600 series or equivalent. there is also a faster version known as the mc3810-v3 that has an 80 mhz MPC860 instead. it is useful to note that the mc3810-v3 takes different memory from the straight mc3810 - a proprietary DIMM.
most mc3810 series boxes that you will find cheaply on the secondhand market will probably have 32 megs of ram and perhaps 8 or 16 megs of flash. if you care about voip, beware that the voip featureset is somewhat rare for these boxes. you have to find a particular version of IOS, 12.0(7)XB1, i believe, or get some version of 12.3, in order to get voip functionality. it does seem, however, that it is possible to get both h.323 and sip running on these, which is nice. also beware that you are going to need 64 megabytes of RAM to run a voip capable IOS, and 16 megabytes of flash. if you are looking at a router on the secondhand market that does not already have 64 megabytes of RAM installed, further beware that you will most likely need to find a special boot ROM to get the box to work with the larger SIMM. i think this is only an issue on the straight mc3810, though, not the mc3810-v3.
well, now that we have some of the background information out of the way, we can start having some fun with these boxes. in this particular excercise, i am going to put together a little tdm network with two mc3810 boxes, trunking over crossover T1 cables. i make things even more interesting by throwing an old adtran tsu600 channel bank in the mix to provide fxs ports in one of the "exchanges". the other mc3810 simply has the analog voice module installed. we will set things up according to the diagram below.
[network diagram]
i wont spend a lot of time discussing the physical cabling involved in setting this all up, but i will furnish a nice link to a cisco site that describes how to assemble your own T1 crossover cables. this allows us to run our own t-carrier spans between boxes without needing a phone company in the middle.
once we get everything cabled together, we can start configuring stuff. i will begin with the first "exchange" with the DVM mc3810 and the channel bank, and then move on the the second smaller exchange with the AVM mc3810.
configuring the channel bank is really easy. i will assume that you have full access to it. first of all, we might as well reset it back to the factory configuration. to do this, go to the UTIL menu from the front panel, and select the FACT RESTORE option. this will zero out the configuration of the channel bank. now, get back to the main menu, and we can configure the T1 signalling parameters. we can pick pretty much anything we want, but it has to match up on the cisco. go to the CONFIG menu, then select NETWORK. i set FORMAT to ESF and CODE to B8ZS. make sure that the TIMING MODE is NETWORK (NI). other than that, we can leave it at the defaults.
now that we configured the network interface on the channel bank, we must set up the mapping between ds0 channels and timeslots on the T1. to do this, go back to the main menu on the front panel of the TSU600 and select CONFIG again. scroll down and select DS0 MAP A. from within that menu, then select COPY A > TEMP. once you have done this, select EDIT TEMP. go from DS0 1 to DS0 24, assigning each one an individual FXS/FXO port. i like to keep it simple, port 1 to timeslot 1, port 2 to timeslot 2, and so on, but you are free to make the mapping as confusing as you would like. once you have finished up with channel assignment, go back and select APPLY TEMP > A. this will copy the edits that you made in TEMP to profile A, which should be by default the operating profile. the changes should take effect immediately - there is no need to explicitly save them.
that should do it as far as configuring the channel bank goes. scrounge up a couple of phones and hook them up to the channel bank. in my plan, i hooked up two phones, to the first two FXS ports. the one on port 0 will have the number 1000, and the one on port 1 will have the number 1001. we will encode this in our dial plan on mc3810-1. we will configure it using the following parameters.
controller T1 0
 mode cas
 framing esf
 clock source internal
 linecode b8zs
 ds0-group 10 timeslots 1 type fxs-loop-start
 ds0-group 11 timeslots 2 type fxo-loop-start
 description trunk to mc3810-2
!
controller T1 1
 mode cas
 framing esf
 clock source internal
 linecode b8zs
 ds0-group 0 timeslots 1 type fxs-loop-start
 ds0-group 1 timeslots 2 type fxs-loop-start
 description trunk to channel bank
!
voice-port 0:10
 timeouts wait-release 3
!
voice-port 0:11
 timeouts wait-release 3
!
voice-port 1:0
 timeouts wait-release 3
!
voice-port 1:1
!
dial-peer voice 100 pots
 destination-pattern 200.
 no digit-strip
 port 0:11
 forward-digits all
!
dial-peer voice 1 pots
 destination-pattern 1000
 port 1:0
!
dial-peer voice 2 pots
 destination-pattern 1001
 port 1:1
!
alright, there is a lot of information here. first lets look at T1 1. this is the trunk to the channel bank. we configure it with framing ESF and linecode B8ZS to match the parameters configured on the channel bank. we set up our router as being the clock source for the span, which is why the channel bank was configured to get clock from the network. we put the controller into CAS mode, which allows us to create voice channel groups. finally, we create two ds0-groups over which we trunk calls from the channel bank to the mc3810. when you create these ds0-groups, voice-port 1:0 and voice-port 1:1 will automatically be created.
now, lets look at controller T1 0. it is configured very similarly to T1 1. we will be using T1 0 as a trunk between mc3810-1 and mc3810-2. again, we set the framing to ESF and the linecode to B8ZS. we decide to make mc3810-1 the clock master for the span. again, we put it into CAS mode so we can create voice channel groups. finally, we set up two trunk lines to mc3810-2, one FXO for outbound calls to mc3810-2, and one FXS for inbound calls from mc3810-2.
there is not a whole lot to configuring the voice ports themselves. i happen to have "timeouts wait-release 3" set, but it probably doesnt matter a whole lot. the rest of the important stuff is in the dial plan, which we set up using the dial-peer commands. dial-peers 1 and 2 are the two local phones, hanging off the channel bank, which, as i mentioned earlier, we are configuring with the extension numbers 1000 and 1001. you can see how we map the number to the port with the dial-peer command. we also set up dial-peer 100 as an outbound trunk to mc3810-2.
now, find a few more phones and hook them up to some of the FXS ports on mc3810-2. configure it using the following parameters, which are very similar to those used for mc3810-1.
controller T1 0
 mode cas
 framing esf
 linecode b8zs
 ds0-group 10 timeslots 1 type fxo-loop-start
 ds0-group 11 timeslots 2 type fxs-loop-start
 description trunk to mc3810-1
!
voice-port 0:10
!
voice-port 0:11
!
voice-port 1/1
 timeouts wait-release 3
!
voice-port 1/2
!
voice-port 1/3
!
voice-port 1/4
!
voice-port 1/5
!
!
dial-peer voice 1 pots
 destination-pattern 2000
 port 1/1
!
dial-peer voice 2 pots
 destination-pattern 2001
 port 1/2
!
dial-peer voice 3 pots
 destination-pattern 2002
 port 1/3
!
dial-peer voice 4 pots
 destination-pattern 2003
 port 1/4
!
dial-peer voice 100 pots
 destination-pattern 100.
 no digit-strip
 port 0:10
 forward-digits all
!
again, let us look at T1 0 first. since mc3810-2 has the AVM installed instead of the DVM, it only has one T1 span available. we configure ESF and B8ZS on the line so that it matches up with its peer, mc3810-1. we again put the line in CAS mode so we can create voice groups, and create two such groups, one FXS to handle incoming calls from mc3810-1, and one FXO to handle outbound calls to mc3810-1. although my ds0-group numbers match up between mc3810-1 and mc3810-2, this is just coincidence and has nothing to with the configuration itself.
again, you see that we really dont do anything special with configuring the voice ports, and the dial plan is quite simple. we assign extensions 2000-2003 to the four FXS ports on the AVM. voice-port 1/5 is an analog FXO port that is unused in this configuration, so it doesnt make its way into the dial plan. we configure dial-peer 100 for outgoing calls to mc3810-1. again, although dial-peer numbers match up between the two mc3810 boxes, this is coincidence and has noting to do with the configuration.
take note that we include the "forward-digits all" configuration option; this ensures that when calls are trunked according to a wildcard such as 100. or 200. we are passsing the entire dialed string e.g. 2001 or 1001, rather than cutting away the matched digits (200, 100) and passing only what is left (1). we dont want this since the dial-plans on the two systems are assuming that they will get the full extension numbers. i also include "no digit-strip" which is supposed to do something similar. further testing is needed to see if both are really needed, or if one will suffice.
this should get you up and running with a simple 2-node tdm network running between these two mc3810 boxes. you should be able to dial "2000" from extension 1000 or 1001 and have it ring through, or you can dial "1000" or "1001" from extension 2000 and have that ring through as well. clearly there is a great deal more configuration that could be done, but this should provide a good baseline configuration for a little experimentation.
now lets make things more interesting by throwing an asterisk server into the mix. i took an old sun ultra 1/200e system running solaris 9 and built asterisk 1.4.0 on it. when things are all said and done, this will give us a network that looks something like the diagram below.
[tdm+voip network diagram]
a little bit of source hacking was required to get asterisk 1.4.0 up and running on solaris 9. i had to tweak the makefile slightly and modify a few source files to add extra includes. i also had to delete a few source files that were not applicable, and recast a few things using alternate system calls that were actually available in solaris. you can download my hacked asterisk sources here. you shouldnt even run a configure. just do the following.
# gunzip asterisk-1.4.0-sol9.tar.gz
# tar xvf asterisk-1.4.0-sol9.tar
# cd asterisk-1.4.0-sol9
# make ; make install ; make samples
this should get you an installation of asterisk 1.4.0 with prefix of /usr/local. there will be some sample config files installed in /usr/local/etc/asterisk. go to /usr/local/etc/asterisk and delete the sip.conf file as well as the extensions.conf and extensions.ael files. the stock samples are way too complex for what we are trying to do here and obscure the important points of configuration. they also mostly assume that we are using zaptel pci cards or other such things and thus are largely irrelevant to configuring asterisk to interoperate with these ciscos. create a new sip.conf file and configure it as follows.
[general]
port = 5060
bindaddr = 192.168.1.10
context = default
dtmfmode = auto
allow=all
canreinvite=no

[mc3810-1]
type=friend
host=192.168.1.1
context=default
dtmfmode=auto
disallow=all
allow=ulaw
nat=no

[mc3810-2]
type=friend
host=192.168.1.2
context=default
dtmfmode=auto
disallow=all
allow=ulaw
nat=no
this assumes that we will give our two mc3810 systems the ip addresses 192.168.1.1 and 192.168.1.2 for mc3810-1 and mc3810-2 respectively, and that our asterisk system will be sitting on the ip address 192.168.1.10. now we will configure our extensions.conf file on the asterisk system to set up a couple of test numbers to dial. in this case, we will set up a milliwatt tone, an echo circuit, and the asterisk voice mail system, which is a good way to verify that our DTMF relay is working. create the extensions.conf file as so.
[default]

; exten => destination-pattern,sequence number,function

exten => 3000,1,Echo                            ; Do the echo test

exten => 3001,1,Milliwatt                       ; Milliwatt test tone

exten => 3006,1,VoicemailMain(@default)         ; Voice mail system
exten => 3006,2,Hangup
we wont be using an extensions.ael file in our case so you dont have to worry about making another one of these. so, now we can configure our cisco mc3810 units. the two mc3810 units will be configured identically. to set them up to point to the asterisk server, add the following configuration parameters.
!
voice service voip 
 sip
!
sip-ua 
 retry invite 3
 retry response 3
 retry bye 3
 retry cancel 3
 timers trying 1000
 sip-server ipv4:192.168.1.10
!
dial-peer voice 120 voip
 destination-pattern 300.
 session protocol sipv2
 session target ipv4:192.168.1.10
 session transport udp
 codec g711ulaw
!
add this configuration to both mc3810-1 and mc3810-2. now, if you fire up asterisk on the solaris host, you should be able to dial the echo and milliwatt test lines from phones on either mc3810 box. dial up the voice mail system and make sure that the DTMF gets through properly. i found that it would only really work between the cisco and the asterisk box when the asterisk system was set to "auto" dtmfmode, and the cisco was set to do dtmf relay inband, which occurs when no dtmf-relay method specified in the dial-peer and g711ulaw is used as the codec.
i also want to discuss briefly translations on voip dial peers. unlike with hardware voice ports, you cannot use the digit-strip and forward-digits configuration parameters on the cisco to manipulate what digits get sent to the voip peer. instead, we have to use a translation rule set. here is a simple example of a translation rule set that strips a leading 9 from a string of dialed digits, and a dial peer that makes use of it to translate outgoing digit strings.
!
translation-rule 1
 Rule 0 ^90 0
 Rule 1 ^91 1
 Rule 2 ^92 2
 Rule 3 ^93 3
 Rule 4 ^94 4
 Rule 5 ^95 5
 Rule 6 ^96 6
 Rule 7 ^97 7
 Rule 8 ^98 8
 Rule 9 ^99 9
!
!
dial-peer voice 9 voip
 description sip trunk with outgoing digit translation
 destination-pattern 9T
 translate-outgoing called 1
 session protocol sipv2
 session target ipv4:10.1.1.10
 session transport udp
 codec g711ulaw
!
home