<div dir="ltr"><div>That's what I'm using.</div><div>Thanks.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 26, 2022 at 3:54 PM Yuriy Gorlichenko <<a href="mailto:ovoshlook@gmail.com">ovoshlook@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"></div>The easiest way I see is:<div dir="auto">Set up mod parameters for rtpengine</div><div dir="auto">Read_avp and write_avp</div><div dir="auto">During the request processing get $rb and put it into read_avp</div><div dir="auto"><br></div><div dir="auto">Change/remove needed lines from the sdp in avp using regexp or lua/js/python (do not use sdpos as it works with initial sdp, so it won't affect the data in avp )</div><div dir="auto"><br></div><div dir="auto">Call rtpengine_manage</div><div dir="auto">Use write_avp after in the call of set_body to apply updated value</div><div dir="auto"><br></div><div dir="auto"><a href="https://www.kamailio.org/docs/modules/devel/modules/textops.html#textops.f.set_body" target="_blank">https://www.kamailio.org/docs/modules/devel/modules/textops.html#textops.f.set_body</a><br></div><div dir="auto"><br></div><div dir="auto">Then you get your changes.</div><div dir="auto"><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Fri, 26 Aug 2022, 01:23 mayamatakeshi, <<a href="mailto:mayamatakeshi@gmail.com" rel="noreferrer noreferrer" target="_blank">mayamatakeshi@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><font face="monospace">Hi,</font></div><div><font face="monospace">Yes, I tried.</font></div><div><font face="monospace">I had this code in my cfg file:</font></div><div><font face="monospace"><br></font></div><div><div><font face="monospace"><font size="1"> sdp_remove_media("video");<br> append_hf("P-hint: video removed\r\n");</font><br></font></div></div><div><font size="1" face="monospace"> rtpengine_offer("symetric direction=pub direction=priv codec-transcode=PCMU codec-transcode=PCMA codec-transcode=GSM codec-transcode=G729");<br></font></div><div><font size="1" face="monospace"><br></font></div><div><font face="monospace">But when I check the INVITE going out from kamailio, </font></div><div><font face="monospace">I see the P-hint header but the m=video line is still there in the SDP:</font></div><div><font size="1" face="monospace"><br></font></div><div><font face="monospace"><font size="1">INVITE sip:user2@10.255.255.1997072 SIP/2.0<br>Max-Forwards: 70<br>Record-Route: <sip:192.168.2.198;lr=on;ftag=837235;vsf=AAAAAEVGVUMAcUVUQkUAbhcKHnQxLmNvbQ--;did=662.4f01><br>To: <<a href="mailto:sip%3A05022222222@192.168.2.198" rel="noreferrer noreferrer noreferrer" target="_blank">sip:05022222222@192.168.2.198</a>><br>From: 05011111111 <<a href="mailto:sip%3A05011111111@test1.com" rel="noreferrer noreferrer noreferrer" target="_blank">sip:05011111111@test1.com</a>>;tag=837235<br>Call-ID: 368391<br>CSeq: 14806 INVITE<br>Content-Type: application/sdp<br>Contact: <<a href="http://sip:user1@192.168.2.50:7070" rel="noreferrer noreferrer noreferrer" target="_blank">sip:user1@192.168.2.50:7070</a>><br>User-Agent: Zoiper<br>Allow-Events: presence, kpml, talk<br>Via: SIP/2.0/UDP 192.168.2.198;branch=z9hG4bK82de.2d1517380038597f70a08f7217851c70.0<br>Via: SIP/2.0/UDP 10.255.255.199:7070;received=192.168.2.50;branch=z9hG4bK794289;rport=7070<br>Content-Length: 518<br><font color="#38761d">P-hint: video removed<br></font><br>v=0<br>v=0<br>o=71924084 8000 8001 IN IP4 192.168.2.110<br>s=SIP Call<br>c=IN IP4 192.168.2.198<br>t=0 0<br>m=audio 48882 RTP/AVP 0 8 3 18 101<br>a=rtpmap:0 PCMU/8000<br>a=rtpmap:8 PCMA/8000<br>a=rtpmap:3 GSM/8000<br>a=rtpmap:18 G729/8000<br>a=fmtp:18 annexb=no<br>a=rtpmap:101 telephone-event/8000<br>a=fmtp:101 0-15<br>a=sendrecv<br>a=rtcp:48883<br>a=ptime:20<br><font color="#ff0000">m=video 48912 RTP/AVP 105<br></font>b=AS:704<br>a=rtcp-fb:* nack pli<br>a=rtcp-fb:* ccm fira=rtpmap:105 H264/90000<br>a=fmtp:105 profile-level-id=428016; packetization-mode=1<br>a=sendrecv<br>a=rtcp:48913</font><br></font></div><div><font face="monospace"><br></font></div><div><font face="monospace">I also tried doing the removal after rtpengine_offer()/rtpengine_manage() but the same thing happens.</font></div><div><font face="monospace">I also tried to use</font></div><div><font face="monospace" size="1"> msg_apply_changes();</font></div><div><font face="monospace">with the same results.</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">So it seems rtpengine_offer() is executed later in the processing and over the original SDP.</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">Checking the docs what eventually worked was this:</font></div><div><font size="1" face="monospace"><br></font></div><div><font size="1" face="monospace"># set rtpengine to read the body from an AVP:</font></div><div><font size="1" face="monospace">modparam("rtpengine", "read_sdp_pv", "$avp(sdp)")<br></font></div><div><font size="1" face="monospace"><br></font></div><div><font size="1" face="monospace"># set $avp(sdp) to a copy of $rb and replace the m=video line:</font></div><div><span style="font-size:x-small;font-family:monospace">$avp(sdp) = $rb;</span><br></div><font face="monospace"><font size="1">subst_attr("$sdp","/m=video [0-9]*/m=video 0/");</font><br></font><div><font face="monospace"><br></font></div><div><font face="monospace">So rtpengine would operate on a</font></div><div><font face="monospace" size="1"> m=video 0 RTP/AVP XXX</font></div><div><font face="monospace">line and so it would not set up rtp proxying for it.</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">Then the original SDP line:<br><font size="1"> m=video 10004 RTP/AVP 105</font><br>became this in the forwarded SDP:<br><font size="1"> m=video 0 RTP/AVP 0<br></font></font></div><div><font face="monospace"><br></font></div><div><font face="monospace">Thanks.</font></div><font face="monospace"><br></font><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><font face="monospace">On Thu, Aug 25, 2022 at 3:39 PM Henning Westerholt <<a href="mailto:hw@gilawa.com" rel="noreferrer noreferrer noreferrer" target="_blank">hw@gilawa.com</a>> wrote:<br></font></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div lang="DE">
<div>
<p class="MsoNormal"><span><font face="monospace">Hello,<u></u><u></u></font></span></p>
<p class="MsoNormal"><span><font face="monospace"><u></u> <u></u></font></span></p>
<p class="MsoNormal"><span lang="EN-GB"><font face="monospace">already tried the sdpops module?<u></u><u></u></font></span></p>
<p class="MsoNormal"><span lang="EN-GB"><font face="monospace"><a href="https://kamailio.org/docs/modules/5.5.x/modules/sdpops.html#sdpops.f.sdp_remove_media" rel="noreferrer noreferrer noreferrer" target="_blank">https://kamailio.org/docs/modules/5.5.x/modules/sdpops.html#sdpops.f.sdp_remove_media</a><u></u><u></u></font></span></p>
<p class="MsoNormal"><span lang="EN-GB"><font face="monospace"><u></u> <u></u></font></span></p>
<p class="MsoNormal"><span lang="EN-GB"><font face="monospace">Cheers,<u></u><u></u></font></span></p>
<p class="MsoNormal"><span lang="EN-GB"><font face="monospace"><u></u> <u></u></font></span></p>
<p class="MsoNormal"><span lang="EN-GB"><font face="monospace">Henning<u></u><u></u></font></span></p>
<p class="MsoNormal"><span lang="EN-GB"><font face="monospace"><u></u> <u></u></font></span></p>
<p class="MsoNormal"><span lang="EN-GB"><font face="monospace">-- <u></u>
<u></u></font></span></p>
<p class="MsoNormal"><font face="monospace"><span lang="EN-GB">Henning Westerholt –
</span><span><a href="https://skalatan.de/blog/" rel="noreferrer noreferrer noreferrer" target="_blank"><span lang="EN-GB" style="color:rgb(5,99,193)">https://skalatan.de/blog/</span></a></span><span lang="EN-GB"><u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="monospace"><span lang="EN-GB">Kamailio services –
</span><span><a href="https://gilawa.com/" rel="noreferrer noreferrer noreferrer" target="_blank"><span lang="EN-GB" style="color:rgb(5,99,193)">https://gilawa.com</span></a></span><span lang="EN-GB"><u></u><u></u></span></font></p>
<p class="MsoNormal"><span lang="EN-GB"><font face="monospace"><u></u> <u></u></font></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace"><b>From:</b> sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org" rel="noreferrer noreferrer noreferrer" target="_blank">sr-users-bounces@lists.kamailio.org</a>>
<b>On Behalf Of </b>mayamatakeshi<br>
<b>Sent:</b> Thursday, August 25, 2022 1:49 AM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <<a href="mailto:sr-users@lists.kamailio.org" rel="noreferrer noreferrer noreferrer" target="_blank">sr-users@lists.kamailio.org</a>><br>
<b>Subject:</b> [SR-Users] Disabling video rtp proxing<u></u><u></u></font></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace"><u></u> <u></u></font></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace">Hi,<u></u><u></u></font></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace">I'm using rtpengine for RTP proxying with kamailio.<u></u><u></u></font></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace">I use it just for audio.<u></u><u></u></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace">But eventually some terminal reinvites offering video.<u></u><u></u></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace">I don't want to refuse the request but just disable RTP proxying for video as my employer has limited bandwidth and want to reserve it only for audio.<u></u><u></u></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace">So I checked the rtpengine module documentation but it seems there is no way to restrict RTP proxying to be performed only for m=audio.<u></u><u></u></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace">I tried some things like<u></u><u></u></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace"> replace_body("^m=video [0-9]+", "m=video 0");<u></u><u></u></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace">and<br>
subst_body('/^m=video [0-9]+ /m=video 0 /');<u></u><u></u></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace">and <u></u><u></u></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace"> msg_apply_changes();<u></u><u></u></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace">but still the RTP proxying for video is set up.<u></u><u></u></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace"><u></u> <u></u></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace">Any hints on how to solve this?<u></u><u></u></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace"><u></u> <u></u></font></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><font face="monospace"><u></u> </font><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div></blockquote></div></div>
__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
* <a href="mailto:sr-users@lists.kamailio.org" rel="noreferrer noreferrer noreferrer" target="_blank">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
* <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div></div></div>
__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
* <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
* <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div>