Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kamailio 5.1.8, error in sdpops, sdp_keep_codecs function #1983

Closed
nicoonline opened this issue Jun 13, 2019 · 8 comments
Closed

Kamailio 5.1.8, error in sdpops, sdp_keep_codecs function #1983

nicoonline opened this issue Jun 13, 2019 · 8 comments
Labels

Comments

@nicoonline
Copy link

nicoonline commented Jun 13, 2019

Hello,

I got this message under some circumstances (the number called)

Jun 12 15:15:01 proxy1 /usr/sbin/kamailio[16096]: ERROR: [core/parser/sdp/sdp.c:228]: set_sdp_payload_fmtp(): Invalid payload location

What means "Payload location" ?

SDP Debug from the callee:
Jun 12 15:15:01 proxy1 /usr/sbin/kamailio[16096]: DEBUG: sdpops [sdpops_mod.c:1626]: sdp_get_helper(): Found SDP v=0#015#012o=- 5793 1 IN IP4 192.168.50.50#015#012s=-#15#012t=0 0#015#012m=audio 24734 RTP/AVP 8 101#015#012c=IN IP4 217.112.190.YY#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:18 annexa=yes#015#012a=fmtp:101 0-15#015#012a=ptime:30#015#012a=silenceSupp:off - - - -#15#012a=sendrecv#015#012

SDP Debug called pbx:

Jun 12 15:15:01 proxy1 /usr/sbin/kamailio[16097]: DEBUG: sdpops [sdpops_mod.c:1626]: sdp_get_helper(): Found SDP v=0#015#012o=root 1673681431 1673681431 IN IP4 217.112.180.5#015#012s=Asterisk PBX 11.25.1#015#012c=IN IP4 217.112.180.YY#015#012t=0 0#015#012m=audio 10884 RTP/AVP 8 101#015#012a=rtpmap:8 PCMA/8000#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:101 0-16#015#012a=ptime:20#015#012a=sendrecv#015#012

@nicoonline
Copy link
Author

We also found that it occurs everytime when RTPEngine is engaged.

@nicoonline
Copy link
Author

this is related to sdp_keep_codec which doesn't remove fmtp payload.

@henningw henningw added the bug label Jun 15, 2019
@henningw henningw changed the title Kamailio SDP Error 5.1.8 Kamailio 5.1.8, error in sdpops, sdp_keep_codecs function Jun 15, 2019
@henningw
Copy link
Contributor

henningw commented Jun 15, 2019

The issue is related to the function call sdp_keep_codecs_by_id(..).
It seems to not remove multiple "a=fmtp" lines related to a removed codec. Shortened example:

m=audio 15684 RTP/AVP 8 18 4 0 101 13
a=fmtp:18 annexa=yes
a=fmtp:18 annexb=no

The resulting SDP that cause the error message is then this:

v=0
o=- 7292 1 IN IP4 192.168.50.50
s=-
t=0 0
m=audio 18466 RTP/AVP 8 101
c=IN IP4 XXX.XXX.XXX.XXX
a=rtpmap:101 telephone-event/8000
a=fmtp:18 annexa=yes
a=fmtp:101 0-15
a=ptime:30
a=silenceSupp:off - - - -
a=sendrecv

@henningw
Copy link
Contributor

Debug log file that shows the problem, second "a=fmtp" is not removed

sdpops.txt

@henningw
Copy link
Contributor

It seems that the function sdp_remove_str_codec_id_attr(..) only removes the first attribute for a deleted codec.

I am traveling for the next week, maybe somebody else could have a look to this issue. Otherwise I can investigate after my return.

@miconda
Copy link
Member

miconda commented Jul 30, 2019

@henningw - did you get a chance to look deeper at this one?

@henningw
Copy link
Contributor

@miconda not yet unfortunately

@henningw
Copy link
Contributor

henningw commented Feb 28, 2020

I looked into the SDPops module and also the SDP core parser. Furthermore I read the relevant RFCs more closely.

It seems that this particular situation (having two ftmp for one media/codec) is not valid.

RFC 4566:
6. SDP Attributes
[...]
a=fmtp:

This attribute allows parameters that are specific to a
particular format to be conveyed in a way that SDP does not
have to understand them. The format must be one of the formats
specified for the media. Format-specific parameters may be any
set of parameters required to be conveyed by SDP and given
unchanged to the media tool that will use this format. At most
one instance of this attribute is allowed for each format.

RFC 5939:
3.13.1. The "rtpmap" and "fmtp" Attributes
[...]
An "fmtp" attribute capability in a
potential configuration for a media format that already has an "fmtp"
attribute in the actual configuration may lead to multiple fmtp
format parameters for that media format and that is not allowed by
SDP [RFC4566]. The delete-attributes MUST be used to ensure that
there are not multiple "fmtp" attributes for a given media format in
a media description.

@henningw henningw closed this as completed Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants