Connecting Strowger to VoIP

After many years of trying various options, I've settled on using Cisco voice routers as the interface between my strowger exchanges and the internet, but how does that work?

diagram showing how a call flows through the exchange

How is everything linked together?

The strowger exchange has a 2 digit numbering scheme.

The "final selector" maps these numbers onto a bank of 100 outlets, arranged as a block of 10 levels, each level has 10 outlets. When you dial a number, the first digit steps the wipers up to the appropriate level, and then the second digit steps the wipers horizontally to the desired outlet and ring the associated phone.

Some of these numbers are "special" - they're what's called "tie lines" and they don't link to phones, they link our local exchange to a remote one. If you're familiar with office phone systems where you have to "dial 9 for an outside line" then this is pretty much the 1950s equivalent!

In the diagram above, you can see a phone on the left is connected through the linefinder, to a final selector.

We've only got 50 lines, so half the banks aren't connected (in the case of this exchange, they're not even fitted)

  • Levels 2,4,5 & 6 are connected to the demo phones
  • Level 3 is where our tie lines are

The first 4 outlets on the level (31,32,33,34) are reserved for incoming calls from a distant exchange, and the last 3 (38,39,30) are wired up in a group for outgoing calls to a distant exchange.

In our case, that distant exchange is a Dell thin client running Asterisk.

How do we convert from 1950s electrical signals to the SIP protocol that Asterisk talks?

FXO and FXS ports

So that's the Strowger side of things dealt with, lets have a look at the "modern" electronic side of things.

There are two types of voice port on a digital voice gateway:

  • FXO: Foreign Exchange Office - These ports connect to an exchange (pretending to be a phone)
  • FXS: Foreign Exchange Station - These ports connect to a phone (pretending to be an exchange)

To allow calls in both directions from my Strowger equipment, I need both types of port.

  • FXS ports to facilitate calls from Strowger => VoIP
  • FXO ports to facilitate calls from VoIP => Strowger

photo of a small stack of networking equipment, with a cisco 1760, a TP-Link TL-R480T and a Dell thin client

Cisco Modular Access Routers

The equipment I settled on is part of the Cisco range of Modular Access Routers. These come as a chassis that you can fit various interface modules to covering technologies such as serial, adsl, isdn, dialup modems, or analogue telephony ports.

There are a lot of routers in this range, but not all of them support the analogue telephony ports. The best way to check, is to look up the compatability list for the voice cards themselves:

https://www.cisco.com/c/en/us/td/docs/routers/access/interfaces/ic/hardware/installation/guide/voi_wic.html

That pretty much limits us to the Cisco 1700, 2600, 3600 and 3700 series routers. Of those, I picked out the Cisco 1760 as the model to go with.

They're cheap and readily available second hand, they're reasonably low power (25W), have an acceptable port density (up to 16 voice ports) and they run quite happily with the fans removed (although you probably shouldn't do that!)

The Hardware I'm using for EMF

You need a few things:

  • The router chassis (eg a 1760)
  • Voice cards that fit your needs (eg, the 4 port WIC-4FXS or WIC2-4FXO cards)
  • A DSP module with enough channels to support the number of ports you're fitting (The 1760 supports the PVDM-256K range)
  • Enough RAM to run your chosen Cisco IOS Firmware

I think choice of firmware, and the basics of configuring IOS are probably out of scope for this blog post - but if you hunt around on the internet a bit, there's loads of advice about the basics.

I only need 4xFXO and 4xFXS ports for EMF, but I've added some spare modules incase I have a failure on-site and need to rewire things.

Module 0 Module 1 Module 2 Module 3
VIC2-4FXO VIC-4FXS VIC2-4FXO VIC-4FXS

Cisco Voice Configuration

Cisco chose to model the physical ports, and the routing between them as separate configuration objects.

  • voice-port relates to the physical port on the voice card
  • dial-peer relates to the logical representation of a phone number, or a VoIP connection
  • sip-ua all the SIP settings

The voice-port settings blocks are pretty straight forward. Ports are numbered module/port and both start at zero... so a 4 port card, in slot 0 has ports 0/0,0/1,0/2,0/3`

The slightly annoying thing is that on the chassis, the slots are numbered left to right, but on each card the ports are numbered right to left.

I've got no idea why, but "thanks Cisco" I guess.

photo of a small stack of networking equipment, with a cisco 1760, a TP-Link TL-R480T and a Dell thin client

FXO Port configuration

These ports are used for calls going VoIP => Strowger:

voice-port 0/0
 pre-dial-delay 2
 dial-type pulse
 description "FXO Port"
!

We have to set a few parameters to take account of how the 1950s exchange works here.

The Strowger linefinders can take a little time to find the calling line and become ready for dialling, so I set pre-dial-delay to take account of the worst-case hunting time.

The Strowger exchange was built before DTMF was a thing, so dial-type is set to pulse to ensure the Cisco sends any digits as pulses, not tones.

FXS Port configuration

These ports are used for calls going Strowger => VoIP:

voice-port 1/0
 no battery-reversal
 idle-voltage high
 no comfort-noise
 cptone GB
 timeouts interdigit 3
 description "FXS Port"
!

The no battery-reversal and idle-voltage high are set to make sure the Tie Line circuitry in the Strowger reliably siezes the line without introducing any stray pulses.

no comfort-noise reduces the amount of noise on the line, and the Strowger is noisy enough for anyone.

cptone CB enables UK style progress tones

timeouts interdigit 3 is required because we can't reliably predict how many digits will be dialled into this port, so instead we just say "stop accepting digits if none are sent in 3 seconds"

SIP settings

We've got physical hardware covered, we need to do something similar to define the connection to our Asterisk server:

sip-ua 
 no remote-party-id
 retry invite 3
 retry response 3
 retry bye 3
 retry cancel 3
 timers trying 1000
 sip-server ipv4:192.168.0.101
!

no remote-party-id disables caller ID, as that's not supported by the Strowger. Most of the rest is fairly self explanatory or sane defaults.

POTS dial-peers to plumb the ports together

Now we've configured the voice hardware and the VoIP route, we need some dial-peers that can plumb it all together and route calls.

For each FXO port, we'll define a "Plain old telephone service" (POTS) peer with a prefix that we can strip off before sending the rest of the number out of the FXO port.

For our purposes this numbering is arbitrary, but I've chosen 10XY where XY matches the module/port numbering of the voice-port this dial-peer is associated with:

dial-peer voice 1000 pots
 description "Strip 1000 prefix, and pass the rest out FXO 0/0"
 destination-pattern 1000T
 port 0/0
!

If I want to route a call from Asterisk => PAX extension 25, via port 0/0, Asterisk will tell the Cisco router to Dial 100025 - the Cisco will then strip off the 1000 and outpulse the 25 to the Strowger.

For each FXS port, we'll define a POTS peer that can receive an incoming call.

dial-peer voice 1010 pots
 description "1010 - FXS 1/0"
 destination-pattern 1010
 port 1/0
 forward-digits 0
!

You can think of the destination-pattern here as being the local phone number associated with this FXS port.

If we were plugging phones in here, this would allow the cisco to route calls between phones internally, without having to pass them to an external SIP server.

That doesn't make sense in our "strowger => voip" world, so the number here is unimportant. I've just used the same numbering convention as I did for the FXO ports to keep things consistent.

forward-digits 0 prevents the Cisco from repeating the destination number as a string of DTMF digits when the called party answers. That DTMF spill isn't harmful, but it is annoying!

VoIP dial-peers to route all calls to asterisk

We also need a dial-peer that's associated with the Asterisk server we're sending all the traffic to

dial-peer voice 8771 voip
 description "FXS to SIP routing"
 destination-pattern .+T
 session protocol sipv2
 session target ipv4:192.168.0.101
 session transport udp
!

The important part here is the destination-pattern .+T line, which says "route all numbers through this dial-peer" - essentially sending all calls via Asterisk.

Asterisk

I think I should probably leave Asterisk for another blog post, but Asterisk just sees the Cisco router as another SIP peer.

Conclusion:

This may appear a bit ramshackle, and these 1760s aren't the highest spec boxes in the world, but this setup has been pretty reliable for me at home.

I just hope it'll be as reliable in the field at EMF!

What else have I tried?

Whenever I talk about what VoIP hardware I'm using, someone asks "why aren't you using $x"

My choices are constrained by what equipment is readily available on the second hand market in the UK. That rules out a lot of things like channelbanks (eg from Adit or Adtran) as those just don't seem to exist over here.

  • Sipura/Linksys/Cisco ATAs: These don't have pulse dialling support at all
  • Grandstream ATAs: These work "ok" but their pulse dialling support is designed for USA make/break ratios, and isn't very forgiving of UK dials. They're also FXS only, which doesn't help me as I need both FXS and FXO ports
  • Audiocodes MP11x and MP124: I quite like these, and the pulse dialling support is great - but they seem to have an unfortunate habit of explosively dissasembling the PSU. That's probably avoidable with some preemptive recapping, but that's still on my todo list, and I can't trust them for an event like EMF