OpenWrt Forum Archive

Topic: chan_lantiq and FXS support

The content of this topic has been archived on 29 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I use FXS ports on Arcadyan/Astoria vgv7510kw22 (O2-Box 6431) with OpenWRT, for a few months.
It work fine,
but without WLAN
and it needs the old asterisk Version 1.8 and glibc.
see this thread

Now i need a cheap OpenWRT router with FXS and WLAN.
I try the Arcadyan/Astoria ARV752DPW22 (EasyBox 803A) router with dd + glibc + asterisk 1.8 patched like the O2-Box 6431.
(the Firmware and Kernel Stuff for FXS should be inside by default for Lantiq Xway Danube. Is this correct ? )
But it will fail it always reboot:

[   31.965554] random: nonblocking pool is initialized
[   35.598276] do_page_fault(): sending SIGSEGV to validate_data for invalid read access from 0000010c
[   35.605777] epc = 778ea74c in ld-2.22.so[778e1000+20000]
[   35.610923] ra  = 778eacbc in ld-2.22.so[778e1000+20000]
[   35.615969] 
[   40.612844] device eth0.1 entered promiscuous mode
[   40.616216] device eth0 entered promiscuous mode
[   40.651846] br-lan: port 1(eth0.1) entered forwarding state
[   40.656045] br-lan: port 1(eth0.1) entered forwarding state
[   42.657512] br-lan: port 1(eth0.1) entered forwarding state
[   43.058887] IPv6: ADDRCONF(NETDEV_UP): nas0: link is not ready
[   53.108025] Kernel panic - not syncing: no cp1 base was set
[   53.108025] 
[   53.117171] Rebooting in 3 seconds..


I have some General Questions:

1.) Does OpenWRT + FXS only works on Lantiq Chipsets ?
because the chan_lantiq.c is the only extra code for channels that i can find in asterisk.

2.) Does the chan_lantiq.so only work on Lantiq XWAY SLIC120 (PEF 42068 V V1.2) chipsets
Or does it work only for the Lantiq XWAY SLIC120 (PEF 42068 V V1.2) chipset or is this depending on the mainchipset like XWAY VRX208 or Lantiq Xway Danube.



I think it is very usefull to have a chan_lantiq for Asterisk-13 because it is not EOL and it supports musl.

i have do a first try:
001_put_chan-lantiq_code_from_asterisk1.8_to_asterisk13.patch
002_changes_in_Makefile_for_chan-lantiq.patch
003_porting_chan-lantiq_from_asterisk1.8_to_asterisk13.patch

But note i can compile and i have a beep, but i think it will not work yet,
because i have delete some lines that make errors without replacement.
I have no idea from programming asterisk channels or lantiq.
I have only check the error messages on my compiler and replace it by code that looks logik.
(by looking inside the channel.h of asterisk-13)

I have compile and get this ERROR like:

[Nov  6 21:49:57] WARNING[9403]: loader.c:556 load_dynamic_module: Error loading module 'chan_lantiq.so': Error relocating /usr/lib/asterisk/modules/chan_lantiq.so: ast_getformatname_multiple: symbol not found

I look inside the asterisk-13 code and can not find ast_getformatname_multiple.

3.) why i can compile the chan_lantiq when i can not find any code with this string "ast_getformatname_multiple"

4.) on the asterisk-1.8 i need (or better i have (because never teste if i really need them)) a chan_local. Where is it ?

5.) in the next days i will replace the "only deleted lines" and do some tests, but it is more a guessing game,
and i think i need help.
Can everbody help me ?

answer to 4.
the chan_local will be here explain:
http://www.voip-info.org/wiki/view/Aste … l+channels
(i have not understood)
But it is irrelevant because chan_local are inside the core since asterisk-12
see https://wiki.asterisk.org/wiki/display/ … al+Channel



My Problem is
line 194 chan_lantiq.c:

struct ast_sched_thread *sched_thread;

and in function load_module() ca line 1482

if (!(sched_thread = ast_sched_thread_create())) {
    ast_log(LOG_ERROR, "Unable to create scheduler thread\n");
    return AST_MODULE_LOAD_FAILURE;
}

A struct ast_sched_thread will not defined in shed.h from asterisk-13.

And a can not find a replacemend for this function: ast_sched_thread_create()
inside the shed.h from asterisk-13

