[Home]

Summary:ASTERISK-11898: autoframing only works if SDP contains rtpmap
Reporter:slimey (slimey)Labels:
Date Opened:2008-04-23 04:00:56Date Closed:2008-05-27 14:29:35
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/CodecHandling
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 12501.diff
Description:I'm currently doing an interop with a SIP provider who requires 10ms packetisation of media (PCMA Audio). I've set autoframing=yes in [global] of sip.conf, and "sip show settings" shows that Auto Framing is enabled.

The SDP that comes from the SIP provider looks like:

v=0

o=BroadWorks 8348755 1 IN IP4 172.19.0.20

s=-

c=IN IP4 172.19.0.20

t=0 0

m=audio 24342 RTP/AVP 8

a=ptime:10

However, when Asterisk replies with its own SDP, it's still using 20ms:

v=0

o=BroadWorks 8348747 2 IN IP4 172.19.0.20

s=-

c=IN IP4 172.19.0.20

t=0 0

m=audio 24242 RTP/AVP 8 101

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=ptime:20

a=fmtp:101 0-11

a=sendrecv

I've checked through chan_sip.c, and from what I can see in the code, autoframing only works if the incoming SDP has a=rtpmap lines

Around line 6638 (I have a patch of my own in there which may have affected the line numbers) of chan_sip.c:

                } else if (strlen(a) > 5 && !strncasecmp(a, "ptime", 5)) {
                [...]
                       if (framing && last_rtpmap_codec) {

last_rtpmap_codec is only set when it parses an a=rtpmap line in the SDP

Asterisk should apply the ptime even without an rtpmap line, as rtpmap is only (as I understand it) _required_ if the m= line references a dynamic rtp type.
Comments:By: Joshua C. Colp (jcolp) 2008-04-23 10:14:53

Please give the attached patch a go.

By: Digium Subversion (svnbot) 2008-05-27 14:26:30

Repository: asterisk
Revision: 118558

U   branches/1.4/channels/chan_sip.c

------------------------------------------------------------------------
r118558 | file | 2008-05-27 14:26:29 -0500 (Tue, 27 May 2008) | 4 lines

Fix an issue where codec preferences were not set on dialogs that were not authenticated via a user or peer and allow framing to work without rtpmap in the SDP.
(closes issue ASTERISK-11898)
Reported by: slimey

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=118558

By: Digium Subversion (svnbot) 2008-05-27 14:28:18

Repository: asterisk
Revision: 118560

_U  trunk/
U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r118560 | file | 2008-05-27 14:28:18 -0500 (Tue, 27 May 2008) | 12 lines

Merged revisions 118558 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r118558 | file | 2008-05-27 16:32:38 -0300 (Tue, 27 May 2008) | 4 lines

Fix an issue where codec preferences were not set on dialogs that were not authenticated via a user or peer and allow framing to work without rtpmap in the SDP.
(closes issue ASTERISK-11898)
Reported by: slimey

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=118560

By: Digium Subversion (svnbot) 2008-05-27 14:29:35

Repository: asterisk
Revision: 118561

_U  branches/1.6.0/
U   branches/1.6.0/channels/chan_sip.c

------------------------------------------------------------------------
r118561 | file | 2008-05-27 14:29:35 -0500 (Tue, 27 May 2008) | 20 lines

Merged revisions 118560 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r118560 | file | 2008-05-27 16:34:14 -0300 (Tue, 27 May 2008) | 12 lines

Merged revisions 118558 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r118558 | file | 2008-05-27 16:32:38 -0300 (Tue, 27 May 2008) | 4 lines

Fix an issue where codec preferences were not set on dialogs that were not authenticated via a user or peer and allow framing to work without rtpmap in the SDP.
(closes issue ASTERISK-11898)
Reported by: slimey

........

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=118561