OpenWrt Forum Archive

Topic: FXS support

The content of this topic has been archived between 23 Apr 2018 and 4 May 2018. Unfortunately there are posts – most likely complete pages – missing.

I experiment with a O2-Box 6431.
This device have a:
"Lantiq XWAY SLIC120 (PEF 42068 V V1.2), 3x FXS (TAE ports which provide POTS via a SIP gateway)"

How can i Run it ?

1.) How can i find out that the Hardware is working well.
Exist a representing device file in /dev ?
1.1) what is the meaning of these devices files:
/dev/dsl_cpe_api0
/dev/ifx_mei
/dev/gptu
/dev/port
/dev/ptmx
/dev/ubi_ctrl

2.) How does the communication work beetween asterisk and FXS ?
(will be ATA commands used like a modem ?)

3.) What are the general method for FXS support on OpenWRT ?
(I was hoping i install luci-app-pbx and the rest follows by itself)

You will probably get much better responses to post on DSLReports forum.

It is possible to run the FXS with asterisk... I have tested it. It works.

It is needed to patch the current trunk of OpenWRT.
I think that the OpenWRT trunk will support it in a few months out of the box.

There is one issue that WiFi does not work properly if VMMC is activated (because RAM size must be reduced). But that might be a problem with the Wifi driver.

See https://bugzilla.kernel.org/show_bug.cgi?id=110091

Thanks for reply

can you say how ?

stefan-koch wrote:

@Plonk34
If you need patching information, please activate the forum option that others can send emails to you.

I am interesting in the patching information, but I don't know how to activate the forum option as you mentioned above so that others can send e-mails to me.

AFAIK, sending email through the forum is not possible and can only be activated by the forum admin.
There might be good reasons why this functionality is not activated.

See #24 for update

1. Download the following archive and unzip.

https://drive.google.com/file/d/0B9Z_Kp … sp=sharing

2. Run

./preparebuild.sh

3. After a while a menuconfig dialog comes up

3.1. Select Lantiq, XRX200, o2 Box 6431 / Arcadyan VGV7510KW22 (NOR)

3.2. Advanced configuration options, Toolchain Options, C Library implementation
--> Select "Use (e)glibc"

This is because asterisk does not load modules with musl library

3.3. Select the extra packages:

  • kmod-fs-ext4

  • kmod-usb-storage

  • luci

  • asterisk18

  • asterisk18-app-stack

  • asterisk18-chan-lantiq

  • asterisk18-chan-local

  • asterisk18-codec-alaw

3.4. Exit menuconfig

4. Run make
cd openwrt
make -jX (X is the number of available cpu threads)

5. Compiling fails
You have to patch the DSL drivers Makefile.am for glibc toolchain.
See https://dev.openwrt.org/ticket/21343
Replace all "-Bstatic -dn -static" entries in Makefile.am to "-Bstatic -dn"

Call make -jX again

6. After this you will get
bin/lantiq-glibc/openwrt-lantiq-xrx200-VGV7510KW22NOR-squashfs.image

7. Copy this file to /tmp dir (with scp) on the box with running OpenWRT (NOR Version!)
and call
sysupgrade /tmp/openwrt-lantiq-xrx200-VGV7510KW22NOR-squashfs.image
on the box

8. After rebooting you should hear a tone with a connected phone

9. You need a working extensions.conf to make calls, see #10, #12, #13

(Last edited by stefan-koch on 10 Jan 2017, 23:41)

The FXS patches are based on Eddi De Pieri's work for barrier breaker branch.
Especially the 0152...patch file inside of the archive.
See https://dev.openwrt.org/search?q=eddi

stefan-koch wrote:

The FXS patches are based on Eddi De Pieri's work for barrier breaker branch.
Especially the 0152...patch file inside of the archive.
See https://dev.openwrt.org/search?q=eddi

Which post?

Here is a little example (only important parts) for the asterisk configuration with FXS...
Read this, too:
http://the-asterisk-book.com/1.6/


asterisk/sip.conf
add to [sipgate] context
context=in_sipgate


asterisk/extensions.conf

[out_sipgate]
exten => _[+0-9].,1,Set(CALLERID(num)=NUMBER)
exten => _[+0-9].,2,Dial(SIP/sipgate/${EXTEN},30,Trg)
exten => _[+0-9].,3,Hangup

[in_sipgate]
exten => SIPID,1,Goto(tel1_in,s,1)

[tel1_out]
exten => _Z,1,Goto(out_internal,${EXTEN},1)
exten => _[+0-9].,1,Gosub(out_sipgate,${EXTEN})

