[Home]

Summary:ASTERISK-28230: res_rtp_asterisk: abs-send-time extension added with Asterisk 15.5.0 breaks GXV3140 video telephony
Reporter:David Kuehling (dvdkhlng)Labels:pjsip webrtc
Date Opened:2019-01-02 10:58:13.000-0600Date Closed:2019-01-14 08:04:48.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Resources/res_rtp_asterisk
Versions:15.5.0 15.7.1 16.1.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Debian Linux Stretch amd64; Asterisk compiled from sources.Attachments:( 0) asterisk-15.4.1-conversation.txt
( 1) asterisk-16.1.1-conversation.txt
Description:Hi,

I noticed that upgrading from Asterisk 15.4.1 to 15.7.1 my Grandstream GXV3140 stopped displaying h264 video stream.  It just shows a black picture, shows correct video data rate, but displays video frame rate as 0 FPS.

Bisecting the issue I found that the failure happens after commit eb52c70f5b143a96228ffe91c5215b76f48ec355, which implements ASTERISK-27831.

This is also corroborated by some source changes I tested to work around the issue introduced by the above commit:

If I overwrite the value of max_send_time_id, forcing it to -1 in rtp_raw_write(), then video works again.

I don't really understand what's going on here.  The commit eb52c70f5b143a962 looks like it would support some negotiation to enable max-send-time support, however there is no indication that such a negotiation is happening.  Certainly my GXV310 does not claim any support in its SDP payload.  Also I did not find any way to disable the feature using the config files, nor any way to get log output about any negotiation taking place.

This is the SDP payload that is transmitted by the GXV3140:

{code}
v=0
o=10 8001 8000 IN IP4 172.20.20.16
s=SIP Call
c=IN IP4 172.20.20.16
t=0 0
m=audio 31514 RTP/AVP 118 9 0 8 101
a=sendrecv
a=rtpmap:118 L16/16000
a=ptime:10
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
m=video 31516 RTP/AVP 99
b=AS:320
a=sendrecv
a=rtpmap:99 H264/90000
a=fmtp:99 profile-level-id=428014; packetization-mode=0; sprop-parameter-sets=Z0KADJWgUH5A,aM4Ecg==; max-br=320
{code}
Comments:By: Asterisk Team (asteriskteam) 2019-01-02 10:58:13.946-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Joshua C. Colp (jcolp) 2019-01-02 11:03:09.087-0600

15 is no longer supported[1]. Does this also happen with 16? It is only supposed to be enabled if the "webrtc" option is used in PJSIP and if it is negotiated in the SDP, and should otherwise not be. You also did not mention which SIP channel driver you are using.

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions

By: David Kuehling (dvdkhlng) 2019-01-02 11:25:34.315-0600

15.7 was the last version that compiled out-of-the-box on debian stretch.  I will try again with version 16, but this may be non-trivial (debian's version of libjansson is too old).  

I'm using PJSIP and the connection is via SIP-TLS (i.e. TLS on TCP).

{{grep webrtc /usr/local/etc/asterisk/*.conf}} does not find a single match.


By: Richard Mudgett (rmudgett) 2019-01-02 11:34:45.345-0600

It is trivial to use the bundled libjansson instead to use the latest version with any subsequent patches relevant to asterisk which are pending the next release of libjansson:
{noformat}
./configure --with-jansson-bundled --with-pjproject-bundled
{noformat}


By: David Kuehling (dvdkhlng) 2019-01-02 11:50:05.780-0600

@Richard: thanks for the tip, will try tonight update bug report accordingly.

By: David Kuehling (dvdkhlng) 2019-01-02 22:04:01.397-0600

Can now confirm that the issue is also present with Asterisk 16.1.1.  I need the following workaround to allow GXV3140 to display video (tested using the echo test):

{code:none}
Index: asterisk-16.1.1/res/res_rtp_asterisk.c
===================================================================
--- asterisk-16.1.1.orig/res/res_rtp_asterisk.c
+++ asterisk-16.1.1/res/res_rtp_asterisk.c
@@ -4603,6 +4603,7 @@ static int rtp_raw_write(struct ast_rtp_

/* If the abs-send-time extension has been negotiated determine how much space we need */
abs_send_time_id = ast_rtp_instance_extmap_get_id(instance, AST_RTP_EXTENSION_ABS_SEND_TIME);
+ abs_send_time_id = -1;
if (abs_send_time_id != -1) {
/* 4 bytes for the shared information, 1 byte for identifier, 3 bytes for abs-send-time */
{code}



By: Joshua C. Colp (jcolp) 2019-01-03 05:06:22.872-0600

Can you also specify which channel driver you are using? That function should return -1 if not negotiated already. A full SIP trace would also be useful.

By: David Kuehling (dvdkhlng) 2019-01-03 09:56:24.201-0600

Channel driver is PJSIP.  I previously claimed that this was a SIP-TLS connection.  My mistake, for this phone it is just a normal SIP via UDP connection.  Configured via pjsip_wizard.conf:

{code:none}
[phoneudp](!)
type = wizard
accepts_auth = yes
accepts_registrations = yes
endpoint/ice_support = no
endpoint/allow = slin16,g722,alaw,h264
aor/max_contacts = 10
endpoint/context = authorized
endpoint/direct_media = no
transport = transport-udp

[10](phoneudp)
inbound_auth/username=10
inbound_auth/password=<censored>
{code}

How do I record a useful "SIP trace"? I only know Wireshark or tcpdump -w.  Will trace some phone-calls with and without the workaround patch (s.a.) tonight.


By: Joshua C. Colp (jcolp) 2019-01-03 10:05:23.045-0600

SIP traffic can be seen on the Asterisk console using "pjsip set logger on".

By: David Kuehling (dvdkhlng) 2019-01-03 23:24:25.061-0600

SIP conversation corresponding to phone call to echo test number with video enabled.  Only SIP port was captured (no RTP).

Captured once with asterisk 15.4.1 (the last version without abs-send-time) and once with asterisk 16.1.1.

By: Friendly Automation (friendly-automation) 2019-01-14 08:04:49.625-0600

Change 10858 merged by Joshua C. Colp:
res_pjsip_sdp_rtp: Only enable abs-send-time when WebRTC is enabled.

[https://gerrit.asterisk.org/10858|https://gerrit.asterisk.org/10858]

By: Friendly Automation (friendly-automation) 2019-01-14 08:05:32.927-0600

Change 10857 merged by Joshua C. Colp:
res_pjsip_sdp_rtp: Only enable abs-send-time when WebRTC is enabled.

[https://gerrit.asterisk.org/10857|https://gerrit.asterisk.org/10857]