Re: Replacing an attribute in the SDP

David Cunningham via sr-users <[email protected]>
Newsgroups gmane.comp.voip.ser
Message-ID <CAHGbP-_=0PZuPyChwuOPz2nq3P1Y7psNU7w114yiQr9RjnfjCA@mail.gmail.com>
Hi Henning and Daniel,

Thank you very much for the replies. We moved the following configuration
to reply_route{}, and now it inserts "a=sendonly" immediately before the
"a=sendrecv" rather than appending it to the SDP as before. This
configuration does use RTPengine as the call is from a WebRTC client. Have
you any further idea why it's not actually replacing the "a=sendonly"?

                                replace_body_all( "a=sendrecv",
"a=sendonly" );
                                msg_apply_changes();

Daniel, from reading the sdpops documentation it's not clear how to iterate
through an SDP. Could you please give us a pointer on that?

Thanks again.


On Thu, 18 Dec 2025 at 00:23, Daniel-Constantin Mierla <[email protected]>
wrote:

> Hello,
>
>
> On 17.12.25 02:08, David Cunningham via sr-users wrote:
>
> Hello,
>
> We need to replace a=sendrecv with a=sendonly in the 200 OK reply to an
> INVITE. In theory it should be something straightforward, like in the
> onreply_route using:
>
> replace_body_all( "a=sendrecv", "a=sendonly" );
>
> or:
>
> subst_body( '/^a=sendrecv/a=sendonly/' )
>
> Our first problem is that these both are appending a=sendonly to the end
> of the SDP, not replacing values within it. Does anyone know why this might
> happen?
>
> it could be because of conflicting operations with rtpengine (or
> rtpproxy). You could try the replacement in the core reply_route() and then
> use msg_apply_changes.
>
>
>
> Our second problem is that we really only want to do this for video media,
> and not touch the audio media. Are there any text tools that allow you to
> work with specific media within the SDP?
>
> The sdpops has an sdp iterator that could help: once you match the video
> stream, look for the sendrecv attrbute and replace the line.
>
> Cheers,
> Daniel
>
> --
> Daniel-Constantin Mierla (@ asipto.com)twitter.com/miconda -- linkedin.com/in/miconda
> Kamailio Consultancy, Training and Development Services -- asipto.com
> Kamailio World Conference, May 7-8, 2026 - Berlin, Germany -- kamailioworld.com
>
>

-- 
David Cunningham, Voisonics Limited
http://voisonics.com/
USA: +1 213 221 1092
New Zealand: +64 (0)28 2558 3782

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.