[asterisk-bugs] [JIRA] (ASTERISK-27008) H264 SDP parse fails if fmtp optional parameters have a space

John Harris (JIRA) noreply at issues.asterisk.org
Fri May 19 06:17:58 CDT 2017


John Harris created ASTERISK-27008:
--------------------------------------

             Summary: H264 SDP parse fails if fmtp optional parameters have a space
                 Key: ASTERISK-27008
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27008
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Resources/res_format_attr_h264
    Affects Versions: 14.4.0
            Reporter: John Harris


Discovered while diagnosing a failure of Grandstream GXV3275 video phones to negotiate 720P resolution when SIP call goes via Asterisk.
Also reported to Grandstream- https://forums.grandstream.com/forums/index.php?topic=35745

The initial phone invite contains:
a=fmtp:99 profile-level-id=42801F; packetization-mode=1

Which Asterisk then reinvites the target phone as:
a=fmtp:99 profile-level-id=42801F

So the target phone replies:
a=fmtp:99 profile-level-id=428014

So profile 42801F was requested (H264 level 3.1, 1280x720), but callee responded with profile 428014 (H264 level 2.0, 352x288). These phones require that Asterisk preserves the packetization-mode when it sends the invite.

Asterisk does actually try to parse the initial SDP contents (h264_parse_sdp_fmtp, res/res_format_attr_h264.c). This fails because it splits on semi-colon only, but the Grandstream firmware is also writing a space.

RFC6184 (https://tools.ietf.org/html/rfc6184#page-57) states that these parameters should be 'in the form of a semicolon-separated list of parameter=value pairs'. However the examples in the RFC do also include spaces.

As a workaround you can modify h264_parse_sdp_fmtp to split on semicolon and space:

while ((attrib = strsep(&attribs, "; "))) {

.. but clearly this will regress clients who do not use a space.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list