The following link includes a working version for asterisk11 based on an older (patchAst11.zip) revision and a newer (patchAst11_new.zip) revision. It needs an included ugly AST_FORMAT_INC patch:
https://drive.google.com/drive/folders/ … nFXaVpXdEk

Try the newer Ast11_new version, it should work. Ast13 does not work.
Current LEDE sources contains everything (FXS and box specific settings) except asterisk patches.

Thanks stefan-koch, you are my hero on Openwrt/LEDE

WLAN problem is solved in LEDE:

I was hopping for it. I read this: https://bugzilla.kernel.org/show_bug.cgi?id=110091
Thanks for your efforts.

I have look inside https://github.com/openwrt-vgv7519.
There are is a try too for chan-lantiq.

At the moment i recompile lede (It takes ca. 6h) with your patches.
But one questions I have now:
Work the channel lantiq on,
1.) Lantiq chipset in general (xrx200 + xway) ?
2.) only for xrx200 chipset ?
3.) or only on the FXS-Chip: Lantiq XWAY SLIC120 (PEF 42068 V V1.2) ?

The required Kernelmodules are:
drv_ifxos, drv_tapi, drv_vmmc
and the device are /dev/vmmc10 to /dev/vmmc18,
right ?

It seems it working in general,
But when i pick up the phone, i get a double beep:
[short beeb] [short pause] [long beep] [long pause] ... again
instead of a freetone: [permanent beep].

And i get this ERROR Message when i  make a call:
ERROR[2984][C-00000002]: chan_lantiq.c:309 lantiq_play_tone: IFX_TAPI_TONE_LOCAL_PLAY ioctl failed
But i get a "IFX_TAPI_TONE_LOCAL_PLAY ioctl failed" Message too at asterisk-1.8.
It seems that have no effect, but what are the meaning ?

The chan_lantiq supports xrx200 as well danube based boards (like easybox 803)
You need tapi and vmmc driver, see https://github.com/lede-project/source/pull/524

The new beep tone comes from the newer version of chan_lantiq. The main developers have changed something at tone generation. The warning is already a long time within chan_lantiq. Perhaps it will be fixed in the future.

All thinks work fine with a current LEDE snapshot + my own compiled Asterisk-11.
I hope a chan-lantiq for Asterisk-13 comes in the future, but in this moment i am very lucky.
It looks like stable.

When i hear the dialtone first time,
i was thinking somthing is wrong,
but it looks like the dialton in Germany from before 1979.
It is a Morse A for "Amt" ( = Office)
see:
https://de.wikipedia.org/wiki/H%C3%B6rt … schland.29

Great thanks to all the Developer where have made this possible.

Here my Asterisk 11.25.1 package with chan-lantiq: myasterisk.tar.xz

- I removed the 051-musl-includes.patch
- I add some Asterisk modules in Makefile
- I put all unused Asterisk modules in a rest-modules package
- I put all unused Asterisk configs in a rest-configs package

The Easybox-803a does not work with the newest LEDE version.
I get a bootloop:

