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.

Hi Plonk34,
did i understand right ( in my example all downloads in ~/Downloads, and all extract too )
to build a 17.01.rc2 Image with your Patch include.

0. wget https://github.com/lede-project/source/ … 7.01.0-rc2
    tar xvfz v17.01.0-rc2.tar.gz

1. Download your Patch, https://yadi.sk/d/ghKC4tnP3EEH7V

2. tar xvfJ asteriskupd-v3.tar.xz

3. cd source-17.01.0-rc2
    CWD=~/Downloads
    echo "src-link asteriskupd ${CWD}/asteriskupd-v3" >> ./feeds.conf
    ./scripts/feeds update -a
    ./scripts/feeds install -p asteriskupd -a
    ./scripts/feeds install -a
    make defconfig
    make prereq
    make menuconfig

but did not find the, chan-lantiq in Network -> Telephony -> asterisk13


and asterisk is 13.9.1 and not 13.14.x

(Last edited by ds2k5 on 20 Feb 2017, 11:24)

There was a new commit, that introduces SMP for xrx200 at 2017-02-01:
https://github.com/lede-project/source/ … f54ce9f99a

This commit conflicts with usage of the VMMC driver.

At least CONFIG_MIPS_MT_SMP needs to be disabled in xrx200/config-default and nosmp added to the kernel command line OR without command line the full SMP part must be disabled

The commit above introduces CONFIG_MIPS_MT_SMP but adds nosmp to the kernel command line.

So if you want to use FXS with a LEDE version about 2017-02-01 before a bugfix is released, you need to manually disable CONFIG_MIPS_MT_SMP within kernel default configuration before running the make command.

You will find a test configuration for Sipgate here:
https://drive.google.com/file/d/0B9Z_Kp … FItcXB4S1E

The sample configuration is within asterisk directory.

Please replace:
SIPGATE_SIPID with your SIP-ID from sipgate
SIPGATE_SIPPASSWD with your SIP password from sipgate
SIPGATE_TELNUMBER with your telephone number from sipgate (style like 0987654321)
ASTERISK_SIP3PASSWD with a new password for local SIP client 3
ASTERISK_SIP4PASSWD with a new password for local SIP client 4

Optional:
There is a directory asterisk-def with the default asterisk configuration, too.
You could do the following, too:

cd asterisk-def
patch -p1 < ../asterisk.patch

Then asterisk-def dir must have the same contents as asterisk dir.

(Last edited by stefan-koch on 22 Feb 2017, 16:53)

Plonk34 wrote:

@ stefan-koch
Is it a bug or is it wanted, because the second cpucore make the VPE ?
Stands VPE for Voice Processing Engine ?
And what is the meaning, is this a Hardware Enginge ?

A firmware file will loaded on that second core. So SMP and VPE usage is conflicting.
Therefore you have to reserve 2MB of RAM memory within kernel command line.

The devices before xrx200 had an other mechanism, there you have not to reserve 2MB of RAM memory to load the firmware.

@ds2k5
you have forget:

cat ./feeds.conf.default | sed s/";HEAD"/"^v17.01.0-rc2"/g > ./feeds.conf

but it is not the reason.

I can swear that this was working in future.
But not now, try this instead:

./scripts/feeds update -a
./scripts/feeds install -a -p asteriskupd
./scripts/feeds install -a

I can not comprehend that.

I put 3 self explanitory build scripts inside asteriskupd-v3a (md5=120176f5d45f5c90c411841719accad8)
I have not realy tested, but I test it up to start building and it works.

stefan-koch wrote:

There was a new commit, that introduces SMP for xrx200 at 2017-02-01:
https://github.com/lede-project/source/ … f54ce9f99a

This commit conflicts with usage of the VMMC driver.

At least CONFIG_MIPS_MT_SMP needs to be disabled in xrx200/config-default and nosmp added to the kernel command line OR without command line the full SMP part must be disabled

The commit above introduces CONFIG_MIPS_MT_SMP but adds nosmp to the kernel command line.

