Lantiq - minimal POTS setup

@p4block
Hmm the device have 4MB Flash only.

First Problem:
see package/kernel/lantiq/ltq-vmmc/Makefile
Line 30:

DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xrx200) +kmod-ltq-tapi

the equal problem here package/kernel/lantiq/ltq-tapi/Makefile

possible next problem the kernel-config differ from xway and i have no idea if VPE SMP config are right here
see: https://forum.openwrt.org/viewtopic.php?pid=352661#p352661

Last problem the vmmc@107000 code are inside target/linux/lantiq/dts/ARV4518PWR01.dtsi
but at line 7 botargs should be like

bootargs = "console=ttyLTQ0,115200 mem=62M vpe1_load_addr=0x83e00000 vpe1_mem=2M maxvpes=1 maxtcs=1 nosmp";

@Ntalton nice work i will test it.
For me I like the asterisk solution more, but when i tell other people from it, the say: No thanks it is to complex.

I will try my luck with danube-voip on stable too, and see how that goes.
The ipks on git have been updated and hopefully fixed.
I think xway_legacy was created for devices with <= 4MB flash, which lede doesn't officialy support. If you really want to, here's a quick 'n dirty 'trick' to get xway_legacy devices to build as xway. On your build directory, move to the contents of your xway_legacy dts file to a similar xway one. For example copy target/linux/lantiq/ARV4518PWR01A.dts to target/linux/lantiq/ARV7518PW.dts and then select arv7518pw on menuconfig.
Be careful of the image size though! The 7518 has 8MB of flash so depending on what packages you select the resulting image might be too big for your device.

Also on danube-voip, just to clarify.
The repository has been umantained by the original author for 3 years. What I did was fork that repository and just patch it a little so it works with lede. Sadly due to lack of mostly time I won't be able to fix any security issues or add new features. So please use at your own risk :slightly_smiling_face:

Ok, I have updated danube-voip, packages and source. My testing indicates that it works both on stable 17.04.1 and current, and on current trunk.

@Plonk34 I cannot thank you enough for these hints, you saved me a lot of time which I cannot afford to lose at this moment. Those damned exams hah

@Ntalton I actually found the danube repo a few weeks ago and tried building, but failed miserably. When I saw that you forked it and fixed I basically was shouting YES repeatedly. Thanks again for the work.

On the size and legacy stuff, I run a "true initramfs" lede build in the 4MB flash with absolutely nothing but the kmods I need, ext4 and blockmount. Then it loads the true rw root in a 4GB usb flashdrive. This is essentially how desktop distros work, and it's a pain to setup on LEDE :sweat_smile:

Pretty cool and useful once it works though, it should be supported somehow. I should get around to writing a blogpost or something once I finish up with this this weekend or next week.

Documenting any helpful information in the OpenWrt wiki would be appreciated.

Popping back in to report my progress

I did the trick of copying the old xway-legacy dts to an xway device. This has allowed me to build the proper modules and install all of the packages up on @Ntalton github.

I've also managed to make the sip client connect to my ISP network.

However, for now I am unable to actually perform the calls, as they disconnect instantly when answering the call placed from outside the network, or never reach out. However, the phone itself rings, so that means the phone ports work hah.

Or do they? I get this on dmesg from time to time:
WARNING: FW version 12.1.0 too old. Minimum required FW version is 12.4.0

I've installed gstreamer + alaw to see if it's a codec issue. Sadly, I can try only so often as the ISP network temp bans me every few svd reconfiguration attempts, for trying too much.

The things you have do to get rid of the botnet isp router.

Thanks to all the people who helped me get this running!

Hi @p4block
first of all, I don't think the firmware warning is the culprit. I get the same warning, it's probably from tapi and as far as I know there is no newer firmware available on openwrt/lede. Svd works anyway.
If I understand correcly, when you are placing outgoing calls from the device running svd, the other end rings but when it picks up the call gets terminated?
Could you please post your configuration? Svd writes some usefull diagnostic stuff on systemlog, so keep an eye on that. You can also set the debug level higher on your config, so you get more information on system log.
And a last thing, the router running svd is behind nat, or does it get a public ip?

@Ntalton I could only manage to place a call from outside the network, which rang the fxs-connected phone. When picking it up, the call terminated. Calls couldn't get outside.

The router is behind another router's NAT, past attempts at this with android didn't require me to open any ports to the device. SVD can work differently I guess, mind sharing details on your setup?

I'm currently unable to register to my ISP network reliably because the registrar server is overloaded and taking ungodly amounts of time to respond to requests with 80% packet loss, and svd timeouts. I managed to do it once though (got lucky somehow) and could test the thing above.

Since you are behind nat, you could try adding the local_ip option on your config main, for example:

config main
option log_level '3'
option rtp_port_first '6000'
option rtp_port_last '6100'
option sip_tos '0x10'
option rtp_tos '0x10'
option local_ip '192.168.1.254'

Where 192.168.1.254, you replace with the static ip of your local wan interface. Sometimes sofia-sip can't get the network configuration correct, especially if you have many interfaces.
Other than that, I say check your configuration again, and look what kind of errors you get on syslog from svd.
My landline is still on PSTN so I use my devices with betamax sip providers like megavoip, hotvoip and such. Outgoing calls from them work fine, but I cannot test incoming calls since they don't provide a telephone number.

Hello,
since it was a slow week, I had time to add some patches for sofia-sip from freeswitch. Cannot properly test at the moment.
If you want to try, I have created a testing branch on git.
Thanks

