[SR-Users] Assistance with re.subst & newline

Mark Hall mark at brightvoip.co.uk
Thu Dec 6 13:17:03 CET 2018


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

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20181206/2e60c7b3/attachment.html>


More information about the sr-users mailing list