My goal:
make sure when using kamailio as engine I can achieve:
on systems with 4GB memory, Kamailio can serve a population over 300 000 online subscribers
<from: https://www.kamailio.org/w/features/ >
Test bed:
CPU: 4 cores , 4G RAM
Kamailio 5 with Mysql.
Test source:another server running SIPp
10k subscriber in Mysql . 6000 Register Per Second , reuse 10k user to register , it works fine. If register 50 every second for per user it seem 300 k subscribers should work.
(about 300% cpu used of totally 400% cpu. All requests finished without retransmit and fail. )
add 90k subscriber into Mysql .
100k subscirbers in Mysql . 1000 Register Per Second , a lot of failure and can not work .
(cpu are not used much at that time. IO is not high.)
My question :
What is the root cause of bad performance when there is 100k subscribers' data in the Mysql database.
How can I deploy a kamailio with 300k subscriber in database, and support 6000 register per second at the same time ?
Maybe use ram database instead of Mysql?
Thanks with regards,
David
Hi All,
I have system setup where there are few Asterisk servers behind Kamailio. Everything is working properly, the issue only is with the Incoming Subscribe's with to-tag from endpoints.
Below you can see the invite:
----------------------------------------------------------------------------------------------------------
2017/09/27 19:40:29.995598 192.168.2.33:5060 -> 10.25.23.1:5060
SUBSCRIBE sip:10000211@10.25.23.1 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.33:5060;branch=z9hG4bK-fc65f67d
From: "Cisco" <sip:211@10.25.23.1>;tag=258a856c69c288
To: <sip:10000211@10.25.23.1>; tag=02cca2b6-1d9b-4edc-b1de-fdd78f8f9ab0
Call-ID: 4ce04a70-6128897b(a)192.168.2.33
CSeq: 1003 SUBSCRIBE
Max-Forwards: 70
Route: <sip:10.25.23.1;lr;r2=on;ftag=258a856c69c288;nat=yes>, <sip:10.1.1.101;lr;r2=on;ftag=258a856c69c288;nat=yes>
Proxy-Authorization: Digest username="211",realm="10.25.23.1",nonce="Wcvq0VnL6aUbQ3c+nZa5xbh8KMVoOwAq",uri="sip:10000211@10.25.23.1",algorithm=MD5,response="155f68d66b3c6ad035f7db1ec5732020"
Contact: "Cisco" <sip:211@192.168.2.33:5060>
Accept: application/dialog-info+xml
Expires: 1800
Event: dialog
User-Agent: Cisco/SPA504G-7.6.2
Content-Length: 0
----------------------------------------------------------------------------------------------------------
Receiving such Invite Kamailio are routing to RELAY route (from WITHINDLG) and showing such error:
ERROR: rr [loose.c:107]: find_first_route(): failed to parse Route HF
It seems that Kamailio cannot find such Dialog, but why is happening? where is it destroyed?
How can i solve this?
Route (WITHINDLG) is as default, below you can see it as well.
-----------------------------------------------------------------------------------------------------------
route[WITHINDLG] {
if (!has_totag()) return;
if (loose_route()) {
if ( is_method("ACK") ) {
route(NATMANAGE);
}
route(RELAY);
} else {
if (is_method("SUBSCRIBE") && uri == myself) {
route(PRESENCE);
exit;
}
if ( is_method("ACK") ) {
if ( t_check_trans() ) {
t_relay();
exit;
} else {
exit;
}
}
sl_send_reply("404","Not here");
}
exit;
}
-----------------------------------------------------------------------------------------------------------
Thank You.
Hello,
to sync properly for the next major release (v5.1.0) and ongoing
development, I propose an IRC devel meeting for next week, on Wednesday,
Sep 27, 2017. An alternative would be the following day, Sep 28, or if
there are many devs that want to attend and cannot do it these days, we
can look at another date. Just propose new day and time.
I created a wiki page to collect the topics that are wanted to be discussed:
- https://www.kamailio.org/wiki/devel/irc-meetings/2017b
Fell free to add there or reply to the mailing list with what you think
it is relevant to discuss.
Cheers,
Daniel
--
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com
Hi,
using kamailio 4.4.5, we have noticed that the active_dialogs counter is
not accurate and there seems to be some kind of "leak" present at least
on higher loaded systems.
For example, here active_dialogs was reporting just a bit over 1000
dialogs, but the numbers of dialogs confirmed and not just do not sum up
together to that value:
# grep -c 'state:: 1' dialogs_20170919_1712.txt
5
# grep -c 'state:: 2' dialogs_20170919_1712.txt
62
# grep -c 'state:: 3' dialogs_20170919_1712.txt
0
# grep -c 'state:: 4' dialogs_20170919_1712.txt
531
# grep -c 'state:: 5' dialogs_20170919_1712.txt
27
What could be the possible reasons or issues that lead to that?
We are thinking now about switching statistics collection to:
kamctl fifo dlg_list | grep -c 'state:: 4'
or reading the count directly from the database, as it seems to only
write the dialogs with state 4 to mysql and those numbers seem OKish.
Any ideas?
Regards,
Andrew
Hi
We are experiencing issue with python script KSR. textopsx.msg_apply_changes using branch 5.0.2: -
Example Code:
KSR.textopsx.msg_apply_changes()
Error:
Sep 22 15:25:19 sbc99-kam-dev /usr/sbin/kamailio[23141]: PYT {INVITE}: ERROR: app_python [python_support.c:142]: python_handle_exception(): python_exec2: Unhandled exception in the Python code:#012Traceback (most recent call last):#012 File "/etc/kamailio/kamailio-kemi-python.py", line 64, in ksr_request_route#012 if self.ksr_route_reqinit(msg)==-255 :#012 File "/etc/kamailio/kamailio-kemi-python.py", line 173, in ksr_route_reqinit#012 KSR.textopsx.msg_apply_changes()#012AttributeError: 'module' object has no attribute 'textopsx'
Is anybody have any idea how to workaround and apply message changes in python?
Many Thanks
Regards
Muhammad Zaka
Hello
I'm using Kamailio 5.0.1
With the UACREG module, I am registering to a remote provider. Register
goes out, 401 back, Register goes out with nonce & co, OK
Later, when I send an invite, the provider issues an 401 Unauthorized. I
guess it expects me to resubmit an INVITE with the authentication data, but
I dont see how to do that.
Any help would be appreciated !
J.
Hi,
I have difficult times to edit SDP in 200 ok replies, I need to change
RTP/SAVPF to UDP/TLS/RTP/SAVPF in all 200 Ok.
Here is code snippet:
onreply_route {
if ( $rm == "INVITE" && status=="200") {
if (search_body("a=fingerprint")) {
if (search_body(" RTP/SAVPF ")) {
xlog("L_INFO","200 OK DTLS
call.\n");
replace_body_all(" RTP/SAVPF ","
UDP/TLS/RTP/SAVPF ");
}
}
}
}
What I'm doing wrong?
I think my code is executed against SDP of Invite, but not 200 OK.
Jurijs
Hi, based on Daniels example from:
http://blog.miconda.eu/2010/01/best-of-new-in-kamailio-300-19-htable.html
...
modparam("htable", "htable", "acalls=>size=8;")
...
route {
...
if(is_method("INVITE") && !has_totag())
{
# a new call
if($shtcv(ht=>^$fU$)>=3)
{
send_reply("403", "limit exceeded");
exit;
}
$sht(acalls=>$ci) = $fU;
t_on_failure("NEW_INVITE");
}
if(is_method("BYE"))
{
$sht(acalls=>$ci) = $null;
}
...
}
failure_route[NEW_INVITE] {
$sht(acalls=>$ci) = $null;
}
I use this htable variant to share data between two dialogs (store Contact
from one dialog, and re-write other R-URI with it). Referenced by call-id:
...
$avp(referenceID) = $ci + "-" + $avp(direction);
$sht(a=>$avp(referenceID)) = $ct;
...
...
$avp(referenceID) = $ci + "-" + $avp(direction);
avp(newru) = $sht(a=>$avp(referenceID));
avp_subst("$avp(newru)", "/(<)(.*)(>)/\2/");
xlog("L_NOTICE", ">>>>>>>> ReWrite ru with:$avp(newru)\n");
$ru = $avp(newru);
...
Is this the best method to share data between two dialogs? Because you have
to take
care yourself with failure_route and so on, to free (set back to $null)
them. Or is there
a more elegant way for that task?
Best
Kristijan