I managed to make it work, adding the local ip did the trick. The registrar server finally responded in time for the client not to timeout.

Thanks a lot!

I will be trying the new patched build when I get the time again - making this thing work was very, very (months) overdue.

Hi, I just wanted to report that the binaries provided by Ntalton also work on an ARV7518PW router (as expected).

I just installed them in the right order, as some of them require the others, and some also required to download some kmods from LEDE repo.

Is it posible to configure a dial plan in a similar way as other ATA adapters?

Take a look at the instructions file, there is a config dialpan section to explain its function.
Also, a word on the luci application for svd. It is missing some configuration options when used with the default bootstrap theme on luci. For full functionality you can use the old openwrt theme.

Hi folks,

I'd like to hook up with this discussion and thank you for your informations so far. Can I use the binaries provided by Ntalton on Github with my router? I get the following error in the system log:

Sun Feb 25 20:12:11 2018 local5.info svd[1135]: starting
Sun Feb 25 20:12:11 2018 local5.info svd[1135]: main(): ERROR -  binary file /lib/firmware/danube_firmware.bin open failed!
Sun Feb 25 20:12:11 2018 local5.notice svd[1135]: terminated

I have the same intention as the thread opener: I'd like to use an Arcadyan VGV7510KW22 (o2 Box 6431) running LEDE 17.01.04 as a full replacement of a Fritzbox (7430), i.e. Router, WIFI Access Point, DSL Modem and telephony port (POTS/FXS). I managed to install LEDE 17.01.04 via LAN, replaced the shipped DSL firmware with a Fritzbox 7490 version featuring vectoring support. So far so great! However, I didn't succeed in using an analogue telephone on the POTS/FXS ports.

I installed the binaries sofia-sip, its luci-plugin, svd, and libab from Ntalton's github repo in the correct order. The kernel modules kmod-ltq-ifxos kmod-ltq-tapi and kmod-ltq-vmmc were already present in my system. Following Ntalton's recommendation I replace the bootstrap LuCi Theme with luci-theme-openwrt. I added my SIP account under VOIP>ACCOUNT and saved. No beep, no LED flashing: I find the following in my system log:

Sun Feb 25 20:12:11 2018 local5.info svd[1135]: starting
Sun Feb 25 20:12:11 2018 local5.info svd[1135]: main(): ERROR -  binary file /lib/firmware/danube_firmware.bin open failed!
Sun Feb 25 20:12:11 2018 local5.notice svd[1135]: terminated

and later:

Sun Feb 25 20:14:29 2018 daemon.err uhttpd[1026]: svd_if : Unable to generate temporary file /var/svd/svd_if.XXXXXX (No such file or directory)
Sun Feb 25 20:14:29 2018 daemon.err uhttpd[1026]: 
Sun Feb 25 20:14:29 2018 daemon.err uhttpd[1026]: svd_if : Unable to generate temporary file /var/svd/svd_if.XXXXXX (No such file or directory)
Sun Feb 25 20:14:29 2018 daemon.err uhttpd[1026]: 

Actually, I don't have "danube_firmware.bin" im my /lib/firmware/ dir. I have

root@LEDE:/lib/firmware# ls
ifx_bbd_fxs.bin
ifx_firmware.bin
lantiq-vrx200-a-to-b.bspatch
lantiq-vrx200-a.bin
rt2860.bin
rt3290.bin
voice_ar9_firmware.bin
vr9_bbd.bin
vr9_bbd_fxs.bin
xcpe_581816_580B11.LICENSE
xcpe_581816_580B11.bin
xcpe_581816_580B11_to_579906_574402.bspatch

Where Do I get "danube_firmware.bin"? Or is it wrong to use the binaries from Ntalton for my device, since it was intended for another target? Do I have to compile the packages myself for my target?

Any hints are highly appreciated.

Best
So Di

Hello!
I am afraid danube-voip was really designed for devices with different (older) soc's than the one found in the VGV7510KW22, so I am afraid it probably won't work.
One thing you could try maybe, would be to do

ln -s /lib/firmware/voice_ar9_firmware.bin /lib/firmware/danube_firmware.bin

And then start svd with -d9, to see what fails.

Hi Ntalton,

Thank you for your immediate reply. Sad to hear, that your repo and sofia-sip are exclusively designed for the danube target. However:

root@LEDE:~# ln -s /lib/firmware/voice_ar9_firmware.bin /lib/firmware/danube_fir
mware.bin
root@LEDE:~# svd -d9
root@LEDE:~# main(): ERROR - Voice Coefficients Download failed!

The log upon reboot states the same:

Sun Feb 25 20:12:11 2018 local5.info svd[1133]: starting
Sun Feb 25 20:12:13 2018 local5.info svd[1133]: main(): ERROR - Voice Coefficients Download failed!
Sun Feb 25 20:12:13 2018 local5.notice svd[1133]: terminated

It's libab that's not working with ar9 targets. Maybe it could be patched to work with them, but considering that
a) Sofia-sip is basically abandoned and umantained
b) Svd has some bugs and missing features (e.g. ssl)
I think any efforts should be more concentrated on staring a new project with the same philosophy, from scratch, using a new library like pjsip and working with (hopefully) all lantiq targets with analog telephony capabilities. That's my goal going forward.
For now you should look into asterisk and chan_lantiq.

2 Likes

Hi Ntalton,

Thank you for your effort. I went down the asterisk road with chan_lantiq and everything's working fine now.

Best

So Di

Make that 6 now :wink:
It works for me and I didn't get any pull request, that's why I didn't maintain it.