[tel2_out]
exten => _Z,1,Goto(out_internal,${EXTEN},1)
exten => _[+0-9].,1,Gosub(out_sipgate,${EXTEN})

[ltq1_out]
;exten => _[+0-9]!,1,Goto(tel1_out,${EXTEN},1)
exten => _[+0-9]!,1,Dial(local/${EXTEN}@tel1_out/n)

[ltq2_out]
;exten => _[+0-9]!,1,Goto(tel2_out,${EXTEN},1)
exten => _[+0-9]!,1,Dial(local/${EXTEN}@tel2_out/n)

[ltq1_in]
exten => s,1,Dial(TAPI/1,30,t)

[ltq2_in]
exten => s,1,Dial(TAPI/2,30,t)

[tel1_in]
;exten => s,1,Goto(ltq1_in,s,1)
exten => s,1,Dial(local/s@ltq1_in/n)

[tel2_in]
;exten => s,1,Goto(ltq2_in,s,1)
exten => s,1,Dial(local/s@ltq2_in/n)

[lantiq1]
include => ltq1_out

[lantiq2]
include => ltq2_out

(Last edited by stefan-koch on 18 Feb 2016, 13:25)

You have change the interface section in asterisk/lantiq.conf as the following:

[interfaces]
;
; Number of FXS ports (default: 2)
channels = 2
per_channel_context = on

(Last edited by stefan-koch on 18 Feb 2016, 13:24)

The following describes settings for asterisk/sip.conf

you may want to set generally

nat=yes
directmedia=no
qualify=yes

if you don't want to open asterisk port in the firewall (default 5060, but you could change this port to another number)

But you should open the RTP (you could change the range, too) ports in the firewall.



The following configuration should work for sipgate VoIP:

register => SIPID:PASSWORD@sipgate.de/SIPID
[sipgate]
type=peer
host=sipgate.de
fromdomain=sipgate.de
dtmfmode=rfc2833
insecure=port,invite
directmedia=no
transport=udp,tcp
context=in_sipgate
disallow=all
allow=alaw,ulaw
username=SIPID
fromuser=SIPID
secret=PASSWORD

(Last edited by stefan-koch on 18 Feb 2016, 13:25)

smile Juuhuu I hear a peep, I hear a peep smile

Thank you soo much,
I was searching a lot of afternoons for informations about FXS support.
I could not have done alone.

And Thank you too for so much details.
It is more than I hope.
I will learn more about asterisk in the next days, but in this momment i am really happy.

I think this thread a so usefull that everybody should link it in the table of hardware.

I have modifie your script and adding your howto for building a new image
o26431-vmmc_v2-easypeasy.tar.gz

I Love my 6 euro VDSL Router.
A lot of people grumble and mock about this Router and of course, the original firmware is only good enough for convicts on parole which should not go online.
But i think i will replace my FritzBox with it in Future.

Hello together,

I have build my Openwrt for 6431 from trunk according your descriptions.

I use Asterisk18 with chan_lantiq.
When Asterisk loads the lantiq_channel it fails with error while loading the voice firmware from /lib/firmware.
The files are in place.

has anybody an Idea why it fails.

Thank you

Hmm it works fine for me, build mai 2016

The description will not work 1:1,
because the Asterisk 1.8 support was delete later telephony commit: 676188043d313cdfe2ced3299d2e0e10ffc383d3

here my commits that i have use:

openwrt:          cda52dcb329e02674175b60426be26cd813294a6
luci:                6415c04d1342162bad16874653189b3780cdbd04
management: de36f62549d8da3723c80182812dc89ead2959fd
packages:       45840cf56d04e197e933de09c880d3fc4e33e324
routing:           d87fe599698c80ff192b48db4813b7a3b270f1e4
targets:           a977f6ab0f2f1cbdc8ee6bdca08ebc86980e4350
telephony:      676188043d313cdfe2ced3299d2e0e10ffc383d3

If you need i can share my build.


Second:
I remember that the description in the table of Hardware was not working for me.
I have make a -sysupgrade.bin file.
With the OpenWrt-ImageBuilder:

make image PROFILE=VGV7510KW22NOR FILES=my-extra-root/ PACKAGES="dsl-vrx200-firmware-xdsl-a-patch dsl-vrx200-firmware-xdsl-b-patch kmod-fs-ext4 kmod-usb-storage asterisk18-app-stack asterisk18-chan-lantiq asterisk18-chan-local asterisk18-codec-alaw luci"

(The -sysupgrade.bin from buildprocess shoult work to but i forget the modem-firmware.)
You have to make a sysupgrade after ready installation.

sorry @Stefan L.
I thing i have wrong understands you.
Your Telephone have a beeb ?

try this in /etc/asterisk/modules.conf:

