Hi,
I am using rtpengine to proxy audio to/from media servers.
The outbound calls are being rejected by a couple of my carriers (although accepted by others), and the closest that I have been able to find for the reason is the inclusion of "a=rtcp:xxxxx" in the SDP generated by rtpengine.
To test further, I am trying to remove this line. Rtpengine itself doesn't have any options to remove it, so I am left with manipulating the generated SDP in Kamailio.
A sample of generated SDP is:
a=maxptime:150
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:18 annexb=no
a=fmtp:101 0-16
a=sendrecv
a=rtcp:30939
s=My Media Server
I am using
rtpengine_manage("RTP/AVP ICE=remove");
to generate the SDP to a variable ($avp(sdp))
Now, I am trying to just remove the whole a=rtcp line with re.subst
$avp(sdp)=$(avp(sdp){re.subst,|a=rtcp:[0-9]*\R||s}); *** Tried / as delimiter also, but | looks cleaner ***
This should match the line and any CR/LF characters - BUT in results, nothing is changed (various online Regex testers show this match to be correct - I tried \r\n also).
If I do the same but without the \R, then the line is removed but not the CR/LF, leaving a gap in the SDP - which is invalid.
$avp(sdp)=$(avp(sdp){re.subst,|a=rtcp:[0-9]*||s});
Gives:
a=maxptime:150
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:18 annexb=no
a=fmtp:101 0-16
a=sendrecv
s=My Media Server
Can anyone see where I am going wrong, or suggest an alternative?
Kind Regards,
Mark Hall
On 06/12/2018 07.17, Mark Hall wrote:
Hi,
I am using rtpengine to proxy audio to/from media servers.
The outbound calls are being rejected by a couple of my carriers (although accepted by others), and the closest that I have been able to find for the reason is the inclusion of “a=rtcp:xxxxx” in the SDP generated by rtpengine.
To test further, I am trying to remove this line. Rtpengine itself doesn’t have any options to remove it, so I am left with manipulating the generated SDP in Kamailio.
Actually it does. Add the flag `no-rtcp-attribute` to your invocations and you should be all set.
Cheers
Hi Richard,
Yes, that did the trick - many thanks. I don't see this in the docs anywhere and it didn't come up during many, many www searches.
I would have saved myself a lot of frustration if only I'd taken the time to read the source code.
(btw - still have the carrier issue - ah well).
Kind regards,
Mark Hall
From: sr-users [mailto:sr-users-bounces@lists.kamailio.org] On Behalf Of Richard Fuchs Sent: 06 December 2018 12:36 To: sr-users@lists.kamailio.org Subject: Re: [SR-Users] Assistance with re.subst & newline
On 06/12/2018 07.17, Mark Hall wrote:
Hi,
I am using rtpengine to proxy audio to/from media servers.
The outbound calls are being rejected by a couple of my carriers (although accepted by others), and the closest that I have been able to find for the reason is the inclusion of "a=rtcp:xxxxx" in the SDP generated by rtpengine.
To test further, I am trying to remove this line. Rtpengine itself doesn't have any options to remove it, so I am left with manipulating the generated SDP in Kamailio.
Actually it does. Add the flag `no-rtcp-attribute` to your invocations and you should be all set.
Cheers
Hello,
just for the records, as I saw in the discussion thread that there is a solution with a flag given to rtpengine, but can be useful for similar situations -- better use sdp_remove_line_by_prefix() from sdpops rather than subst regexp -- see:
- https://www.kamailio.org/docs/modules/devel/modules/sdpops.html#sdpops.f.rem...
Cheers, Daniel
On 06.12.18 13:17, Mark Hall wrote:
Hi,
I am using rtpengine to proxy audio to/from media servers.
The outbound calls are being rejected by a couple of my carriers (although accepted by others), and the closest that I have been able to find for the reason is the inclusion of “a=rtcp:xxxxx” in the SDP generated by rtpengine.
To test further, I am trying to remove this line. Rtpengine itself doesn’t have any options to remove it, so I am left with manipulating the generated SDP in Kamailio.
A sample of generated SDP is:
a=maxptime:150
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:18 annexb=no
a=fmtp:101 0-16
a=sendrecv
a=rtcp:30939
s=My Media Server
I am using
rtpengine_manage("RTP/AVP ICE=remove");
to generate the SDP to a variable ($avp(sdp))
Now, I am trying to just remove the whole a=rtcp line with re.subst
$avp(sdp)=$(avp(sdp){re.subst,|a=rtcp:[0-9]*\R||s}); *** Tried / as delimiter also, but | looks cleaner ***
This should match the line and any CR/LF characters – BUT in results, nothing is changed (various online Regex testers show this match to be correct – I tried \r\n also).
If I do the same but without the \R, then the line is removed but not the CR/LF, leaving a gap in the SDP – which is invalid.
$avp(sdp)=$(avp(sdp){re.subst,|a=rtcp:[0-9]*||s});
Gives:
a=maxptime:150
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:18 annexb=no
a=fmtp:101 0-16
a=sendrecv
s=My Media Server
Can anyone see where I am going wrong, or suggest an alternative?
Kind Regards,
Mark Hall
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users