.......
[    5.629950] uhci_hcd: USB Universal Host Controller Interface driver
[    5.635051] uhci_hcd 0000:00:0f.0: UHCI Host Controller
[    5.639976] uhci_hcd 0000:00:0f.0: new USB bus registered, assigned bus number 2
[    5.647141] uhci_hcd 0000:00:0f.0: irq 135, io base 0x1ae00000
[    5.655944] hub 2-0:1.0: USB hub found
[    5.659040] hub 2-0:1.0: 2 ports detected
[    5.663309] uhci_hcd 0000:00:0f.1: UHCI Host Controller
[    5.667359] uhci_hcd 0000:00:0f.1: new USB bus registered, assigned bus number 3
[    5.674513] uhci_hcd 0000:00:0f.1: irq 135, io base 0x1ae00020
[    5.682600] hub 3-0:1.0: USB hub found
[    5.685736] hub 3-0:1.0: 2 ports detected
[    5.697650] dwc2 1e101000.ifxhcd: requested GPIO 464
[    8.076380] dwc2 1e101000.ifxhcd: dwc2_core_reset() HANG! Soft Reset GRSTCTL=80000001
[    8.082695] dwc2 1e101000.ifxhcd: dwc2_core_init(): Reset failed, aborting
[    8.089377] dwc2 1e101000.ifxhcd: dwc2_hcd_init() FAILED, returning -16
[    8.095821] dwc2: probe of 1e101000.ifxhcd failed with error -16
[    8.112700] init: - preinit -
[    8.560365] Kernel bug detected[#1]:
[    8.562443] CPU: 0 PID: 370 Comm: sh Not tainted 4.4.39 #0
[    8.567758] task: 83945900 ti: 830f8000 task.ti: 830f8000
[    8.572987] $ 0   : 00000000 0000002e 00000001 83945900
[    8.578054] $ 4   : 8310f880 00000100 00000001 8108a5a8
[    8.583123] $ 8   : 000003b4 830bdd20 000003b5 00000000
[    8.588193] $12   : 00000000 f9ec9a00 00000000 00000000
[    8.593261] $16   : 830bd8c0 8005d800 00000080 00000009
[    8.598330] $20   : 00000024 00000100 80623bd0 804cb460
[    8.603399] $24   : 00000000 801da45c                  
[    8.608468] $28   : 830f8000 830f9e80 0000000a 800c5bf4
[    8.613537] Hi    : 000a003a
[    8.616325] Lo    : 005001d0
[    8.619159] epc   : 80045714 __put_cred+0x1c/0x40
[    8.623694] ra    : 800c5bf4 file_free_rcu+0x7c/0x98
[    8.628491] Status: 1100fc03    KERNEL EXL IE 
[    8.632548] Cause : 10800034 (ExcCode 0d)
[    8.636434] PrId  : 00019641 (MIPS 24KEc)
[    8.640316] Modules linked in: dwc2 uhci_hcd ehci_pci ehci_platform ehci_hcd gpio_button_hotplug
[    8.648862] Process sh (pid: 370, threadinfo=830f8000, task=83945900, tls=77167e50)
[    8.656283] Stack : 80448024 804d0000 804d0000 830bd8c0 00000000 8005d800 00000000 804d0000
      00000121 00000000 80623bd4 80623bf4 00000008 8005d83c 00000004 00000100
      80623bd0 804cb460 0000000a 8002d7dc 00000000 8005a1bc 00000000 00000000
      830bdc80 008fdf20 80620000 8044aa98 80440000 fffee352 804d0000 00400000
      00000000 008f8660 00000002 004077ad 7715d000 7715d000 7715f500 77160e94
      ...
[    8.690751] Call Trace:
[    8.693135] [<80045714>] __put_cred+0x1c/0x40
[    8.697362] [<800c5bf4>] file_free_rcu+0x7c/0x98
[    8.701841] [<8005d800>] __rcu_process_callbacks+0xc8/0xf0
[    8.707144] 
[    8.708576] 
Code: 8c62027c  00821026  2c420001 <00020336> 8c620278  00821026  2c420001  00020336  3c058004 
[    8.718309] ---[ end trace a5a2c2b79ea750b7 ]---
[    8.725811] Kernel panic - not syncing: Fatal exception in interrupt
[    8.732571] Rebooting in 1 seconds..
ROM VER: 1.0.3
CFG 01
Read EEPROMX
 X

After installation it works fine,
I do a soft reboot, it works fine again.
I switch off and on, i get this Bootloop.
I reboot it again and again but i get allway this bootloop.

It works on a older OpenWRT Version 15.05.1 but i have not test telephony yet

Bootloop:
Have you tried any different LEDE versions, too?

(Last edited by stefan-koch on 4 Jan 2017, 18:35)

chan_lantiq
I have finished the porting from asterisk 1.8 to asterisk 11 and asterisk 13.

GIT-Repository:
https://github.com/kochstefan/asterisk_ … lantiq.git

See branches:
asterisk-1_8 (asterisk 1.8 needs glibc)
asterisk-11 (asterisk 11 needs musl)
asterisk-13 (asterisk 13 needs musl or glibc)

Master's latest commit is compatible with asterisk 13.

To apply it to the telephony feed, try the patches within the following archive:
https://drive.google.com/file/d/0B9Z_Kp … FV6dEpCbUE

I have successfully tested the chan_lantiq for asterisk 1.8, 11 and 13.

Plonk34 wrote:

And i get this ERROR Message when i  make a call:
ERROR[2984][C-00000002]: chan_lantiq.c:309 lantiq_play_tone: IFX_TAPI_TONE_LOCAL_PLAY ioctl failed
But i get a "IFX_TAPI_TONE_LOCAL_PLAY ioctl failed" Message too at asterisk-1.8.
It seems that have no effect, but what are the meaning ?

This error occurs if a tone change command is applied multiple times.

I have solved this here:
https://github.com/kochstefan/asterisk_ … 80669feca3

Great, big thanks

I will update in the next days.

The interdigit config is a great feature for me, because the 2000ms was very short for a pulsedialing phone.
But i found that values greater ~5000ms have no effect,
i was try with 10000ms in asterisk-11 but after ~5sec asterisk start working.

Bootloop:
Have you tried any different LEDE versions, too?

From a month ago and some days ago.

I solved the problem for me, in which i do without the second USB-Port behind the cover.
I make me own image with:

make image PROFILE=ARV752DPW22 PACKAGES="asterisk11 asterisk11-app-stack asterisk11-chan-lantiq asterisk11-codec-alaw asterisk11-codec-gsm asterisk11-format-gsm kmod-usb-storage kmod-fs-ext4 -ltq-adsl-app -kmod-usb-dwc2"

ltq-adsl-app does not exist
and
kmod-usb-dwc2 is responsible for reboot

now it works.

The next Challenge for me is to get the ISDN working.

I have found a (German) discusion about this problem.
It is from 2012/13 and no longer applicable.
https://lab.ks.uni-freiburg.de/issues/515
But it does not look hopeful

Exist any OpenWRT/LEDE Router where ISDN are working ?

13.13.1 works fine too

I a have update asterisk 13 to version 13.13.1
(version 11.25.1 are inside too

https://yadi.sk/d/clbIuF4Y39HGQf

- The Makefile of asterisk-13.x will download the commit: c0fb96d77db1ebd63565953056e3c74a52446cdc
form here: https://github.com/kochstefan/asterisk_ … lantiq.git
- I add some new calls for building asterisk-modules iside the Makefile.
- I put all modules that actuell not be used in a rest-modules and do it for the configs too (rest-configs).
- I remove the following patches: 040-fix-config-options.patch / 051-musl-includes.patch

It can be add to the feeds of SDK:

cp ./feeds.conf.default ./feeds.conf
echo "src-link asteriskupd /path-to-this-feed/asteriskupd" >> ./feeds.conf

and it can be build via:

make V=s package/asterisk-13.x/download
make V=s package/asterisk-13.x/clean
make V=s package/asterisk-13.x/prepare
make V=s package/asterisk-13.x/compile

The O2-Box 6431 is very wonderful.
It works fine with old pulsedialing rotaryphones.
Other Routers can not do this or have strictly timings or wrong timings.

I have have question too which codec will be used by the O2-box 6431.
It seems that the chan_lantiq work with a lot of codecs. Is this correct ?
But which codec will be used by the Hardware ?

My itention is to reduce the CPU load and latency by adding the right codec inside my sip config like:

[teleblah]
type=peer
host=teleblah.nix
port=5060
fromdomain=teleblah.nix
insecure=port,invite

dtmfmode=rfc2833
disallow=all
allow=CODEC_THAT_WILL_USED_BY_HARDWARE

defaultuser=user
fromuser=user
secret=password
callerid=externe_nummer

Is it ulaw ?

All codecs that are supported by chan_lantiq are also supported by the hardware.

@stefan-koch: Asterisk 15 Feature Freeze will happen in July 2017. Could you please try to get your patch ported to Asterisk 15 and upstreamed until then? That would be awesome. Thanks!

(Last edited by fischle on 17 Feb 2017, 21:34)

Hi,
i have 2 question, please help me to slove those.
1.In LEDE ,asterisk 11/13 i can't able to install luci-app-pbx ??
2.how to add asterisk 1.8 to LEDE presently i have only asterisk 11 and 13..but i want asterisk1.8 ,how to add it?

1.) No luci-app-pbx is flagged as Broken and it require asterisk-1.8
(but i have no idea what happen when changing to 13)

2.) Asterisk-1.8 was inside the telefony-feed in the past (last year), but 1.8 is EOL and get no Security fixes now.
Asterisk-11 is EOL in few days see:
https://wiki.asterisk.org/wiki/display/ … k+Versions

You should use Asterisk-13.x. For configuration use the /etc/asterisk config files.
For simple VoIP you can use this and or linked descriptions:
https://forum.lede-project.org/t/lede-1 … -6431/1524

The discussion might have continued from here.