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.

you must add some bootargs like:

bootargs = "console=ttyLTQ0,115200 mem=116M phym=128M vpe1_load_addr=0x87e00000 vpe1_mem=2M maxvpes=1 maxtcs=1 nosmp";

one VPE of two will reserved for the VMMC firmware, and 2MB RAM
The result is no SMP are working

@JEFFreal @Aeronaut84
you can use my scripts, but read the description.txt first
add-VMMC.tar.gz

Thanks for that, I will have a look on it Monday. Is there a way to test function of the GPIO's?

OFFTOPIC: Do I understand right, that in TP Link FW WLAN firmware gets loaded by kernel module mtlk.ko?
Some of you are near Stuttgart?

(Last edited by Aeronaut84 on 4 Nov 2017, 08:25)

Plonk34 wrote:

you must add some bootargs like:

bootargs = "console=ttyLTQ0,115200 mem=116M phym=128M vpe1_load_addr=0x87e00000 vpe1_mem=2M maxvpes=1 maxtcs=1 nosmp";

one VPE of two will reserved for the VMMC firmware, and 2MB RAM
The result is no SMP are working

So its ok if just one of the two CPU cores come up, right?
$ cat /proc/cpuinfo

system type             : xRX200 rev 1.2
machine                 : VR200v - TP-LINK Archer VR200v
processor               : 0
cpu model               : MIPS 34Kc V5.6
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
VPE                     : 0
VCED exceptions         : not available
VCEI exceptions         : not available

Super, both FXS now working on VR200v and system seems to be stable (up with new firmware since ~24h)
More or less insignificant but FXS1 maps to context [lantiq2] and FXS2 to [lantiq1].

Changes I have done on git.lede-project.org/source.git:
Feed asterisk-chan-lantiq from Openwrt source

