Edit: This post is now quite out of date. There’s a more recent discussion of this at the trixbox forums.
Despite digium‘s screwed up licensing restrictions, and its diabolical coding standards (something which Callweaver will hopefully make a thing of the past, but that’s for another day), SIP over TCP support is now finally available in asterisk (at least for the 1.2 branch).
Brief instructions how to upgrade your 1.2.x installation are given below:
Download the source
cd /usr/src wget http://downloads.digium.com/pub/asterisk/releases/asterisk-1.2.24.tar.gz tar -zxf asterisk-1.2.24.tar.gz
Get and apply the patch
cd asterisk-1.2.24/channels wget -O asterisk-1.2.24-tcp-patch "http://bugs.digium.com/file_download.php?file_id=15742&type=bug&download" patch < asterisk-1.2.24-tcp-patch
ensure at this point that all of patch was applied correctly. If it wasn't, probably best to check the related bug report on digium for details. Next we build & install it
cd .. make asterisk -rx "stop gracefully" make install asterisk -vvvc
If everything works as it should, your asterisk should be up and running again, but this time with SIP over TCP support. You can check what ports/protocols asterisk is listening on using the command
netstat -l -p | grep asterisk
Next we add the following two lines to sip.conf (or sip_custom.conf if you're using freepbx)
on the asterisk console, and you should be good to go.
That's it. Configure your SIP clients to use TCP, or both TCP & UDP, depending on packet size (the auto setting on some clients), and start making calls. In particular this works with the nokia voip client (tested on E65 in both TCP & Auto modes).