[modules]
load => res_agi.so
autoload=yes
; ... leafe the rest

it is from my memorys.
It was working in the past but in the moment i do not have asterisk configured.
For this reason it is not tested.

(Last edited by Plonk34 on 15 Jun 2016, 23:58)

Hi guys,
I have a similar problem as the OP.
For the last couple of evenings I've been playing with my Arcaydyan ARV752DPW22  (Easy Box 803A) and OpenWRT. So far after getting used to the system and Image Generator I managed to get most things working and I quite like it so far. The only thing that is missing is proper telephony support on the POTS / FXS ports.

I have now built an image with the following packages: "luci luci-app-ddns luci-app-pbx asterisk18-app-stack asterisk18-chan-lantiq asterisk18-chan-local asterisk18-codec-alaw"
However Asterisk does not accept the Lantiq channel. As soon as I start it up, it deletes the lantiq.conf and refuses all operation. Phone ports remain silent. No matter how I configure extensions or lantiq.conf, Asterisk does not want the channel.. Module show does not list lantiq.

I tried building the image from source as Stefan Koch suggested with his patches, but Asterisk 1.8 is now gone from OpenWRT and newer versions offer neither the lantiq channel nor the LuCI app. Also I tried building BB-based images to no success.. Also I played with Yate, but that does not offer any TAPI support at all..

Is there any way to get the phone ports up and running with reasonable efforts?

Thanks!

but Asterisk 1.8 is now gone from OpenWRT

I am interestested too what the future brings in relating to FXS support.

The only methode that i now is to use the old. Here is the fixed ./preparebuild.sh from stefan-koch:

#!/bin/bash

git clone git://git.openwrt.org/openwrt.git
cd openwrt
git remote add bb git://git.openwrt.org/14.07/openwrt.git
git fetch bb
git cherry-pick ea9e61b8eb61a2e362a50541f03466dc7d087947
git cherry-pick 47b1ff965b0cb57013b40fbe2bcd7f3c6eb6b606
git cherry-pick 8d924d43c0ea6839a3a33e54982e8da48b736001
git cherry-pick 064f467264c5c9b6eca0bb96b587f9412b770cc5
git am ../0000-md5.patch
git am ../0001-include.patch
git am ../0002-tapivmmcmake.patch
git am ../0003-o26431.patch
cp ../0152-lantiq-vmmc.patch target/linux/lantiq/patches-4.4/0152-lantiq-vmmc.patch

# use the latest telephony commit with Asterisk 1.8
cat ./feeds.conf.default | sed s,".*[[:blank:]]telephony[[:blank:]].*","&^676188043d313cdfe2ced3299d2e0e10ffc383d3",g > ./feeds.conf

./scripts/feeds update -a
./scripts/feeds install -a
cd feeds/telephony
git am ../../../0004-astmake-chan_lantiq.patch
git am ../../../0005-astmake-agi.patch
git am ../../../0006-chan-lantiq-caller.patch
git am ../../../0007-chan-lantiq-flash.patch
cd ../..
make defconfig
make prereq
make menuconfig

Wee should differ the problems by general working FXS support (having a beep after installation) or not.

(Last edited by Plonk34 on 18 Jun 2016, 10:23)

Thanks for the script! I was able to build OpenWRT with it, however it seems as either eglibc or the 4.4. kernel results in much bigger binaries. Even with -Os and only a minimal driverset I could not get a build with luci and asterisk that would fit in the tiny 8MB flash of the board. I have given up the Easybox and reflashed it to the original. Maybe I will try picking up a larger box (with ISDN support) somewhere and give that a try..

Updated #7

stefan-koch wrote:

1. Download the following archive and unzip.

Updated build script:
https://drive.google.com/file/d/0B9Z_Kp … sp=sharing

Step 3.2 is not needed. Using MUSL or glibc is possible.

Select packages:
asterisk13-app-stack
asterisk13-chan-lantiq
asterisk13-chan-sip
asterisk13-codec-a-mu
asterisk13-codec-alaw
asterisk13-codec-ulaw
asterisk13-res-rtp-asterisk

Step 5 is not needed. Patchfile is included in archive.

(Last edited by stefan-koch on 10 Jan 2017, 23:42)

This is really awesome.
I have been looking for an OpenWrt supported DSL modem where telephony actually works. This seems to be exactly what I was looking for.

stefan-koch wrote:

Updated #7
Updated build script:
https://drive.google.com/file/d/0B9Z_Kp … sp=sharing
Patchfile is included in archive.

May I ask you to upstream the asterisk patches and the glibc build fix?
Thanks!

Sorry, posts 26 to 25 are missing from our archive.