Hi,
I'm using rtpengine for RTP proxying with kamailio.
I use it just for audio.
But eventually some terminal reinvites offering video.
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.
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.
I tried some things like
replace_body("^m=video [0-9]+", "m=video 0");
and
subst_body('/^m=video [0-9]+ /m=video 0 /');
and
msg_apply_changes();
but still the RTP proxying for video is set up.
Any hints on how to solve this?
Ok so making progress but still a little confused, hopefully this forum can shed some light on this behaviour.
Using the hints provided (thanks all so far) and the latency logging from the cookbook I have managed to isolate the issue down to RTPengine introducing the delay.
INFO: app_python3 [apy_kemi.c:1820]: sr_apy_kemi_exec_func(): alert - action KSR.rtpengine.rtpengine_manage(...) took too long [1003089 ms] (file:(null) func:(null) line:252)
What is confusing is, I don't believe this block should be being called.
when the BYE is triggered, it routes to ksr_route_withindlg
# handle requests within SIP dialogs
if self.ksr_route_withindlg(msg)==-255 :
return 1
from within the ksr_route_withindlg a check is done to see if any RTPengine work needs doing
# Handle requests within SIP dialogs
def ksr_route_withindlg(self, msg):
if KSR.siputils.has_totag()<0 :
return 1
# RTPEngine handling for UPDATES & reINVITES with sdp
if self.ksr_route_rtpengine(msg) == -255:
return 1
RTPengine is configured in a way to step in whenever there is an SDP present based on Content-Type: application/sdp
# RTPengine handle anything with SDP
def ksr_route_rtpengine(self, msg):
if KSR.textops.has_body_type("application/sdp"):
KSR.rtpengine.rtpengine_manage(
"RTP/AVP replace-session-connection replace-origin ICE=remove")
return 1
What I can understand is why is this being called and erroring introducing the delay when there is no Content-Type: application/sdp in a BYE ???
As a quick fix I have put this in which stops the problem (I am sure there is better ways to handle this but for now this works in a DEV environment)
def ksr_route_rtpengine(self, msg):
if KSR.is_BYE():
return 1
if KSR.textops.has_body_type("application/sdp"):
KSR.rtpengine.rtpengine_manage(
"RTP/AVP replace-session-connection replace-origin ICE=remove")
return 1
Can anyone see why this would occur? Why is sr_apy_kemi_exec_func(): alert - action KSR.rtpengine.rtpengine_manage(...) even being called for this BYE ? when there is no Content-Type: application/sdp
Lewis
Hi,
I'm trying to configure kamailio to register users over websockets, but i am not able to find any working configuration around, am new to kamailio.
as far as i understand now, xhttp will handle the HTTP GET requests, i am not sure how to configure xhttp port number, cannot find parameters in the module manual, i found multiple sample configs but none of them is working, am using JsSip client.
if someone can guide me with a link to a working config and that i can start from.
Hello,
I am trying to load app_python.so module in kamailio 5.6 and I am getting the following error, under debian bullseye:
ERROR: <core> [core/sr_module.c:573]: load_module(): could not open module </usr/lib/x86_64-linux-gnu/kamailio/modules/app_python.so>: /usr/lib/x86_64-linux-gnu/kamailio/modules/app_python.so: undefined symbol: LOG_
The app_python.so file exists, under that path. Same ERROR for app_python3.so.
I have tried updating some modules's Makefile LDFLAGS but didn't work so far; still searching. Any ideas?
Thank you,
Stefan
Hello!
It was accidentally noticed that the variable $fU gets the user part of
userinfo SIP URI (although it is logical and described in the document
RFC2543).
I got message below and my spam filter based on $fU passed it inside the
network, as $fU was test
From: <sip:test:test@1.1.1.1>;tag=123456
Sure I can filter it through a regular expression, but maybe it's worth
adding another core variable with the userinfo value?
SIP-URL = "sip:" [ userinfo "@" ] hostport
url-parameters [ headers ]
userinfo = user [ ":" password ]
--
BR,
Denys Pozniak
Hello,
For non-commercial support please address our sr-users list (added to CC).
Please look at the uac module, there a function uac_auth() for this particular scenario with example cfg.
https://kamailio.org/docs/modules/5.5.x/modules/uac.html#uac.f.uac_auth
Cheers,
Henning
--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com<https://gilawa.com/>
From: Keshav Kaushik <kdkaushik(a)gmail.com>
Sent: Sunday, August 28, 2022 1:34 PM
To: Henning Westerholt <hw(a)gilawa.com>
Subject: kamailio Trunk authentication
Respected Sir,
I am new to kamailio so not very familiar with config PV’s and transformations etc.
I have successfully authenticated the Twilio SIP phone via ACL.
But I also willing to authenticate the Twilio SIP via username and password.
For doing this I plan to modify the “proxy-authentication” header as blow:
if (is_present_hf("Proxy-Authorization")) {
$nonc=$sel(proxy-authorization.nonce);// not working
$has="kamailio:$ar:SdE-----------ADVpa";
$ha1=$(has{s.md5});
hat="$aa:$adu";
$ha2=$(hat{s.md5});
$resp="$HA1:$nonc:$HA2";
append_hf('Proxy-Authorization: Digest username="kamailio", realm="$ar", nonce="$nonc", uri="sip:+1650ZZZZZZ@XX.YY.7.195", response="$(resp{s.md5})"');
}
remove_hf("Proxy-Authorization");// remove original header
When I save the config file and restart kamailio, it does not start, may be due to some error in code.
Can you please help in authentication of a SIP trunk using user/passowrd.
Thanks in advance
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
Thanks Alex and Kaufman,
As you said there is an element of db blocking for accounting, but I don't see the same impact when the INVITE goes through and sets the accounting flags.
I will look to disable accounting and see if it improves things. If not, I will have a look at benchmark to try and pin it down. It is not causing any noticeable delay in the clearing down of the call to the end users but I want to try and optimise the cleardown if possible.
Once I have tested this I will report back. Thanks for your assistance.
Lewis
I have a situation where I am seeing intermittently Kamailio having delays when relaying the BYE received from an external party
This is only affecting the BYE
We have 6 Kamailios stood up
3 linked to the SIP Providers (SBC)
3 for Registration (REG)
Language KEMI | Python
version: kamailio 5.5.1 (x86_64/linux) 278772-dirty
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 278772 -dirty
compiled with gcc 9.3.0
Simplified Flow
PSTN >>>> Kamailio SBC >>>> FREESWITCH >>>> Kamailio REG >>>> SIP DEVICE
SIP DEVICE >>>> Kamailio REG >>>> FREESWITCH >>>> Kamailio SBC >>>> PSTN
This happens on all of them intermittently when receiving the BYE from either a SIP trunk or a SIP Device Publicly, it can take upto 1s to pass this onto the next hope (Freeswitch) on the local network. All BYEs passed between the local network relay in fractions of a second. All BYEs passed out of the KAMAILIO SBC or KAMAILIO REG to their respective public enpoints relay in fractions of a second but BYEs received from public on advertised address take upto 1s for Kamailio to process and relay.
i.e
PSTN >>> BYE >>>> KAMAILIO SBC (kamailio will sometimes take upto 1 second to relay this on to other kit on the internal solution. Freeswitch etc)
SIP DEVICE >>> BYE >>>> KAMAILIO REG (kamailio will sometimes take upto 1 second to relay this on to other kit on the internal solution. Freeswitch etc)
I am basing these timings on SNgrep and PCAP traces from homer.
Does anyone have any hints and tips on how I can debug this issue. I have enabled debug logging and replicated the issue but it doesn't show anything from what I can see as to why there is delays.
Thanks in advance
lewis