Hello!
I'm facing an issue 2/3 times a day with the following errors in the logs:
Nov 22 00:09:02 /usr/local/sbin/kamailio[3720]: CRITICAL: <core>
[core/mem/q_malloc.c:150]: qm_debug_check_frag(): BUG: qm: prev. fragm. tail
overwritten(c0c0c000, abcdefed)[0x7f9600b754f8:0x7f9600b75530]! Memory
allocator was called from core: core/re.c:430. Fragment marked by core:
db_res.c:139. Exec from core/mem/q_malloc.c:391.
Nov 22 00:09:02 /usr/local/sbin/kamailio[3720]: CRITICAL: <core>
[core/mem/q_malloc.c:155]: qm_debug_check_frag(): BUG: qm: prev. fragm. tail
overwritten [0x7f9600b75460:0x7f9600b75498] - fragment marked by tm:
t_fwd.c:230
Nov 22 00:09:02 abrt-hook-ccpp: Process 3720 (kamailio) of user 0 killed by
SIGABRT - ignoring (repeated crash)
Do you have any idea where it could come from? I'm running Kamailio 5.6.4.
Regards,
Igor.
--
Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
www.avast.com
Hello,
during the Kamailio Developers Meeting 2023 in Dusseldorf that took
place last week, it was proposed to obsolete modules that seem to be
unmaintained and no activity about them was noticed during the past
years. It is quite some overhead in packaging them and trying to keep
them compiling when they have external dependencies, therefore such step
should spare some resources in the future.
The list (see below) was built based on the options of those present at
the meeting, now we want to discuss it on the larger communities of
developers and users. If you are using any of these modules or you think
any of them worth keeping, reply with the names of the modules that you
want to be kept.
The proposed action is to relocate the obsoleted modules to a new git
repository "kamailio-obsolete" to still keep some visibility to them and
in the eventually of future interest on any of them, it can be
reintroduced in the main repository.
Next is the initial list of modules proposed to be considered obsolete:
- app_java
- app_lua_sr
- app_mono
- app_python
- app_sqlang
- auth_identity
- call_control
- db2_ldap
- db2_ops
- db_cassandra
- db_perldvdb
- dnssec
- domainpolicy
- h350
- mediaproxy
- osp
- peering
- print
- print_lib
- pua_xmpp
- ratelimit
- uid_auth_db
- uid_avp_db
- uid_domain
- uid_gflags
- uid_uri_db
- uri_db
- xmpp
- xprint
Cheers,
Daniel
--
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy and Development Services
Kamailio Advanced Training -- asipto.com
Hi,
Setup: kamailio acting as a UAC needs to register with a server whose
outbound proxy is DNS SRV based only, there's no A record on the proxy's
FQDN. The provider advertises two SRV records.
;; ANSWER SECTION:
_sips._tcp.sip.provider.com. 10 IN SRV 10 50 5061 sip11-sip.provider.com.
_sips._tcp.sip.provider.com. 10 IN SRV 15 50 5061 sip10-sip.provider.com.
Everything was working fine, until the provider changed the SRV priority,
putting a lower priority on the host that is actually down at the moment.
In this case, sip11-sip.provider.com is DOWN and sip10-sip.provider.com is
UP.
Now, what's happening is Kamailio tries to REGISTER with the lower priority
host, gets no reply back (TCP connection doesn't get established). It then
takes 30 seconds for Kamailio to try the host with the higher priority,
registering successfully. And so it goes for every re-register: failure =>
30 seconds => register OK.
The same happens for INVITES to the downstream: INVITE => timeout => 30
seconds => INVITE (other host 200 OK).
I've tried to play with TCP and DNS params, but so far no luck: no matter
what I did - it took the same 30 seconds for Kamailio to detect failure and
retry the secondary host.
Any suggestions will be highly appreciated.
Kamailio 5.6.4 (x86_64/linux) 239d0a
tcp_connection_lifetime=3604
tcp_max_connections=60
tcp_connect_timeout=10
tcp_keepalive = yes
tcp_crlf_ping=yes
tcp_keepcnt=3
tcp_keepidle=30
tcp_keepintvl=30
tcp_reuse_port=1
tcp_accept_no_cl=yes
tcp_rd_buf_size=16384
use_dns_cache = on
use_dns_failover = on
dns_srv_loadbalancing = on
dns_try_naptr = on
dns_try_ipv6=no
dns_try_naptr=no
dns_use_search_list=no
dns_retr_time=1
dns_retr_no=3
Thanks
--Sergiu
Hi, I am trying to register an endpoint as follows:
REGISTER sip:siptest.booger.net SIP/2.0
Via: SIP/2.0/UDP X.X.X.X.76:31114;branch=z9hG4bK223420485;rport
From: sip:1720XXXXXXX@siptest.booger.net;tag=962873337
To: sip:1720XXXXXXX@siptest.booger.net
Call-ID: 2053687751-32761-1(a)EH.BJI.BAE.HG
CSeq: 2067 REGISTER
Contact: sip:1720XXXXXXX@X.X.X.X:31114;reg-id=2;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000B82A1C58B>"
Authorization: Digest username="654fe87c-67ff-42dd-8d5e-79786a99713c", realm="siptest.booger.net", nonce="ZVaJtmVWiIrsuWc5hkzM3MUUUs8MgRFR", uri=sip:siptest.booger.net, response="119a3b6426cdcfa037bf1825b69139a5", algorithm=MD5
X-Grandstream-PBX: true
Max-Forwards: 70
User-Agent: Grandstream GXP2170 1.0.11.64
Supported: path
Expires: 120
MAC: 00:0b:82:a1:c5:8b
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0
Note that the Authorization username differs from the To-From username. This is intentional, as I am testing use of randomly generated credential .
This worked with this endpoint directly against Asterisk, for instance.
However, registering against Kamailio now, I am getting:
Nov 16 21:24:26 vs-rs01 /usr/sbin/kamailio[584855]: DEBUG: {1 2067 REGISTER 2053687751-32761-1(a)EH.BJI.BAE.HG} auth_db [authorize.c:503]: auth_check(): authentication username mismatch with from/to username
Even though I have this set in the config:
if (!auth_check("$fd", "subscriber", 0)) { // default 1, change to 0 to skip check
0 is supposed to mean no user checks performed.
I am doing this because I want to use the complex credentials for authentication, but want the endpoint to tell me the phone number in an INVITE to/from, instead of putting in the extremely long credential.
Is there a way to get Kamailio to accept different SIP User ID and Authentication ID fields?
Thanks,
Jawaid
Hello all,
I'm using the following Lua script to fetch data from Redis, which is in form of list:
function split(str, delimiter)
for token in string.gmatch(str, "[^" .. delimiter .. "]+") do
return token
end
end
function contains(mainString, subString)
return string.find(mainString, subString, 1, true) ~= nil
end
function longest_match_acode()
local currentSeconds = os.time()
local milliseconds = os.clock() * 1000
local ddate = os.date("%Y-%m-%d %H:%M:%S", currentSeconds) .. string.format(".%03d", milliseconds)
KSR.xlog.xinfo("starting date:" ..ddate)
local size = 0
local result
local acode = "29192"
local inputbcode = "4474173"
local delimiter = ":"
while size == 0 do
local currentSeconds = os.time()
acode = string.sub(acode, 1, string.len(acode) - 1)
KSR.ndb_redis.redis_cmd("srvN", "LRANGE price:" .. acode .." 0 -1", "r")
size = tonumber(KSR.pv.get("$redis(r=>size)"))
end
local left = 0
local right = size - 1
while left <= right do
local currentSeconds = os.time()
local milliseconds = os.clock() * 1000
local ddate = os.date("%Y-%m-%d %H:%M:%S", currentSeconds) .. string.format(".%03d", milliseconds)
resultRight = tostring(KSR.pv.get("$redis(r=>value[" .. right .. "])"))
resultLeft = tostring(KSR.pv.get("$redis(r=>value[" .. left .. "])"))
local bcodeLeft = split(resultLeft, delimiter)
local bcodeRight = split(resultRight, delimiter)
if contains(inputbcode, bcodeRight) then
KSR.xlog.xinfo("Input bcode contains bcode value from Redis: " .. resultRight .. " at index: " .. right .. " with date: " .. ddate)
end
if contains(inputbcode, bcodeLeft) then
KSR.xlog.xinfo("Input bcode contains bcode value from Redis: " .. resultLeft .. " at index: " .. left .. " with date: " .. ddate)
end
left = left + 1
right = right - 1
end
local currentSeconds = os.time()
local milliseconds = os.clock() * 1000
local ddate = os.date("%Y-%m-%d %H:%M:%S", currentSeconds) .. string.format(".%03d", milliseconds)
KSR.xlog.xinfo("ending date:" ..ddate)
end
function ksr_request_route()
if KSR.is_INVITE() then
longest_match_acode()
KSR.sl.send_reply("404", "Not found");
end
end
I'm getting the following warning in the log : WARNING: LUA {INVITE}: <core> [core/pvapi.c:340]: pv_cache_add(): pv cache limit is going to be exceeded - pkg memory may get filled with pv declarations
I think the issue is in the following lines:
resultRight = tostring(KSR.pv.get("$redis(r=>value[" .. right .. "])"))
resultLeft = tostring(KSR.pv.get("$redis(r=>value[" .. left .. "])"))
the list coming from Redis has around 30k items, which I'm iterating through using value[x] which is exhausting the pv declaration as per my understanding.
How to overcome this issue? Is it possible to save the list as an array variable and then iterate through that array?
Regards,
Hello,
Kamailio SIP Server v5.7.3 stable release is out.
This is a maintenance release of the latest stable branch, 5.7, that
includes fixes since the release of v5.7.2. There is no change to
database schema or configuration language structure that you have to do
on previous installations of v5.7.x. Deployments running previous v5.7.x
versions are strongly recommended to be upgraded to v5.7.3.
For more details about version 5.7.3 (including links and guidelines to
download the tarball or from GIT repository), visit:
* https://www.kamailio.org/w/2023/11/kamailio-v5-7-3-released/
RPM, Debian/Ubuntu packages will be available soon as well.
Many thanks to all contributing and using Kamailio!
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - www.kamailioworld.com
Hello,
I am considering to release Kamailio v5.7.3 (out of branch 5.7) soon
(likely on Friday 17 or during the beginning of next week). If anyone is
aware of issues not yet on the bug tracker, report them there asap in
order to have a better chance to be fixed.
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - www.kamailioworld.com
I want to register SIP Trunk directly in Kamailio. How can I register the SIP trunk in Kamailio. Please find the below sample SIP trunk details.
Network IP 10.2.2.2
Subnet Mask 255.255.255.252
Customer IP 10.3.3.3
Gateway IP 10.1.1.1
SBCIP 10.4.4.4
Username 12345678
Password 1234
Please help me with configuration to register SIP trunk in kamailio.
Hi All,
I am playing around with the dlg_req_within to send a REINVITE to toggle some rtpengine parameters and this works fine.
The first time I use the command after tracking the dialog, it sends a REINVITE with an incremented CSEQ value.
However when I issue it again, it sends another REINVITE but with the same CSEQ value, so again 2 for example.
How can you ensure its incremented or can you set it somehow?
As would like to generate at least 2 reinvites per dialog.
Many thanks
Jon
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
Hello Daniel,
I’m using kamailio 5.7.2 currently and this misterious crash occurs again. Now core files are generated also, here is the trace:
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007fae9a2d0859 in __GI_abort () at abort.c:79
#2 0x00005614ad79afd8 in qm_debug_check_frag (qm=0x7fae78e77000, f=0x7fae79805028, file=0x7fae77c8c134 "uac: uac_send.c", line=860, efile=0x5614ad936f99 "core/mem/q_malloc.c", eline=511) at core/mem/q_malloc.c:129
#3 0x00005614ad79f7c1 in qm_free (qmp=0x7fae78e77000, p=0x7fae79805060, file=0x7fae77c8c134 "uac: uac_send.c", func=0x7fae77c8cf10 <__func__.15157> "uac_send_tm_callback", line=860, mname=0x7fae77c8c014 "uac") at core/mem/q_malloc.c:511
#4 0x00005614ad7ab410 in qm_shm_free (qmp=0x7fae78e77000, p=0x7fae79805060, file=0x7fae77c8c134 "uac: uac_send.c", func=0x7fae77c8cf10 <__func__.15157> "uac_send_tm_callback", line=860, mname=0x7fae77c8c014 "uac") at core/mem/q_malloc.c:1350
#5 0x00007fae77c3686b in uac_send_tm_callback (t=0x7fae797dcf40, type=131072, ps=0x7fff8bd990d0) at uac_send.c:860
#6 0x00007fae783abc27 in run_trans_callbacks_internal (cb_lst=0x7fae797dcfe8, type=131072, trans=0x7fae797dcf40, params=0x7fff8bd990d0) at t_hooks.c:241
#7 0x00007fae783abd1e in run_trans_callbacks (type=131072, trans=0x7fae797dcf40, req=0x0, rpl=0x0, code=0) at t_hooks.c:261
#8 0x00007fae782bd8cb in free_cell_helper (dead_cell=0x7fae797dcf40, silent=0, fname=0x7fae783e9f62 "timer.c", fline=653) at h_table.c:165
#9 0x00007fae7837649c in wait_handler (ti=724701450, wait_tl=0x7fae797dcff8, data=0x7fae797dcf40) at timer.c:653
#10 0x00005614ad50be68 in timer_list_expire (t=724701450, h=0x7fae78ef5d18, slow_l=0x7fae78ef95e0, slow_mark=33641) at core/timer.c:857
#11 0x00005614ad50c3a7 in timer_handler () at core/timer.c:922
#12 0x00005614ad50c8d5 in timer_main () at core/timer.c:961
#13 0x00005614ad45fbf3 in main_loop () at main.c:1833
#14 0x00005614ad46ae93 in main (argc=14, argv=0x7fff8bd99b48) at main.c:3086
I think it occurs only if $uac_req(evroute) is set to 1 and I define the event_route[uac:reply] route.
My uac_reply route is easy:
if ($uac_req(evcode)==200) {
xlog("L_INFO", "Registration for user $fU has been refreshed successfully.");
$sht(vtp=>asterisk_restarted) = $null;
route(SAVE_REG);
}
else {
xlog("L_INFO", "Registration failed: $uac_req(evcode)");
}
the SAVE_REG route is the following:
route[SAVE_REG] {
xlog("L_INFO", "Saving pbx registration...:$fU");
$var(maxExpiry) = MAX_PBX_REG_EXPIRY;
route(GET_CLIENT_ID);
sql_pvquery("ca", "select count(*) from pbxusers where user = '$fU'", "$var(pbxusersCnt)");
if ($var(pbxusersCnt)>0) {
if ($var(clientId) == 0) {
sql_query("ca", "update pbxusers set expiry = TIMESTAMPADD(SECOND, $var(maxExpiry), SYSDATE()), online=1 where user = '$fU'");
}
else {
sql_query("ca", "update pbxusers set client_id = '$var(clientId)', expiry = TIMESTAMPADD(SECOND, $var(maxExpiry), SYSDATE()), online=1 where user = '$fU'");
}
}
else {
sql_query("ca", "insert into pbxusers (user, expiry, client_id, online) values ('$fU', TIMESTAMPADD(SECOND, $var(maxExpiry), SYSDATE()), '$var(clientId)', 0)");
}
}
And GET_CLIENT_ID route is:
route[GET_CLIENT_ID] {
$var(clientId) = 0;
if (is_present_hf("X-AT-ClientId")) {
$var(clientId) = $hdr(X-AT-ClientId);
}
}
Any idea, is it a bug or I do something wrong in config files?
Peter
From: Dr. Barabás Péter via sr-users <sr-users(a)lists.kamailio.org>
Date: Sunday, 2023. October 8. 18:49
To: miconda(a)gmail.com <miconda(a)gmail.com>, Kamailio (SER) - Users Mailing List <sr-users(a)lists.kamailio.org>
Cc: Dr. Barabás Péter <dr.peter.barabas(a)gmail.com>
Subject: [SR-Users] Re: uac_req_send + evroute + crash
Hello Daniel,
I do not see any “failed to send request with authentication”.
The next CRITICAL log appears after calling uac_req_send():
CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f114995ada8), called from uac: uac_send.c: uac_send_tm_callback(860), first free uac: uac_send.c: uac_resend_tm_callback(732) - ignoring
Now we use kamailio 5.7.2 and no crash has come, but the critical logs above exist.
I saw a ticket in github: https://github.com/kamailio/kamailio/issues/3522, may the crash be similar or the same to that?
I will make a try next week with downgrading to 5.6.2 and try to reproduce the crash.
Peter
From: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Friday, 2023. October 6. 13:55
To: Dr. Barabás Péter <dr.peter.barabas(a)gmail.com>, Kamailio (SER) - Users Mailing List <sr-users(a)lists.kamailio.org>
Subject: Re: [SR-Users] uac_req_send + evroute + crash
Hello,
do you also get error log messages that include "failed to send request with authentication"?
Which CRITICAL log appears when you call uac_req_send()? You pasted a couple of them in the initial email?
Cheers,
Daniel
On 05.10.23 17:32, Dr. Barabás Péter wrote:
Hello,
I used kamailio version 5.6.2. I refreshed to 5.7.2 today.
As I remember it was in kamailio long time ago therefore I could skip evroute route.
But this CRITICAL log appears always when I call uac_req_send().
I call it with settings:
$uac_req(auser) = $var(username);
$uac_req(apasswd) = $var(password);
Where username and password are retrived from web service before call.
In event_route I got first 401 after 200.
Peter
From: Daniel-Constantin Mierla <miconda(a)gmail.com><mailto:miconda@gmail.com>
Date: Thursday, 2023. October 5. 17:25
To: Kamailio (SER) - Users Mailing List <sr-users(a)lists.kamailio.org><mailto:sr-users@lists.kamailio.org>
Cc: Dr. Barabás Péter <dr.peter.barabas(a)gmail.com><mailto:dr.peter.barabas@gmail.com>
Subject: Re: [SR-Users] uac_req_send + evroute + crash
Hello,
On 05.10.23 16:34, Dr. Barabás Péter via sr-users wrote:
Hi All,
I use kamailio In front of Asterisk and kamailio needs to refresh registrations periodically towards Asterisk to ensure the availability of users from Asterisk side.
I use uac module and call uac_req_send() for sending REGISTER requests.
I set $uac_req(evroute)=1
The event_route[uac:reply] is called fine, but in kamailio logs I see the next lines:
CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f114995ada8), called from uac: uac_send.c: uac_send_tm_callback(860), first free uac: uac_send.c: uac_resend_tm_callback(732) - ignoring
After some time, kamailio has crashed.
CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f114995ada8), called from uac: uac_send.c: uac_send_tm_callback(860), first free uac: uac_send.c: uac_resend_tm_callback(732) – ignoring
CRITICAL: <core> [core/pass_fd.c:277]: receive_fd(): EOF on 34
ALERT: <core> [main.c:774]: handle_sigs(): child process 1407950 exited by a signal 6
what version of Kamailio are you using? Is Asterisk challenging for authentication?
Does it happen every time or seldom?
Cheers,
Daniel
--
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy and Development Services
Kamailio Advanced Training - Online - Nov 14-16, 2023 -- asipto.com
--
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy and Development Services
Kamailio Advanced Training - Online - Nov 14-16, 2023 -- asipto.com