So if you want to use FXS with a LEDE version about 2017-02-01 before a bugfix is released, you need to manually disable CONFIG_MIPS_MT_SMP within kernel default configuration before running the make command.


I have created a LEDE pull request with a patch that solves the issue.
If CONFIG_MIPS_MT_SMP/CONFIG_SMP is enabled and nosmp is set as kernel command line parameter FXS will work now.
See:
https://github.com/lede-project/source/pull/899

For VGV7510KW22 and VGV7519 routers you could build LEDE without patching, yet.

git clone git://git.lede-project.org/source.git
cd source
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
make prereq
make menuconfig

asterisk13-chan-lantiq is included within the telephony feed, too.

There a prebuilt images that are able to use FXS, too.
https://downloads.lede-project.org/snap … iq/xrx200/

You need to install all needed packages via opkg.

Thanks but it is a old version actuell is 13.14.0 and 11.25.1 (some patches must be delete for working)
I have do it inside asteriskupd-v3a(md5=120176f5d45f5c90c411841719accad8)
other changes:
- I add a new call inside the Makefile for building res-stun-monitor.
- I put all modules that actuell not be used in a rest-modules and do it for the configs too (rest-configs).
- I delete some patches because they are not need on a newer Asterisk version.

tim305 wrote:

I've tested both mentioned methods (build full image / build package only) with different linux systems (debian, ubuntu, centos) and always get the same error while compiling:

checking for xml2-config... /home/centos/o26431-vmmc_v3/source/staging_dir/target-mips_24kc_musl-1.1.16/host/bin/xml2-config
configure: error: Could not find required 'Libxml2' development package

The mentioned packages "libxml2" and "libxml2-dev" are already installed. Do you have any idea how to solve it?

Look here:
github.com/openwrt/telephony/issues/133 … -276973286

stefan-koch wrote:

For VGV7510KW22 and VGV7519 routers you could build LEDE without patching, yet.
[...]
asterisk13-chan-lantiq is included within the telephony feed, too.

There a prebuilt images that are able to use FXS, too.
https://downloads.lede-project.org/snap … iq/xrx200/

You need to install all needed packages via opkg.

Unfortunately the asterisk13-chan-lantiq package is not part of the official feeds.

git clone https://git.lede-project.org/source.git
cd ./source
git checkout lede-17.01

cat ./feeds.conf.default > ./feeds.conf
sed -i -e "s/git.lede.project.org\/feed/github.com\/openwrt/g" feeds.conf

./scripts/feeds update -a
./scripts/feeds install -a

make defconfig
make prereq
make menuconfig

make

Just build from lede-17.01 head and official OpenWRT telephony feed.

(Last edited by tim305 on 11 Aug 2017, 20:55)

Hi on LEDE i missed the chan-lantiq and some Asterisk-13.x packages will build, but not packed.
For this reason i build my own Asterisk-13.17.1 packages with the LEDE-17.01.2 SDK inclusive chan_lantiq, chan_mobile, channel_dongle and all rest modules packages.
(chan_mobile was never tested)

all my own build packages and the Makefiles inside:
asterisk_privatpkg-lede17.01.2.tar.xz
sha256: 1618c1bcc3c2a5d75e98a6d094c245edb257c9e3136f1edaeb32e4374f1813d4

Plonk34 wrote:

provisional and untested
asterisk-13.18.0-rc1 + chan-lantiq
against LEDE-SDK-17.01.4
privatpkg-lede17.01.4-asterisk-13.18.0-rc1.tar.gz
sha256: 90f1ed9373d8e9d09e62979d446cc3faa62f2359e5a0f831a44fb3fc11773cc0


I tried your package but get the following error when trying to install asterisk13

Configuring kmod-lib-lzo.
failed to find a module named lzo_compress
failed to find a module named lzo_decompress
* satisfy_dependencies_for: Cannot satisfy the following dependencies for asterisk13:
*      bluez *
* opkg_install_cmd: Cannot install package asterisk13.

* satisfy_dependencies_for: Cannot satisfy the following dependencies for asterisk13:
*      bluez *

