Hayling Island

Hayling Island

Saturday, June 23, 2018

Phones are working .. PoE is on .. and Asterisk and routing

So I have now installed a couple of switches in the loft, and Fireball, the house server is back online. I established two networks - one yellow zone, for the house and the wifi network, and the purple zone with the phones.

I needed a separate network for the phones, since they need to boot from a TFTP server. Some of the Cisco phones, like the 7970 actually won't seem to accept a static IP, so they need a DHCP server that also gives out the address of the TFTP service as well. Now, since the house router doesn't dish out advanced settings like that - a bit Cisco unique -  I have to serve up the phone network DHCP and TFTP settings from Fireball. So it is the router for the phone subnet.

As is commonplace for Asterisk, the phones then started exhibiting the one-way-voice problem. If I call between extensions in the house, no problems. However, as soon as I try to call in from outside, the voice only works one way.

Turns out that it is not the usual codec issue, nor is it a NAT issue, but a routing issue ..

If the traffic is coming from a hard phone to a soft phone, the hard phones are routed to Fireball anyway, since their default gateway is the Fireball interface. However the reverse doesn't work, since the switch is not layer 3, and doesn't know that 192.168.4.x traffic needs to route via Fireball. Since all of the hard phones are on a network that doesn't have a routing rule on the router (not a good name for a device for which I can't provide internal routing information), they can't receive RTP data from POTS calls and the sipgate service.

So I changed the settings in sip.conf to force all traffic for phones to go via Fireball, rather than trying to allow the RTP flows directly between devices. That seems to work. 

sip.conf has to be set to identify each of the internal networks separately. In my case this looks like

externip=hilabs.dlinkddns.com ; This is the free ddns service from Dlink - works fine

localnet= ; allows multiple lines
localnet=   ; 

directmedia = no ; force all traffic to go via Asterisk on Fireball 

Seems to work ok now. The loading on Fireball increases very slightly, but hardly an issue since the compressed audio only consumes about 64K bits/second, and it is compressed and decompressed at source (viz the phones). Unless I was running a call centre, Fireball can cope. It copes an awful lot better now it is running headless, so it's not running KDE, or Gnome, or any window manager at all. I love the command line!