<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>do msg_apply_changes() after removing the media stream:</p>
<p>KSR.sdpops.remove_media("image")</p>
<p>KSR.textopsx.msg_apply_changes()</p>
<p>then do the rtpengine control.</p>
<p>The rtpengine takes the full sdp and puts back a full one.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="moz-cite-prefix">On 06.01.20 10:19, Miteshkumar Thakkar
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAAztV7QXJqsdkaQtwrw1Ww-38OmNo=+jXDFa4wq9T5hvgjDchw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Thank you Henning.</div>
<br>
<blockquote style="margin:0px 0px 0px
40px;border:none;padding:0px">
<div dir="ltr">
<div>does it actually remove the media after you send
the message out? Usually the message altering
functions will only be applied when you send out the
message due to performance reasons.</div>
</div>
</blockquote>
<div dir="ltr">
<div><br>
</div>
<div>Yes, that's true. When the message sent out, I can
see that remove_media() has actually removed that part
from SDP. </div>
<div><br>
</div>
<div>So basically, when I am sending rtpengine_offer, SDP
is not altered. What should I do to alter SDP before
calling rtpengine_offer?</div>
<div><br>
</div>
<br>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Dec 20, 2019 at 3:16
PM Miteshkumar Thakkar <<a
href="mailto:mitesh.thakkar@plivo.com" target="_blank"
moz-do-not-send="true">mitesh.thakkar@plivo.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Hi,
<div><br>
</div>
<div>After removing media using below code, I am
sending offer to rtpengine. RTPEngine is receiving
entire SDP. It is receiving media type "image" as
well. I have tested again.</div>
<div><br>
</div>
<div>KSR.sdpops.remove_media("image")<br>
logger.log("info", "SDP:" ..
headers.get("$sdp(body)"))<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><b>SDP from RTPEngine log:</b></div>
<div><b><br>
</b></div>
<div>
<div>=0</div>
<div>o=zt 53655765 2353687637 IN IP4
xxx.xxx.xxx.xxx</div>
<div>s=-</div>
<div>c=IN IP4 <span
style="color:rgb(0,0,0);font-family:-webkit-standard;font-size:medium">xxx.xxx.xxx.xxx</span></div>
<div>t=0 0</div>
<div>m=image xxxx RTP/AVP udptl t38</div>
<div>a=sendrecv</div>
<div>a=T38FaxVersion:0</div>
<div>a=T38MaxBitRate:14400</div>
<div>a=T38FaxRateManagement:transferredTCF</div>
<div>a=T38FaxMaxBuffer:262</div>
<div>a=T38FaxMaxDatagram:176</div>
<div>a=T38FaxUdpEC:t38UDPRedundancy</div>
<div>m=audio <span
style="color:rgb(0,0,0);font-family:-webkit-standard;font-size:medium">xxxx</span> RTP/AVP
0</div>
<div>a=rtpmap:0 PCMU/8000</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Dec 19, 2019 at
4:04 PM Henning Westerholt <<a
href="mailto:hw@skalatan.de" target="_blank"
moz-do-not-send="true">hw@skalatan.de</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div lang="DE">
<div>
<p class="MsoNormal"><span>Hello,</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span lang="EN-GB">from the logs
it looks ok, no error etc..:</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">3(237) DEBUG:
app_lua [app_lua_sr.c:1651]:
sr_kemi_lua_exec_func_ex(): param[0] for:
remove_media is str: image</span></p>
<p class="MsoNormal"><span lang="EN-GB">3(237) DEBUG:
sdpops [sdpops_mod.c:1037]: sdp_remove_media():
attempting to search for media type: [image]</span></p>
<p class="MsoNormal"><span lang="EN-GB">3(237) DEBUG:
sdpops [sdpops_mod.c:1053]: sdp_remove_media():
stream 0 of 0 - media [image]</span></p>
<p class="MsoNormal"><span lang="EN-GB">3(237) DEBUG:
sdpops [sdpops_mod.c:1061]: sdp_remove_media():
removing media stream: image</span></p>
<p class="MsoNormal"><span lang="EN-GB">3(237) DEBUG:
sdpops [sdpops_mod.c:1053]: sdp_remove_media():
stream 1 of 0 - media [audio]</span><span
lang="EN-GB"></span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">This is
probably a more frequest used function from the
module. Can you double check if it’s really not
removed on the network layer?</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">Cheers,</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">-- </span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning
Westerholt –
</span><span><a href="https://skalatan.de/blog/"
target="_blank" moz-do-not-send="true"><span
style="color:rgb(5,99,193)" lang="EN-GB">https://skalatan.de/blog/</span></a></span><span
lang="EN-GB"></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kamailio
services –
</span><span><a href="https://gilawa.com/"
target="_blank" moz-do-not-send="true"><span
style="color:rgb(5,99,193)" lang="EN-GB">https://gilawa.com</span></a></span><span>
<span lang="EN-GB"></span></span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><b>From:</b>
Miteshkumar Thakkar <<a
href="mailto:mitesh.thakkar@plivo.com"
target="_blank" moz-do-not-send="true">mitesh.thakkar@plivo.com</a>>
<br>
<b>Sent:</b> Thursday, December 19, 2019 11:16 AM<br>
<b>To:</b> Henning Westerholt <<a
href="mailto:hw@skalatan.de" target="_blank"
moz-do-not-send="true">hw@skalatan.de</a>><br>
<b>Cc:</b> Kamailio (SER) - Users Mailing List <<a
href="mailto:sr-users@lists.kamailio.org"
target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a>><br>
<b>Subject:</b> Re: [SR-Users]
KSR.sdpops.remove_media is not working as expected</p>
<p class="MsoNormal" style="margin-left:35.4pt"> </p>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">The
log mentioned at <a
href="https://pastebin.com/5JZmQUfq"
target="_blank" moz-do-not-send="true">https://pastebin.com/5JZmQUfq</a> is
by configuring "debug = 4" in kamailio.cfg.
Please suggest other way if any, to get more
debug logs.</p>
</div>
<div>
<div>
<p class="MsoNormal"
style="margin-left:35.4pt"> </p>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"
style="margin-left:35.4pt">Thank you, </p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:35.4pt">Mitesh</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"> </p>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">On
Thu, Dec 19, 2019 at 3:34 PM Henning Westerholt
<<a href="mailto:hw@skalatan.de"
target="_blank" moz-do-not-send="true">hw@skalatan.de</a>>
wrote:</p>
</div>
<blockquote style="border-style:none none none
solid;border-left-width:1pt;border-left-color:rgb(204,204,204);padding:0cm
0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"
style="margin-left:35.4pt">
Hello,</p>
<p class="MsoNormal"
style="margin-left:35.4pt">
</p>
<p class="MsoNormal"
style="margin-left:35.4pt">
<span lang="EN-GB">I see – do you get any
error message in the logs? Can you execute
it with debug logging activated, the
function should output some debug logs
about its working.</span></p>
<p class="MsoNormal"
style="margin-left:35.4pt">
<span lang="EN-GB"> </span></p>
<p class="MsoNormal"
style="margin-left:35.4pt">
<span lang="EN-GB">Cheers,</span></p>
<p class="MsoNormal"
style="margin-left:35.4pt">
<span lang="EN-GB"> </span></p>
<p class="MsoNormal"
style="margin-left:35.4pt">
<span lang="EN-GB">Henning</span></p>
<p class="MsoNormal"
style="margin-left:35.4pt">
<span lang="EN-GB"> </span></p>
<p class="MsoNormal"
style="margin-left:35.4pt">
<span lang="EN-GB">-- </span></p>
<p class="MsoNormal"
style="margin-left:35.4pt">
<span lang="EN-GB">Henning Westerholt – </span><a
href="https://skalatan.de/blog/"
target="_blank" moz-do-not-send="true"><span
style="color:rgb(5,99,193)" lang="EN-GB">https://skalatan.de/blog/</span></a></p>
<p class="MsoNormal"
style="margin-left:35.4pt">
<span lang="EN-GB">Kamailio services – </span><a
href="https://gilawa.com/" target="_blank"
moz-do-not-send="true"><span
style="color:rgb(5,99,193)" lang="EN-GB">https://gilawa.com</span></a>
</p>
<p class="MsoNormal"
style="margin-left:35.4pt">
</p>
<p class="MsoNormal"
style="margin-left:70.8pt">
<b>From:</b> Miteshkumar Thakkar <<a
href="mailto:mitesh.thakkar@plivo.com"
target="_blank" moz-do-not-send="true">mitesh.thakkar@plivo.com</a>>
<br>
<b>Sent:</b> Thursday, December 19, 2019
10:56 AM<br>
<b>To:</b> Henning Westerholt <<a
href="mailto:hw@skalatan.de"
target="_blank" moz-do-not-send="true">hw@skalatan.de</a>><br>
<b>Cc:</b> Kamailio (SER) - Users Mailing
List <<a
href="mailto:sr-users@lists.kamailio.org"
target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a>><br>
<b>Subject:</b> Re: [SR-Users]
KSR.sdpops.remove_media is not working as
expected</p>
<p class="MsoNormal"
style="margin-left:70.8pt">
</p>
<div>
<p class="MsoNormal"
style="margin-left:70.8pt">
Thank you for your response Henning!</p>
<div>
<p class="MsoNormal"
style="margin-left:70.8pt">
</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:70.8pt">
Unfortunately, it is not removed from
outgoing message.</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:70.8pt">
True. I also believe that
msg_apply_changes is not recommended,
hence I am not using that.</p>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"
style="margin-left:70.8pt">
</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:70.8pt">
Thank you,</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:70.8pt">
Mitesh</p>
</div>
</div>
</div>
<p class="MsoNormal"
style="margin-left:70.8pt">
</p>
</div>
</div>
<p class="MsoNormal"
style="margin-left:70.8pt">
</p>
<div>
<div>
<p class="MsoNormal"
style="margin-left:70.8pt">
On Thu, Dec 19, 2019 at 3:14 PM Henning
Westerholt <<a
href="mailto:hw@skalatan.de"
target="_blank" moz-do-not-send="true">hw@skalatan.de</a>>
wrote:</p>
</div>
<blockquote style="border-style:none none
none
solid;border-left-width:1pt;border-left-color:rgb(204,204,204);padding:0cm
0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<div>
<div>
<p class="MsoNormal"
style="margin-left:70.8pt">
Hello,</p>
<p class="MsoNormal"
style="margin-left:70.8pt">
</p>
<p class="MsoNormal"
style="margin-left:70.8pt">
<span lang="EN-GB">does it actually
remove the media after you send
the message out? Usually the
message altering functions will
only be applied when you send out
the message due to performance
reasons.</span></p>
<p class="MsoNormal"
style="margin-left:70.8pt">
<span lang="EN-GB"> </span></p>
<p class="MsoNormal"
style="margin-left:70.8pt">
<span lang="EN-GB">You can force it
in the cfg with the function
“msg_apply_changes” – then you
should be able to see it as well
in the log. But using this
function has other side effects
and is not recommended if you
don’t need it.</span></p>
<p class="MsoNormal"
style="margin-left:70.8pt">
<span lang="EN-GB"> </span></p>
<p class="MsoNormal"
style="margin-left:70.8pt">
<span lang="EN-GB">Cheers,</span></p>
<p class="MsoNormal"
style="margin-left:70.8pt">
<span lang="EN-GB"> </span></p>
<p class="MsoNormal"
style="margin-left:70.8pt">
<span lang="EN-GB">Henning</span></p>
<p class="MsoNormal"
style="margin-left:70.8pt">
<span lang="EN-GB"> </span></p>
<p class="MsoNormal"
style="margin-left:70.8pt">
<span lang="EN-GB">-- </span></p>
<p class="MsoNormal"
style="margin-left:70.8pt">
<span lang="EN-GB">Henning
Westerholt – </span><a
href="https://skalatan.de/blog/"
target="_blank"
moz-do-not-send="true"><span
style="color:rgb(5,99,193)"
lang="EN-GB">https://skalatan.de/blog/</span></a></p>
<p class="MsoNormal"
style="margin-left:70.8pt">
<span lang="EN-GB">Kamailio services
– </span><a
href="https://gilawa.com/"
target="_blank"
moz-do-not-send="true"><span
style="color:rgb(5,99,193)"
lang="EN-GB">https://gilawa.com</span></a>
</p>
<p class="MsoNormal"
style="margin-left:70.8pt">
</p>
<p class="MsoNormal"
style="margin-left:106.2pt">
<b>From:</b> sr-users <<a
href="mailto:sr-users-bounces@lists.kamailio.org"
target="_blank"
moz-do-not-send="true">sr-users-bounces@lists.kamailio.org</a>>
<b>On Behalf Of </b>Miteshkumar
Thakkar<br>
<b>Sent:</b> Tuesday, December 17,
2019 6:53 AM<br>
<b>To:</b> <a
href="mailto:sr-users@lists.kamailio.org"
target="_blank"
moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
<b>Subject:</b> [SR-Users]
KSR.sdpops.remove_media is not
working as expected</p>
<p class="MsoNormal"
style="margin-left:106.2pt">
</p>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
Hi,</p>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
I wants to remove media type
"image" from SDP. For that I
have tried to
use KSR.sdpops.remove_media but
it is not working. Not working
in the sense that there is no
effect of that function on SDP.
I am using lua. Kindly find more
details below.</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
<b>Kamailio version</b>: kamailio
5.2.5 (x86_64/linux) 62d35f</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
<b>SDP to process:</b></p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
INVITE <a
href="http://sip:xxxxxxxxxx@xxxxxxxxx.com:5060"
target="_blank"
moz-do-not-send="true">sip:xxxxxxxxxx@xxxxxxxxx.com:5060</a>
SIP/2.0<br>
Via: SIP/2.0/UDP
xxx.xxx.xxx.xxx:5060;branch=z9hG4bK-60823-1-0<br>
From: xxxxxxxxxx <sip:
xxxxxxxxxx@ <a
href="http://xxxxxxxxxx.com:5060"
target="_blank"
moz-do-not-send="true">
xxxxxxxxxx.com:5060</a>>;tag=xxxxx<br>
To: xxxxxxxxxx <sip:
xxxxxxxxxx@ <a
href="http://xxxxxxxxxx.com:5060"
target="_blank"
moz-do-not-send="true">
xxxxxxxxxx.com:5060</a>><br>
Call-ID: <a
href="mailto:1-60823@172.16.19.64"
target="_blank"
moz-do-not-send="true">1-60823@172.16.19.64</a><br>
CSeq: 1 INVITE<br>
Contact: <a
moz-do-not-send="true">sip:xx@xxxxxxx:5060</a><br>
Max-Forwards: 70<br>
Content-Type: application/sdp<br>
Content-Length: 337<br>
<br>
v=0<br>
o=zt 53655765 2353687637 IN IP4
xxx.xxx.xxx.xxx<br>
s=-<br>
c=IN IP4 xxx.xxx.xxx.xxx<br>
t=0 0<br>
m=image xxxx RTP/AVP udptl t38<br>
a=sendrecv<br>
a=T38FaxVersion:0<br>
a=T38MaxBitRate:14400<br>
a=T38FaxRateManagement:transferredTCF<br>
a=T38FaxMaxBuffer:262<br>
a=T38FaxMaxDatagram:176<br>
a=T38FaxUdpEC:t38UDPRedundancy<br>
m=audio xxxx RTP/AVP 0<br>
a=rtpmap:0 PCMU/8000</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
<b>Code snippet:</b></p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
KSR.sdpops.remove_media("image")<br>
logger.log("info", "SDP:" ..
headers.get("$sdp(body)"))</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
<b>Log snippet:</b></p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
<a
href="https://pastebin.com/5JZmQUfq"
target="_blank"
moz-do-not-send="true">https://pastebin.com/5JZmQUfq</a></p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
One more thing I would like to
mention that if I do not
use dialog module then the
function KSR.sdpops.remove_media
works. But I can not avoid using
dialog module.</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
Thanks in advance.</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
</p>
</div>
<div>
<p class="MsoNormal"
style="margin-left:106.2pt">
Mitesh</p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio World Conference - April 27-29, 2020, in Berlin -- <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
</body>
</html>