This normal or better it is unlikly but not sad, it should work.
The reason for building chan-mobile-module, the whole asterisk need the depends for building.
But only inside the chan-mobile module are the depends "bleuz" added.

Configuring kmod-lib-lzo.
failed to find a module named lzo_compress
failed to find a module named lzo_decompress

This is sad, because the reason is that the kmod-lib-lzo package do not contain the kernel modules.
It is a LEDE bug and i can not do anything.
I reported here: https://bugs.lede-project.org/index.php … ;sort=desc

Sorry

Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for asterisk13:
*      bluez *

is evil too and i will solve next time.
For now try

opkg install --force-depends asterisk13

and post the complet result

Did that get now the following error after installing chan lantiq. (Want to use anolog phone on my modem 2812-F1)
[Oct 22 17:49:36] WARNING[1235] res_crypto.c: Unable to open key directory '/usr/share/asterisk/keys'
[Oct 22 17:49:36] ERROR[1235] chan_lantiq.c: FIO_FW_DOWNLOAD ioctl failed
[Oct 22 17:49:36] ERROR[1235] chan_lantiq.c: voice firmware download failed

(Last edited by JEFFreal on 23 Oct 2017, 00:10)

OK the problem with kmod-lib-lzo is not relevant and i will ask for closing the bug, because there a more than 380 opened bugs and i thing the
reason for failure message are that the modules are compiled inside the Kernel.
I can not comprehend on my Arcadyan  VGV7510KW22 too.
The real problem was DEPENS=: ... +bleuz
Workaraund for the moment: opkg install --force-depends asterisk13

OK next problem:
I fear VMMC support (required for the 2 FXS ports) is not enable on ZyXEL P-2812HNU-F1 (right ?)
which version of LEDE/Openwrt do you have ?
What will happen when you put

cat /proc/cpuinfo

Have you one or two CPUs ?
When a wrong Firmware result in a bootloop how simple is it for you too replace them by a working Firmware, by using serial connection .. etc ?

The explanation is:
For loading and running the vmmc firmware (vmmc = is the required Voice Process for the FXS ports),
it is necessary to give them a littlebit RAM and one VPE (Virtual Processing Elements) from two.
The result is you have a littlebit slower device because SMP support are not possible.
But it is a change in the target/linux/lantiq/dts/P2601HNFX.dts and it required a new builded kernel / firmware

I dont know about vmmc. It's installed with tapi but i dont know if its supported. I run currently the 17.01.4 LEDE.
This is what i get with cat /proc/cpuinfo

system type             : xRX200 rev 1.1
machine                 : P2812HNUF1 - ZyXEL P-2812HNU-F1
processor               : 0
cpu model               : MIPS 34Kc V5.5
BogoMIPS                : 332.54
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 16
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available

I'm used to work with serial so that will be no problem. I hope you can help me out and im able to finally use fxs on this box.

Hmm OK you have only a single CPU this points the VMMC feature are should enable
In the other hand there is no code that enable VMMC.
I have no idea what the goods here do, normally you should have SMP support or VMMC support.

[Oct 22 17:49:36] ERROR[1235] chan_lantiq.c: FIO_FW_DOWNLOAD ioctl failed

This can be a result by missed rights too
Try first: be shure that asterisk running as root and create all directoriys where you get a warning or error
Be shure that asterisk have full access to the Firmwares and to /dev/vmmc[N]

But i fear it will not work i can not see any code for vmmc inside dts files.
You can equal devices where it the support are enable
for VGV75KW22: https://git.lede-project.org/?p=source. … 41ae381a3f
and Easybox 904x : https://github.com/Quallenauge/Easybox- … 3-E-IR.dts
The problem i must guess the Adresses and GPIO did you know how are the original source are ?

You must build your own image try this script: https://yadi.sk/d/DJnsBxcd3P4omX
But i have only guess the GPIOs and the chance a small that this work !
Better you do a look inside the original source and correct the gpio numbers.

