[SR-Users] KSR.sdpops.remove_media is not working as expected

Henning Westerholt hw at skalatan.de
Thu Dec 19 10:44:17 CET 2019


Hello,

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.

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.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com<https://gilawa.com/>

From: sr-users <sr-users-bounces at lists.kamailio.org> On Behalf Of Miteshkumar Thakkar
Sent: Tuesday, December 17, 2019 6:53 AM
To: sr-users at lists.kamailio.org
Subject: [SR-Users] KSR.sdpops.remove_media is not working as expected

Hi,

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.

Kamailio version: kamailio 5.2.5 (x86_64/linux) 62d35f

SDP to process:
INVITE sip:xxxxxxxxxx at xxxxxxxxx.com:5060<http://sip:xxxxxxxxxx@xxxxxxxxx.com:5060> SIP/2.0
Via: SIP/2.0/UDP xxx.xxx.xxx.xxx:5060;branch=z9hG4bK-60823-1-0
From: xxxxxxxxxx <sip: xxxxxxxxxx@ xxxxxxxxxx.com:5060<http://xxxxxxxxxx.com:5060>>;tag=xxxxx
To: xxxxxxxxxx <sip: xxxxxxxxxx@ xxxxxxxxxx.com:5060<http://xxxxxxxxxx.com:5060>>
Call-ID: 1-60823 at 172.16.19.64<mailto:1-60823 at 172.16.19.64>
CSeq: 1 INVITE
Contact: sip:xx at xxxxxxx:5060
Max-Forwards: 70
Content-Type: application/sdp
Content-Length:   337

v=0
o=zt 53655765 2353687637 IN IP4 xxx.xxx.xxx.xxx
s=-
c=IN IP4 xxx.xxx.xxx.xxx
t=0 0
m=image xxxx RTP/AVP udptl t38
a=sendrecv
a=T38FaxVersion:0
a=T38MaxBitRate:14400
a=T38FaxRateManagement:transferredTCF
a=T38FaxMaxBuffer:262
a=T38FaxMaxDatagram:176
a=T38FaxUdpEC:t38UDPRedundancy
m=audio xxxx RTP/AVP 0
a=rtpmap:0 PCMU/8000


Code snippet:
KSR.sdpops.remove_media("image")
logger.log("info", "SDP:" .. headers.get("$sdp(body)"))

Log snippet:
https://pastebin.com/5JZmQUfq

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.

Thanks in advance.

Mitesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20191219/749ebf04/attachment.html>


More information about the sr-users mailing list