Asterisk 1.8 on Debian

Download and install

If your Debian version doesn't supply 1.8, You can download it from http://packages.asterisk.org/.

In '/etc/apt/sources.list';


deb http://packages.asterisk.org/deb squeeze main

You need to merge the keys;


wget http://packages.asterisk.org/keys/175E41DF.pub -O - | apt-key add -

Then update and install

More info in the wiki.

Configuration

asterisk.conf

Automatically set systemname to hostname does't always work the way it should.


systemname = my_system_name

sip.conf

Enable IPv6

Make sure that '/proc/sys/net/ipv6/bindv6only' is '0'. Otherwise Asterisk will be IPv6 only! You can set this in '/etc/sysctl.d/bindv6only.conf'.


bindaddr=::

RTP proxy

'directmedia=no' will turn Asterisk into a RTP audio proxy server. It will convert IPv6 RTP audio streams into IPv4 and IPv4 into IPv6 whenever required.


directmedia=no

Call-ID

Asterisk may use IPv6 address based Call-IDs when communicating with IPv4 only systems. This may confuse some software. Using a domain instead solves this problem.


fromdomain=mydomain.tld

TCP

If you want to use TCP enable it;


tcpenable=yes

To use SIP over TCP, just put it in the dial string;


SIP/username[:password[:md5secret[:authname[:transport]]]]@host[:port]

EG;


SIP/john::::tcp@example.org

TLS

If you want to use TLS enable it;


tlsenable=yes

TLS cert and key;


tlscertfile=/etc/asterisk/asterisk.crt
tlsprivatekey=/etc/asterisk/asterisk.key

Allow self signed certs;


tlsdontverifyserver=yes

I use a modified version of '/usr/share/doc/exim4-base/examples/exim-gencert' to generate the cert and key pair. Modify to suit your needs.

Example dial string;


SIP/john:tls@example.org