Asterisk 1.2 and Xs4all VoIP configuration
A while back the excellent Dutch ISP Xs4all introduced a VoIP service for its subscribers. Here is the configuration to make Asterisk 1.2 work with Xs4all. But before we go into the config one remark. There is a problem with Asterisk and how the Cirpack switch that Xs4all uses sends DTMF tones. You have to patch the file rtp.c of the Asterisk source and rebuild Asterisk. If you use Fedora, RHEL or CentOS then you can use these (S)RPMs that already have this problem solved.
Search in rtp.c for the following lines:
[34] = {1, AST_FORMAT_H263},
[103] = {1, AST_FORMAT_H263_PLUS},
[97] = {1, AST_FORMAT_ILBC},
[101] = {0, AST_RTP_DTMF},
[110] = {1, AST_FORMAT_SPEEX},
and add this line:
[96] = {0, AST_RTP_DTMF},
Now let’s get on with the configuration.
In sip.conf add the following lines. Obviously you need to replace 08787xxxxx with your number and replace ******** with your password.
register => 08787xxxxx:********@sip.xs4all.nl/08787xxxxx
[xs4all-in]
type=friend
username=08787xxxxx
fromuser=08787xxxxx
fromdomain=sip.xs4all.nl
secret=********
host=sip.xs4all.nl
insecure=invite
context=from-xs4all
canreinvite=no
dtmfmode=inband
disallow=all
allow=alaw
In extensions.conf add something like the following (adjust to your needs):
[from-xs4all]
exten => 08787xxxxx,1,Dial(SIP/100,30,t)
exten => 08787xxxxx,n,Hangup()
I did not need to use “nat=yes” although my Asterisk box is behind nat. It may depend on the modem. This setup works with a Thomson SpeedTouch 716.
Dear Patrick,
I have been setting up Asterisk 1.4 and managed to setup communication with XS4ALL too. I had problems with the ringtone when dialing from an outside line to the xs4all number; there was no tone, but the rest worked fine. The command in the extensions.conf were.
[from-xs4all]
exten => xs4all_1,1,Answer()
exten => xs4all_1,n,Dial(SIP/100,30,t)
exten => xs4all_1,n,Hangup()
I managed to get the dial tone after changing it to:
[from-xs4all]
; exten => xs4all_1,1,Answer()
exten => xs4all_1,1,Dial(SIP/100,30,t)
exten => xs4all_1,n,Hangup()
According to the documentation it is advised to use the Answer() command.
Do you know why it should be left out in this case? And will it have implications?
Kind regards,
Peter Zandbergen
Hi Peter,
You should not have to add Answer() to this part of the dialplan. It’s probably a copy and paste mistake on my part. Think if it this way: if you call someone and he/she does not answer the phone then you are not charged for it by your telco (for example KPN). So if you add Answer() and someone calls you but you don’t pick up the phone then the caller will get charged for this call since it was answered. So it makes total sense *not* to have Answer() in this part of the dialplan. Thanks for bringing it up.
Kind regards,
Patrick