chan_lantiq Pulse Dialling
I previously wrote about connecting a rotary-style phone to a VoIP-based telephony setup. In the post, I described using a Fritz!Box 7170 as an ATA because of its support for both SIP and pulse dialling. Although it works very well as an ATA, the device is quite dated and does not offer much functionality other than a Fast Ethernet switch. While it also has a built-in modem and WiFi, it only supports ADSL2+ and 802.11g which is pretty much useless nowadays. Though some people may still be on an ADSL connection, I would not trust a device this old to be my gateway to the Internet.
In another post, i wrote about using an OpenWRT-flashed Experiabox V8 as a modem. Like many other modems, this device has built in FXS ports for connecting analog phones. With many of these modems however, phone ports are only supported by the device’s native firmware due to drivers for the phone hardware being unavailable. For Lantiq-based devices such as the Experiabox V8 however, both hardware and Asterisk channel drivers are available. Even better, chan_lantiq even supports pulse dialling!
I recently upgraded the Experiabox to OpenWRT 21.02. With this installed, installing Asterisk is as easy as issuing the following two commands:
opkg update
opkg install asterisk \
asterisk-app-confbridge \
asterisk-bridge-builtin-features \
asterisk-bridge-simple \
asterisk-bridge-softmix \
asterisk-chan-lantiq \
asterisk-chan-rtp \
asterisk-chan-sip \
asterisk-codec-a-mu \
asterisk-res-rtp-asterisk
I configured Asterisk to connect over SIP to my main Asterisk server using chan_sip just like you would in any Asterisk setup.
Although chan_lantiq is relatively niche as far as I can tell, it ships with a very well documented default configuration file.
Below is how I have configured my lantiq.conf
, though some of these options may be the same as what is already set by default.
[interfaces]
;
; Number of FXS ports (default: 2)
channels = 2
;
; Create contexts per channel (default: off)
per_channel_context = on
;
; Set tapi firmware file path
;firmwarefilename = /lib/firmware/danube_firmware.bin
;
; Set tapi bbd file path
;bbdfilename = /lib/firmware/danube_bbd_fxs.bin
bbdfilename = /lib/firmware/vr9_bbd_fxs.bin
;
; Set vmmc device path
;basepath = /dev/vmmc
;
[general]
; Caller id valid standards:
;
; telecordia Bellcore/Telcordia GR-30-CORE; use Bell202 FSK coding of CID information. (default)
; etsifsk ETSI 300-659-1/2/3 V1.3.1; use V.23 FSK coding to transmit CID information.
; etsidtmf ETSI 300-659-1/2/3 V1.3.1; use DTMF transmission of CID information.
; sin SIN 227 Issue 3.4; use V.23 FSK coding of CID information.
; ntt NTT standard: TELEPHONE SERVICE INTERFACES, edition 5; use a modified V.23 FSK coding of
; CID information.
; kpndtmf KPN; use DTMF transmission of CID information.
; kpndtmffsk KPN; use DTMF and FSK transmission of CID information.
;
calleridtype = kpndtmffsk
;
; The channel driver informs Asterisk about supported codecs and their preference.
; The default order ("ulaw, alaw, g722, g726, slin") and the offered codecs may be changed.
; Of course only codecs supported by the TAPI firmware should be specified here.
;
; FYI: the first allowed codec is the preferred one. It seems that Asterisk regularly selects
; the preferred codec for this channel, even if this means that Asterisk needs to translate.
;
; E.g. when Asterisk bridges a SIP channel offering alaw only, and this channel with codec
; list "g722, alaw", then Asterisk may perform cpu stressing transcoding between alaw
; and g722 instead of using the alaw codec of this channel.
;
disallow=all
allow=ulaw
;allow=alaw
;allow=g722
;allow=g726
To actually be able to dial and make phones ring you need something like the below in /etc/asterisk/extensions.conf
:
; lantiq1 and lantiq2 are special contexts corresponding to the FXS ports
[lantiq1]
exten => _X.,1,Goto(outgoing_calls,${EXTEN},1)
[lantiq2]
exten => _X.,1,Goto(outgoing_calls,${EXTEN},1)
[outgoing_calls]
exten => _X.,1,Dial(SIP/sipserver/${EXTEN})
[incoming_calls]
; Dial FXS port 1 for 30 seconds
exten => 31111111111,1,Dial(TAPI/1,30)
; Dial FXS port 2 for 30 seconds
exten => 31222222222,1,Dial(TAPI/2,30)
; Dial both ports for 30 seconds
exten => 31111122222,1,Dial(TAPI/1&TAPI/2,30
With Asterisk configured and running, you should be able to make calls from a rotary phone through any device supported by chan_lantiq running OpenWRT. I can personally confirm the above to work on both the Experiabox V8 (Arcadyan VGV7519) and the o2 Box 6431 (Arcadyan VGV7510KW22).