Hello Kamailio Community,
I am currently working on a large scale VoIP deployment and would love to get insights on the best practices for scaling Kamailio. Our current setup handles a moderate volume of calls,,, but we’re expecting a significant increase in traffic soon. Specifically.., I am looking for advice on:
-Optimizing Kamailio’s configuration for high availability and performance.
-Efficiently managing load balancing and failover.
-Recommended hardware specifications for large-scale operations.
-Common pitfalls to avoid when scaling up.
Any tips or resources you could share would be greatly appreciated. If you have experience with similar projects,,, I’d love to hear about your setups and any challenges you faced.
Thank you!
Maria
[aws](https://www.igmguru.com/cloud-computing/aws-developer-certification-tr…
HI,
We are facing a hang issue with Kamailio for the get_profile_size method.
Ramdomly, the Kamailio got hangs, and the CPU went 100%.
During the hanging time, we generated the TRAP and we could see that the
hang happened on the get_profile_size method. We are getting this hang
randomly in dlg_profile.c of the following lines:
The hang occurs, causing the CPU to spike to 100% at one of the following
lines randomly:
1. if(value->len == ph->value.len && memcmp(value->s, ph->value.s,
value->len) == 0) {
2. ph = ph->next;
3. while(ph != profile->entries[i].first);
During our analysis, we found that PROCESS ID 7608 gets a spike of 100%
utilization.
We suspect there may be an issue with the processing of the 'ph' variable,
but we couldn't identify the root cause. I've attached the Kamailio TRAP
for further details. Could you please suggest what might be causing this
problem and how we can resolve it?
Thank you.
I have integrated Microsoft teams and freepbx using Kamailio version 5.8 as
my SBC.
Calls from freepbx to teams are working fine with audio and I am having
challenges with calls from teams to freepbx. The calls rings and after
answering there is only way audio and the call drops off after thirty
seconds. My pbx is behind a microtik router and I have port forwarded my sip
port and rtp ports to freepbx and have also disabled sip alg. My Kamailio is
hosted in AWS. Below are google drive links logs for the incoming call in
Kamailio , freepbx and my Kamailio.cfg. I am thinking It's a
misconfiguration challenge or something else. Please help I am failing to
see my challenge.
kamailio.pcap -
https://drive.google.com/file/d/1aoJhksgwcH-52unwxuyzn8GAmG9PEnOM/view?usp=s
haring
freepbx.pcap -
https://drive.google.com/file/d/1JJXs9UOUFak5Y4uWI_ARB56vQfVYfSDj/view?usp=s
haring
kamailio.cfg -
https://drive.google.com/file/d/1v2ZtylOf8fIMYH4OckGmnP489PO7WI7J/view?usp=s
haring
Best Regards
Hi,
I have a dialog where I have set:
dlg_set_property("timeout-noreset");
But it seems the timeout is reset anyway when handling an in-dialog UPDATE request, at least, on Kamailio 5.5.4. This does not seem to happen with reinvites.
I haven't been able to get more information thus far, other than to be able to say that there is nothing unusual about the UPDATE request and there are no additional errors at log level 2. I was wondering if anyone else has encountered this.
-- Alex
--
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com
Tel: +1-706-510-6800
Hi,
we are using kamailio with app_python3.
It works very good, but in some cases, there are error logs stating:
app_python3 [python_exec.c:91]: apy_exec(): <python method> not found or is not callable
It happens sporadically, and a restart of kamailio fixes it.
As far as i can see it might be linked to concurrent arrival of several messages.
Best regards,
Johannes
# kamailio -v
version: kamailio 5.5.6 (x86_64/linux)
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:
compiled on 12:01:03 Jul 22 2024 with gcc 10.2.1
Hi
I am running kamailio 5.4 on debian
I have carrierfailureroute configured incase of primary service provider
fails. I also have Stirshaken configured to add Identity header on outbound
calls. Issue is when call fail overs to carrierfailureroute,
http_async_query changes $ru to the primary carrier
From the debug logs, when primary carrier sends a 488 (primary carrier
expects SIP TLS but my call is UDP - to test the failover scenario)
39(285) DEBUG: {1 18398 INVITE 8EmmsLqNuMRYBduMqFgX3w4JHAn4C2xn} tmx
[t_var.c:561]: pv_get_tm_reply_code(): reply code is <488>
39(285) DEBUG: {1 18398 INVITE 8EmmsLqNuMRYBduMqFgX3w4JHAn4C2xn}
carrierroute [cr_func.c:178]: set_next_domain_on_rule(): searching for
matching routing rules39(285) INFO: {1 18398 INVITE
8EmmsLqNuMRYBduMqFgX3w4JHAn4C2xn} carrierroute [cr_func.c:197]:
set_next_domain_on_rule(): next_domain is 47987
Carrier route rewrites the failover carrier
39(285) INFO: {1 18398 INVITE 8EmmsLqNuMRYBduMqFgX3w4JHAn4C2xn}
carrierroute [cr_func.c:706]: cr_do_route(): uri 14371234567 was rewritten
to sip:14371234567@sip.primaryprovider.com, carrier 1, domain 47987
Before http_async_query rd and ru are still the failover carrier
39(285) INFO: {1 18398 INVITE 8EmmsLqNuMRYBduMqFgX3w4JHAn4C2xn} <script>:
[callid: 8EmmsLqNuMRYBduMqFgX3w4JHAn4C2xn] - [cfg:2976] - Debug testing
----- rd is sip.primaryprovider.com ----- ru is
sip:14371234567@sip.primaryprovider.com
39(285) DEBUG: {1 18398 INVITE 8EmmsLqNuMRYBduMqFgX3w4JHAn4C2xn}
http_async_client [async_http.c:469]: async_send_query(): transaction
suspended [5261:1830449764]
39(285) DEBUG: {1 18398 INVITE 8EmmsLqNuMRYBduMqFgX3w4JHAn4C2xn}
http_async_client [async_http.c:625]: async_push_query(): query sent [
https://authn-uat.ccid.neustar.biz/ccid/authn/v2/identity?apiKey=randomkey]
(0x7fdcad097e60) to worker 1
However, when the route is being called after the http_async_query it
changes to the primary one:
26(272) DEBUG: tm [t_lookup.c:1612]: t_lookup_ident_filter(): transaction
found
26(272) DEBUG: http_async_client [async_http.c:235]: async_http_cb():
resuming transaction (5261:1830449764)
26(272) DEBUG: tm [t_lookup.c:1612]: t_lookup_ident_filter(): transaction
found
26(272) INFO: <script>: [callid: 8EmmsLqNuMRYBduMqFgX3w4JHAn4C2xn] -
[cfg:2995] - Debug testing ----- rd is 1.2.3.4 ----- ru is
sip:14371234567@1.2.3.4:5061;transport=TLS
Due to this, call keeps going to the primary and it fails
if ( http_async_query(STIRSHAKEN_AS_URL, "AS_RESPONSE") == -1 ) {
xlog("L_ERR ", "[cfg:$cfg(line)] Failed to connect AS service for token $fu
-> $tu \n");
return;
}
route[AS_RESPONSE] {
xlog("L_INFO", "[callid: $ci] - [cfg:$cfg(line)] - Debug testing ----- rd
is $rd ----- ru is $ru\n");
if ($http_ok) {
xlog("L_INFO", "[cfg:$cfg(line)] Resuming outbound call transaction for $fu
-> $tu Received - $http_rb \n");
# Add identity and Date headers
if (jansson_get("identity", $http_rb, "$var(identity)")) {
insert_hf("Identity: $var(identity)\n", "Content-Length");
}
if (jansson_get("date", $http_rb, "$var(date)")) {
if ($hdr(Date) != $null){
remove_hf("Date");
}
insert_hf("Date: $var(date)\n", "Identity");
}
} else {
xlog("L_ERR", "[cfg:$cfg(line)] Resuming outbound call transaction. Error -
$http_err)\n");
}
route(RELAY);
exit;
}
Please help to understand why rd / ru changes to primary carrier.
Regards,
Maharaja Azhagiah
Hi,
We are encountering a hang issue after deploying the following code:
*route(DLG_MANAGE);*
*if ($dlg_var(voip_id) == $null) { $dlg_var(voip_id) =
$hdr(X-Voip-ID);}route[DLG_MANAGE] { if (is_method("INVITE")) {
dlg_manage(); }}*
This code includes the set_dialog_profile. We have this setup with 2 proxy
servers with DMQ enabled, but the issue only occurs on one proxy.
When the Kamailio proxy hangs, no logs are written.
If you have any suggestions to resolve this issue, please help.
Thanks.
Hello,
Can anyone help me to resolve one issue? scenario is -
1- Register two UE (UE-A and UE-B)
2- Call from UE-A to UE-B for a specific duration (lets say: 100 seconds)
3 Verify if call is working: Answer is YES, call is working.
4. shutdown the eNB
5. Observation: No BYE/De-registration message is not coming as expected.
6. Again start eNB and register same UE (UE-A and UE-B)
7. Register UE-A and UE-B both
8. It will not remove previous contacts or not updating the reg-state.
9. I am running with Rx enable mode.
Hello everyone,
I am trying to use a single Kamailio server to register to multiple MS Teams Direct Routing endpoints.
The config snippet I am using is this:
sht_iterator_start("i1", "teams-endpoints");
while(sht_iterator_next("i1")) {
$var(teams_endpoint) = $shtitkey(i1);
$xavp(tls=>server_name) = $var(teams_endpoint);
$xavp(tls[0]=>server_id) = $var(teams_endpoint);
$uac_req(method)="OPTIONS";
$uac_req(ruri)="sip:sip.pstnhub.microsoft.com:5061;transport=tls";
$uac_req(furi)="sip:" + $var(teams_endpoint);
$uac_req(turi)="sip:sip.pstnhub.microsoft.com:5061;transport=tls";
$uac_req(hdrs)="Contact: <sip:" + $var(teams_endpoint) + ":" + "5061" + ";transport=tls>\r\n";
### Create a unique Call-ID based on the Timestamp and the Message Body in MD5
$var(unhashed_cid) = $TV(Sn) + $mb + "";
$uac_req(callid)=$(var(unhashed_cid){s.md5});
uac_req_send();
}
sht_iterator_end("i1");
When the HTable has only one endpoint, everything works fine.
When I add a second endpoint, the first one continues to work but the second one failing with the error from Microsoft:
Q.850;cause=63;text="85babcde-e0b5-4a85-8f4a-12345678c9ae;SBC certificate is not issued correctly. Provided trunk FQDN 'endpoint-02.domain.com' is not included in certificate's CN or SAN list. Certificate allows following FQDNs only: endpoint-01.domain.com.
After some digging around, I realized that all endpoint after the first fail because Kamailio is re-using the same TLS connection for all subsequent OPTIONS as well, but of course the connection has been established with the certificate of the first endpoint.
I have tested the certificates by switching around the first endpoint, so that shouldn't be a problem.
Is there any way I can force it to establish a new TCP/TLS connection for each subsequent request?
Any help would be much appreciated, I have been pulling my hair out with this one!
Best regards,
Nick
[https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-green-avg-…]<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_cam…> Virus-free.www.avg.com<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_cam…>
Hello!
I am working on with Kamailio, I have already understood to add log
prefix like `log_prefix="NAT {$rm $mt $hdr(CSeq) $ci}: "`, but I also want
to record event time, so
how can I config `datetime` in log files. Thanks~