Hello,
I want to step in -- got a TP-Link VR200v.
Testing current openwrt-master... Since all the required packages are selectable in menuconfig I assume that no more patches are required, is that correct?
Report back later... ;-)

(Last edited by Aeronaut84 on 3 Nov 2017, 10:04)

OKy, it doesn't work and I switched over to LEDE... I used Asterisk-13.18.0 + chan-lantiq, thanks for sharing...
I also see that VR200v.dts have no records for VMMC, are they needed?

root@LEDE:~# lsmod | grep vmmc
drv_ifxos              12480  4 drv_vmmc,drv_dsl_cpe_api,drv_mei_cpe,drv_tapi
drv_tapi              139744  1 drv_vmmc
drv_vmmc              138816  0
root@LEDE:~# ls /dev/vmmc*
/dev/vmmc10  /dev/vmmc12  /dev/vmmc14  /dev/vmmc16  /dev/vmmc18
/dev/vmmc11  /dev/vmmc13  /dev/vmmc15  /dev/vmmc17
root@LEDE:~# asterisk -f
[Nov  3 12:03:23] NOTICE[18669]: cdr.c:4189 cdr_toggle_runtime_options: CDR simple logging enabled.
[Nov  3 12:03:23] NOTICE[18669]: loader.c:1373 load_modules: 12 modules will be loaded.
[Nov  3 12:03:23] WARNING[18669]: res_musiconhold.c:1984 load_module: No music on hold classes configured, disabling music on hold.
[Nov  3 12:03:23] ERROR[18669]: chan_lantiq.c:607 lantiq_dev_firmware_download: FIO_FW_DOWNLOAD ioctl failed
[Nov  3 12:03:23] ERROR[18669]: chan_lantiq.c:2092 load_module: voice firmware download failed
Segmentation fault
root@LEDE:~# ls -l /lib/firmware/
lrwxrwxrwx    1 root     root            29 Nov  3 10:41 ifx_bbd_fxs.bin -> /lib/firmware/vr9_bbd_fxs.bin
lrwxrwxrwx    1 root     root            36 Nov  3 10:41 ifx_firmware.bin -> /lib/firmware/voice_ar9_firmware.bin
lrwxrwxrwx    1 root     root            43 Oct 17 17:46 lantiq-vrx200-a-to-b.bspatch -> xcpe_581816_580B11_to_579906_574402.bspatch
lrwxrwxrwx    1 root     root            22 Oct 17 17:46 lantiq-vrx200-a.bin -> xcpe_581816_580B11.bin
-rw-r--r--    1 root     root        533152 Oct 18 08:54 voice_ar9_firmware.bin
-rw-r--r--    1 root     root           300 Oct 18 08:54 vr9_bbd.bin
-rw-r--r--    1 root     root           388 Oct 18 08:54 vr9_bbd_fxs.bin
-rw-r--r--    1 root     root          1920 Oct 17 17:46 xcpe_581816_580B11.LICENSE
-rw-r--r--    1 root     root        898952 Oct 17 17:46 xcpe_581816_580B11.bin
-rw-r--r--    1 root     root        253635 Oct 17 17:46 xcpe_581816_580B11_to_579906_574402.bspatch

I edited /etc/asterisk/lantiq.conf:

[interfaces]
firmwarefilename = /lib/firmware/ifx_firmware.bin
bbdfilename = /lib/firmware/ifx_bbd_fxs.bin

And tried several other firmware binarys... Makes no difference...

I have Serial Console, so I'm ready for Experimenting... Just don't know where to start... Any help would be nice.

(Last edited by Aeronaut84 on 3 Nov 2017, 14:19)

I added to VR200v.dts:

    sram@1F000000 {
        vmmc@107000 {
            status = "okay";
        };
    };

Got another interesting output:

root@LEDE:~# dmesg
[  408.746826] IFX_MPS: CPU1 base address is invalid!
[  408.750295] IFX_MPS: firmware download error (-1)!

I don't really know what I'm doing there exactly with the dts... Can anyone tell me how to create a proper device tree, if relevant?

(Last edited by Aeronaut84 on 3 Nov 2017, 21:27)