diff --git a/target/linux/lantiq/dts/VR200v.dts b/target/linux/lantiq/dts/VR200v.dts
index 11930ba..09ed5ba 100644
--- a/target/linux/lantiq/dts/VR200v.dts
+++ b/target/linux/lantiq/dts/VR200v.dts
@@ -8,7 +8,16 @@
        model = "VR200v - TP-LINK Archer VR200v";
 
        chosen {
-               bootargs = "console=ttyLTQ0,115200";
+               bootargs = "console=ttyLTQ0,115200 mem=116M phym=128M vpe1_load_addr=0x87e00000 vpe1_mem=2M maxvpes=1 maxtcs=1";
+       };
+
+       sram@1F000000 {
+               vmmc@107000 {
+                       status = "okay";
+                       gpios = <&gpio 30 GPIO_ACTIVE_HIGH  //fxs relay
+                                        &gpio 31 GPIO_ACTIVE_HIGH  //still unknown
+                                        &gpio 3  GPIO_ACTIVE_HIGH>; //reset_slic?
+               };
        };
 
        aliases {

Thank you all for your Help on that!

(Last edited by Aeronaut84 on 7 Nov 2017, 09:24)

Is there a way to test function of the GPIO's?

No idea, I would like to know that too.
And i would to like know what the GPIOs doin inside the Voicemaschine-driver.
And more i would to like know from where the developer get this information.

OFFTOPIC: Do I understand right, that in TP Link FW WLAN firmware gets loaded by kernel module mtlk.ko?

No idea the VR200v is not my favorite device, does the WLAN works now ?

Some of you are near Stuttgart?

No i am in Nord Germany

So its ok if just one of the two CPU cores come up, right?

Unfortunately right, SMP and VMMC support together are not possible.
The discussion about the FXS support are here: http://lists.infradead.org/pipermail/le … 06219.html
The result is a relativ slow Router with ca max 80 MBit VDSL speed.
I guess that AVM have an other solution there Fritzboxes 7360 and 7490 with the equal VR9 processors are faster.

I am very interessinting on any Linux sourcecode for VR9 devices, did everbody know links ?

chan_lantiq seems to work fine, however during incoming calls the log gets flooded by this repeated message:

[Nov 30 15:02:49] ERROR[2642]: chan_lantiq.c:844 lantiq_map_rtptype_to_format: unsupported rtptype received is 0xd, forcing ulaw

The call itself seems to be working fine, it just lags a bit - I guess because of codec translation. It's a call from a German mobile provider to my Lede box (using PJSIP and a Vodafone Germany SIP Account).
I also got these messages for outgoing calls when trying to edit codec allow/disallow lines in lantiq.conf, when using the default config, outgoing calls don't show this error.

Does anyone know what exactly is causing this?

after setting "rtp set debug on" in asterisk console I can see the whole rtp traffic. It seems that most of the time it uses alaw as desired, but only sometimes chan_lantiq throws an error. This seems to happen more often during incoming calls.

Got  RTP packet from    88.79.152.251:10448 (type 08, seq 000091, ts 050400, len 000160)
Got  RTP packet from    88.79.152.251:10448 (type 08, seq 000092, ts 050560, len 000160)
Got  RTP packet from    88.79.152.251:10448 (type 08, seq 000093, ts 050720, len 000160)
Got  RTP packet from    88.79.152.251:10448 (type 08, seq 000094, ts 050880, len 000160)
Got  RTP packet from    88.79.152.251:10448 (type 08, seq 000095, ts 051040, len 000160)
[Dec  1 14:33:11] ERROR[1368]: chan_lantiq.c:844 lantiq_map_rtptype_to_format: unsupported rtptype received is 0xd, forcing ulaw
Sent RTP packet to      88.79.152.251:10448 (type 08, seq 017743, ts 011176, len 000001)
Got  RTP packet from    88.79.152.251:10448 (type 08, seq 000096, ts 051200, len 000160)
Got  RTP packet from    88.79.152.251:10448 (type 08, seq 000097, ts 051360, len 000160)
[Dec  1 14:33:11] ERROR[1368]: chan_lantiq.c:844 lantiq_map_rtptype_to_format: unsupported rtptype received is 0xd, forcing ulaw
Sent RTP packet to      88.79.152.251:10448 (type 08, seq 017744, ts 011177, len 000001)
Got  RTP packet from    88.79.152.251:10448 (type 08, seq 000098, ts 051520, len 000160)
[Dec  1 14:33:11] ERROR[1368]: chan_lantiq.c:844 lantiq_map_rtptype_to_format: unsupported rtptype received is 0xd, forcing ulaw
Sent RTP packet to      88.79.152.251:10448 (type 08, seq 017745, ts 011178, len 000001)
Got  RTP packet from    88.79.152.251:10448 (type 08, seq 000099, ts 051680, len 000160)
Sent RTP packet to      88.79.152.251:10448 (type 08, seq 017746, ts 011338, len 000160)
Got  RTP packet from    88.79.152.251:10448 (type 08, seq 000100, ts 051840, len 000160)
Sent RTP packet to      88.79.152.251:10448 (type 08, seq 017747, ts 011498, len 000160)
Got  RTP packet from    88.79.152.251:10448 (type 08, seq 000101, ts 052000, len 000160)
Sent RTP packet to      88.79.152.251:10448 (type 08, seq 017748, ts 011658, len 000160)

I still think it's weird that rtp reports packet "type 08" (alaw) and in chan_lantiq it ends up as "0xd".

@Zapp!

Sorry i think it is better too ask an Voodoopriest.
I have an comparable problem. A call from a Friend ( O2 ---> Sipgate ---> me ) call sounds very incomprehensible.
For this reason i try to understand how the order are organized, i know on chan-sip (i have no idea about chan-pjsip) normally the server are the boss, but it can be configured inside sip.conf
But i have no idea what happen when sip-server and client agreed, what happen next concerning chan-lantiq.
The second huge mystery on my config: It seem that sipgate outgoing peer define the order, but this makes no sense. (it should be the inside the [general] menu)

unsupported rtptype received is 0xd

I think rtptype 0xd here is not the rtp type inside chan_lantiq.c, or better it exist different numbers for the same codec.

To make the messages vissible you should set inside /etc/asterisk/logger.conf

console => notice,warning,error,debug,verbose,dtmf,fax


A littlebit (ca < 1 sec) lack are always normal.

@Plonk34

Thanks for your response.

Yeah, there's definitely some Voodoo involved with asterisk. All I can say so far is that the codec priority settings in pjsip.conf and lantiq.conf don't seem to work as expected (at least not as I expect). I'll investigate a bit more and write what I found out.

And thanks for your prebuild packages! They got me started with asterisk, but meanwhile I switched to my own build.

Plonk34 wrote:

I think rtptype 0xd here is not the rtp type inside chan_lantiq.c, or better it exist different numbers for the same codec.

I finally found out what was causing the RTP errors.
I had 'voiceactivitydetection = on' in my lantiq.conf, which leads to separate comfort noise packages being sent, which chan_lantiq apparently can’t handle correctly (yet?). The Payload type of these is 13 ('d' in hex), so the debug messages were correct. I don't know why they weren't shown in the RTP debug log though.

Either not setting voiceactivitydetection at all or setting it to 'sc' (silence compression only) gets rid of this error.

If anyone is interested, I shared my PJSIP configuration here:
https://forum.lede-project.org/t/voip-c … rmany/9470

Hello again!
I experienced an issue, but im not sure, if its my Phone, asterisk config or driver related:
My Phone only shows up the last Call in its Call-List... Also if I try to Call-back this Number, it does not Dial... I get the dial tone, but the number doesn't dial... Since I live in Germany (EU) i tried

calleridtype = etsifsk

in lantiq.conf, but this doesn't change anything...
Answering calls and dial a number over the dialpad works without problems...

I don't know if this is related, but my /var/log/cdr-csv/Master.csv logs:

"","+49xxxxxxx","49xxxxxxxx","tel3_in","""+49xxxxxxxxxxx"" <+49xxxxxxxxxx>","SIP/xxxxxx-00000006","TAPI/2","Dial","TAPI/2,,t","2018-01-08 19:34:22","2018-01-08 19:34:30","2018-01-08 19:35:01",38,31,"ANSWERED","DOCUMENTATION","1515440062.12",""

Strange to me seems the CallerID-Number ("""+49xxxxxxxxxxx"" <+49xxxxxxxxxx>") which is double quote marked... Maybe this makes the issue on the Phone?

Also I registered, that VR200v.dts got not update in LEDE Git... What are the requirements to patch it in LEDE git?
I compiled against asterisk15... But had the same issue on asterisk13...

(Last edited by Aeronaut84 on 9 Jan 2018, 13:50)

Plonk34 wrote:

No idea the VR200v is not my favorite device, does the WLAN works now ?

Sorry for the late answer, didn't recognize until now... No, but I found a thread related to it:
https://forum.openwrt.org/viewtopic.php?id=45047

The discussion might have continued from here.