SIP/VOIP at home

Preamble
I wished to separate the phone line from the internet supplier in order to make cheaper international phone-calls. I have achieved this by implementing a SIP/PTSN combo solution, routing some normal PTSN traffic over a SIP connection instead.

Hardware

To do this I purchased two grandstream products HT802, HT813 Analog Telephone Adaptor (ATA) devices.

HT802 – This device allows 2 phones (2 FXS ports) to be connected via VOIP
HT813 – This device allows 1 phone (1 FXS port) to be connected to VOIP and 1 line out to the phone line (via FXO port)

FXS ports will connect to a phone.
FXO ports will connect to a phone wall socket going to the exchange (PSTN).

I combined these with Asterisk to provide a VOIP solution. I run Asterisk as a container on docker on my synology NAS.

Mostly I followed the article.

https://theworklife.com/graham-miln/2017/12/06/voip-asterisk-synology-via-docker/

But I ended up using a different supplier of the docker image, as the original one was not readily available.

Installing a docker image is relatively simple, and once it’s running you can connect to it easily and treat it as an independent computer.

In the Asterisk package I needed to configure extensions.conf and sip.conf in order to match my needs, but other than that, it seems to run out of the box.
I did force the SIP connection to use ether ulaw or alaw encoding. Reading around the subject these are the primary codecs used in Europe and America. Both should allow the best quality I can get for my phone line.

House wiring

The wiring of the house however wasn’t as trivial.

Grandstream ports are all rj11, and I needed to map the bt wiring to these. Apparently rj11 connections are generally set up so the middle 2 pins carry the signal, rather than 2,5 in the bt system. So after a bit of googling I set this up and it connects well. (As one article remarked all we need is another standard!)

The second bit of wiring consisted of matching old bt 4 core blue, green, orange and brown to the 2 centre wires of a rj11. It appears that in my case the blue and the orange carry the signal.

The total pieces of kit, and house wiring have given me three separate phone zones, that I can control independently.

Infrastructure

I have 2 switches I needed to configure.

T2600G-28TS
This is a layer 2+ switch which can be configured with a voice vlan. I did however, have to append to the OUI settings the mac address prefix of grandstream products, so the switch knows it’s dealing with voice packets.

TL-SG1024DE
This is a simpler managed switch, and I turned QoS to use 802.1P Based.
In order to make this work, I made the grandstream devices set SIP 802.1p and RTP 802.1p to the value 5.
The setting (5) should mean it’s voice traffic, and get routed appropriately quickly through the switch. I did however have to set the 802.1Q/VLAN Tag on the grandstream devices in order to make the 802.1p take effect.
I didn’t use DSCP Based, as I though it would give me less flexibility in the future, although for a ‘normal’ installation I suspect it might be simpler.

Testing
I have tried numerous phonecalls to different zones in the house. But it was strange when I had to really use the system to call the PTSN line in anger, I did feel a bit anxious… Thankfully I think the line was actually clear than the previous direct PTSN, mainly due to less telephones hanging off a single PTSN.
I have tried phoning some numbers abroad, but the SIP connection is really in beta test at present. I did notice no perceivable difference in quality between using my PTSN to overseas as compared to the SIP connection. The connection phase however is a little more clunky as the phonecall has to work its way through 1 grandstream device, Asterisk and then the SIP carrier.

ToDo
I am unhappy that currently I am using 2 stage dialling as mentioned in the link I copied the implementation from.
e.g. Dial(SIP/ht503fxo,60,D(w${EXTEN})) I believe it is possible to change to 1 stage dialling, but have not tried yet.

I also need to add voicemail and conferencing functionality once I am happy with the current setup.

conclusion
Seems to work, but need to test out the SIP international calling more, check the clarity is good.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.