Hello,
I'm running a Kamailio instance with some routing logic in it. When a UA sends an INVITE with urn:emergency:service:sos as RURI, Kamailio responds with a 400 Bad Request URI. I have set debug log level and it looks like the problem is in the parse_uri.c when sanity_check("1511", "7") is called:
parse_uri(): bad char ':' in state 3 parsed: <urn:emergency:service> (21) / <urn:emergency:service:sos> (25)
According to RFC8141 (https://www.rfc-editor.org/rfc/rfc8141), this is a correct URN, but maybe I'm missing something.
Is there a way to make Kamailio parse this RURI?
Kamailio version used: 5.6.4
Thank you!
Hello,
It's kamailio 5.6.4.
I can say that there is no segfault in case Identity is OK but bad attempts
sometimes are the reason for segfault. Not sure I can duplicate but it
happens several times per day.
Please look at logs.
in messages:
Apr 3 09:40:02 kam1 kernel: [6381565.762987] kamailio[9141]: segfault at
746c75616665 ip 00007f20c4cab6df sp 00007ffe7ec51470 error 4 in
libcrypto.so.1.1[7f20c4c3b000+19e000]
kamailio.log:
Apr 3 09:40:02 kam1 kamailio[9141]: NOTICE: <script>: it is INVITE with
Identity. Lets check Identity
Apr 3 09:40:02 kam1 kamailio[9141]: CRITICAL: <core>
[core/mem/q_malloc.c:501]: qm_free(): BUG: bad pointer 0x645f6d6574737973
(out of memory block!) called from tls: tls_init.c: ser_free(323) - ignoring
Apr 3 09:40:02 kam1 kamailio[9182]: CRITICAL: <core> [core/pass_fd.c:277]:
receive_fd(): EOF on 53
Apr 3 09:40:02 kam1 kamailio[9100]: ALERT: <core> [main.c:774]:
handle_sigs(): child process 9141 exited by a signal 11
Apr 3 09:40:02 kam1 kamailio[9100]: ALERT: <core> [main.c:777]:
handle_sigs(): core was not generated
Apr 3 09:40:02 kam1 kamailio[9100]: CRITICAL: <core>
[core/mem/q_malloc.c:501]: qm_free(): BUG: bad pointer 0x645f6d6574737973
(out of memory block!) called from tls: tls_init.c: ser_free(323) - ignoring
loadmodule "stirshaken.so"
####### STIRSHAKEN ######
modparam("stirshaken", "vs_verify_x509_cert_path", 1)
modparam("stirshaken", "vs_ca_dir", "/etc/kamailio/stir_CA")
#modparam("stirshaken", "vs_crl_dir", "/etc/kamailio/CRL")
modparam("stirshaken", "as_default_key",
"/etc/kamailio/key/private_key.pem")
modparam("stirshaken", "vs_cache_certificates", 1)
modparam("stirshaken", "vs_cache_dir", "/tmp/cert_cache")
modparam("stirshaken", "vs_cache_expire_s", 100)
if (is_method("INVITE") && is_present_hf("Identity")) {
xlog("L_NOTICE", "it is INVITE with Identity. Lets check
Identity\n");
if (1 == stirshaken_check_identity()) {
xlog("L_NOTICE", "Shaken Identity is OK\n");
} else {
xlog("L_NOTICE", "Shaken Identity is invalid\n");
}
}
Please give me some advice.
Hello all,
How can we handle stateless replies with kemi?
tm has the following param:
modparam("tm", "on_sl_reply", "stateless_replies")
What's the proper way to map the "stateless_reply" onreply_route to a
kemi function.
I'm playing with the app_jsdt module.
Thanks,
Ovidiu
Hi
Running Kamailio Registrar Node + rtpengine without dialog module, only
TRX module.
Situation: Some customer are in ranges to which RTP can directly be
routed, some are not.
So rtpengine shall be engaged only when backhauling of the rtp stream
is required.
On a message from a CPE, this is done by checking $si and on a message
to the CPE by checking $(ulc(aor=>addr)[$T_branch_idx]{uri.host});
On a BYE, rtpengine_delete() is called no matter if RTP was backhauled
or not. If rtpengine does not find the call to delete, no harm happens.
But now I struggle with Session Refresh Re-Invites TO the CPE as they
are routed very early on and do not pass the whole location lookup
stuff, therefore I have no access to the aor=>addr to determine if the
destination needs backhauling or not.
So the obvious solution which came to my mind is to call
rtpengine_query() and see if it is finding the call and if so, call
rtpengine_manage() to keep backhauling traffic on the Re-Invites
refrreshing the session.
Unfortunately, I found no way to check if rtpengine_query finds the
call. Did I miss something?
--
Mit freundlichen Grüssen
-Benoît Panizzon- @ HomeOffice und normal erreichbar
--
I m p r o W a r e A G - Leiter Commerce Kunden
______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00
CH-4133 Pratteln Fax +41 61 826 93 01
Schweiz Web http://www.imp.ch
______________________________________________________
For immediate release:
ATLANTA, GA (1 April 2023)--The Federal Ministry for Economic Affairs and
Energy of Germany was forced to disclose today that it has been tasked with
assessing whether Germany will be able to operate its Kamailio through the next
winter.
This initiative comes amidst considerable uncertainty, shared in some other EU
member states, about whether the enormous fossil fuel energy footprint of
Kamailio is sustainable after the Russian invasion of Ukraine in early 2022.
Pioneering Atlanta energy market analysts Evariste Systems were tapped to
assist with forecasting whether German strategic natural gas reserves and
liquefied natural gas (LNG) imports could keep Kamailio's enormous turbines
spinning under a variety of stress-test scenarios outlined by regulators,
including SIPP and SIPVicious.
Alex Balashov, Evariste's principal, said in a news conference earlier this
week:
"Simply put, the political leadership wanted a dispassionate, technocratic kind
of analysis, data-driven and the rest, free of the inflection of ideological
bias and tendentious policy angles in charged German domestic
politics. Whether it's the centre-right or the Greens, there are strong ideas
about what to do with energy-greedy megaprojects like Kamailio."
Florida-based energy turnaround vet Fred Posner, parachuted in to assist with
the fast-tracked study, agreed:
"It's well-understood that the German GDP is almost a perfectly linear function
of gross annual SIP packets routed. The Nord Stream 1 shut-off situation in
September only exposed Germany to further Kamailio-related energy
vulnerabilities."
At issue are the basic physics of SIP message routing in Kamailio. Due to a
fixed-size worker process pool, Kamailio routing consumes about 1500 BTUs per
packet-kilometre travelled. While 1500 BTUs/packet-kilometre is efficient in
distance terms as compared to a typical automobile, which consumes roughly 3800
BTUs of fossil fuel energy per passenger-kilometre travelled (at typical load
factors), the dizzying number of SIP packets routed through German territory in
a typical business day greatly outstrips passenger-kilometres travelled.
Balashov noted that sometimes, the activation energy requirement can be higher
than 1500 BTUs when INVITEs with large SDPs are launched toward the next hop,
though this varies with the altitude of the destination above mean sea level,
wind direction, weather and other factors involved in ballistics.
"It's a bit of a fool's errand to play these guessing games with averages. The
energy budget can vary enormously depending on whether there is DTLS, video
codecs, PASSporTs and other stuff. I find it helpful to think in kilowatt-hour
terms: sometimes it's less than half a kWh, so like US $0.20 if you're counting
the beans, and sometimes it's more like $0.38, we just don't know. The
Bundestag always wants these big, round numbers, but if you've ever looked at
the TM module, you know that's not how this works."
A milder-than-expected winter, a 9% year-over-year increase in US LNG exports
(to about 300 million cubic metres per day) in 2022, dependable imports from
Norway and the Netherlands, and other favourable factors gave German SIP
regulators a reprieve. Despite energy market volatility, premium LNG spot
prices, and occasional 408 Request Timed Out scenarios, the country dodged a
widely-feared Kamailio energy crisis. However, it is difficult to say whether
energy market conditions will be as propitious next year.
"Then there's the whole climate change goals thing. Nobody even wants to talk
about that, especially for the WebRTC gateway side," says Posner.
"There's a persistent fantasy that we can just power Kamailio with solar or
wind if we just had enough generating capacity. I think that's really missing
the forest for the trees. The worker processes stay running whether you need
them or not, it all depends on how many listeners you have set and what the
children config value is. Either way, I've got two words for you: base load.
Even if we completely ignore that the energy density is just not there per
hectare of solar or wind installation, how do you provide the constant power to
the child processes?"
Past feasibility studies published jointly by Balashov and Posner support this
assessment. One such study, initiated in 2018 and concluded during the COVID-19
global pandemic, found that an area equivalent to the size of the entire state
of North Rhine-Westphalia would need to be devoted to batteries, even using the
latest lithium ferrous phosphate (LFP) technology.
"But wait, there's more!" says Posner: "Show me the amperage."
"The packet forwarding mechanism is similar to a railgun, at least if you're
doing stateful. Where are you going to get the millions of amps? It's either
setting up huge banks of capacitors god-knows-where, or the pulsed power system
that's undergirded by the original OpenSER turbines. I think we already know
the answer to that."
Balashov noted that, even beyond the political and economic challenges that
Kamailio downtime would introduce, there are other tightropes to walk. As the
most economically dynamic, export-oriented EU member state, Germany is prone to
flirt with SIP proxy privatisation schemes in its national discourse, all while
messaging a stronger Euro to the ECB.
"There is a vocal minority," says Balashov, "who push for research into more
modular, regionally sited SIP gateways. They're always talking about sclerotic,
unresponsive federal regulations and listless, bumbling Brussels bureaucrats
and making it all smaller and leaner. Listen, I'm all for the Invisible Hand,
but setting the Request URI and adding custom headers requires a truly
integrated, national-scale infrastructure. It's the stuff of public-private
partnerships and megaprojects. Even if you're a market zealot who is not sold
on basic INVITEs as a public good, think about Presence or IMS. You really need
the full capacity of a nation-state on deck for that."
If devolution to smaller, more numerous SIP routing sites is not feasible--at
least, at the unit cost and reliability level demanded by advanced
economies--then excessive complexity offers a cautionary tale from the opposite
extreme.
In a particularly notorious example of technical and policy failure, the
Electric Reliability Council of Texas (ERCOT), following the guidance of
northern Californian advisors Unicorn & Moonshot, attempted to scale down
traditional Kamailio turbine blades into newer, so-called Kubernetes "Pod"
chasses to increase exhaust recapture. This made for a much more intricate
installation with an exponential growth of moving parts, telemetry and site
support skill requirements. This proved unmanageable, and the now-famous
explosion that followed the deterioration of the site led to unprecedented
casualties in US history. Furthermore, it also resulted in the long-term
humidification of large expanses of East Texas, Louisiana, Mississippi and
southern Alabama, rendering most of these areas uninhabitable. These events
discredited the Unicorn & Moonshot approach in the eyes of most industry
analysts.
While it will take some months for Evariste to reach a conclusion regarding the
resilience of the German Kamailio through the winter and beyond, and it will
take still longer to issue policy recommendations, one factor is universally
agreed upon already: this prolonged test of Germany's resilience is part of a
Russian strategic calculation.
A conservative MP from the CDU/CSU faction of the Bundestag, speaking on
condition of anonomity, offered this summary: "The Russians think they can wait
this out. They are waiting for us to fold and switch to an OpenSIPS reactor,
knowing full well this will keep us busy with troubleshooting and diminish our
ability to support Ukraine militarily."
--
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com
Tel: +1-706-510-6800