Hi,
I was asked some interesting questions yesterday by a rather techy client
related to Kamailio and RTPEngine performance.
Q1:
For Kamailio we have say 8 child processes, which means there are 8 threads
per listen address to process sip messages, i.e. for example 8 INVITE
messages at any instance of time can be processed by Kamailio. If say, one
INVITE takes 200ms to be processed and send out to destination, then we can
estimate processing power of kamailio to be 40 INVITE requests per second
per listen address, right?
Q2:
If so, then assuming each INVITE requires to engage RTPEngine. How can we
ensure that RTPEngine would be capable to handle these 40 INVITE requests?
The only relevant parameter I see in RTPEngine daemon script is
"NUM_THREADS" (default value 5). What does this represent? Does this
analogs to children as in Kamailio?
Q3:
How does RTPEngine manages SRTP <=> RTP translation (e.g. if one endpoint
is WebRTC and other is traditional SIP)? My understanding is that RTPEngine
has a kernel module (assuming kernel module is installed) which also
manages this conversion besides forwarding the media packets. The Linux
kernel already has encoders / decoders for nearly all encryption algorithms
which are utilized by RTPEngine for doing the conversion in kernel space,
right? if not then how it is done?
Q4:
Continuing to Q2, If these NUM_THREADS process actual media packets (RTP or
SRTP) then are these synchronous or asynchronous? I think these are
asynchronous, just want to confirm (otherwise RTPEngine won't process more
then e.g. 5 calls at a time). So, assuming asynchronous how many packets
can be queue to each thread? This would help estimating RTPEngine
throughput using various codecs in calls. (e.g. assuming G.711 codec we
have 50pps, if each thread queue size is 1000 then each thread can process
1000/50=20 concurrent calls and whole RTPEngine would process 20x5=100
concurrent calls).
Thank you.
nat_traversal doesn't handle IPv6 keepalives. It doesn't add [ and ] around IPv6 addresses and there's some bad parsing of SIP URI's in the code, assuming the first colon after "sip:" (not sips or tel) is a separator for port numbers. A better parser would be nice to use.
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/362
Module: kamailio
Branch: master
Commit: da70040e8f782e90ab8378f54f210e8752b085bc
URL: https://github.com/kamailio/kamailio/commit/da70040e8f782e90ab8378f54f210e8…
Author: Richard Good <richard.good(a)smilecoms.com>
Committer: Richard Good <richard.good(a)smilecoms.com>
Date: 2015-10-15T18:10:22+02:00
modules/ims_qos: new mod param terminate_dialog_on_rx_failure
terminate_dialog_on_rx_failure this parameter determines if a dialog is torn down if a media Rx session is terminated
---
Modified: modules/ims_qos/cdpeventprocessor.c
Modified: modules/ims_qos/mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/da70040e8f782e90ab8378f54f210e8…
Patch: https://github.com/kamailio/kamailio/commit/da70040e8f782e90ab8378f54f210e8…
---
diff --git a/modules/ims_qos/cdpeventprocessor.c b/modules/ims_qos/cdpeventprocessor.c
index 360cff1..94f03f9 100644
--- a/modules/ims_qos/cdpeventprocessor.c
+++ b/modules/ims_qos/cdpeventprocessor.c
@@ -63,6 +63,8 @@ extern int cdp_event_list_size_threshold;
extern struct ims_qos_counters_h ims_qos_cnts_h;
+extern int terminate_dialog_on_rx_failure;
+
int init_cdp_cb_event_list() {
cdp_event_list = shm_malloc(sizeof (cdp_cb_event_list_t));
if (!cdp_event_list) {
@@ -226,7 +228,10 @@ void cdp_cb_event_process() {
LM_DBG("This is a media bearer session session");
//this is a media bearer session that was terminated from the transport plane - we need to terminate the associated dialog
//so we set p_session_data->must_terminate_dialog to 1 and when we receive AUTH_EV_SERVICE_TERMINATED event we will terminate the dialog
- p_session_data->must_terminate_dialog = 1;
+ //we only terminate the dialog if terminate_dialog_on_rx_failure is set
+ if(terminate_dialog_on_rx_failure) {
+ p_session_data->must_terminate_dialog = 1;
+ }
}
break;
diff --git a/modules/ims_qos/mod.c b/modules/ims_qos/mod.c
index 56be1d8..fc9be1a 100644
--- a/modules/ims_qos/mod.c
+++ b/modules/ims_qos/mod.c
@@ -121,6 +121,8 @@ static int fixup_aar(void** param, int param_no);
int * callback_singleton; /*< Callback singleton */
+int terminate_dialog_on_rx_failure = 1; //this specifies whether a dialog is torn down when a media rx session fails - in some cases you might not want the dialog torn down
+
str early_qosrelease_reason = {"QoS released", 12};
str confirmed_qosrelease_headers = {NULL, 0};
@@ -152,6 +154,7 @@ static param_export_t params[] = {
{ "video_default_bandwidth", INT_PARAM, &video_default_bandwidth},
{ "early_qosrelease_reason", PARAM_STR, &early_qosrelease_reason},
{ "confirmed_qosrelease_headers", PARAM_STR, &confirmed_qosrelease_headers},
+ { "terminate_dialog_on_rx_failure", INT_PARAM, &terminate_dialog_on_rx_failure},
{ 0, 0, 0}
};
Hi All,
Quick question, is it possible to use variables in the setflag function,
I am trying to set a flag that is stored in a hash table using the
setflag function, but I keep getting syntax errors. I am using kamailio
4.3.3.
Here's what I am trying to do:
htable core_setid defines a dispatcher setid key and its value is
associated with a flag as follows:
id:key:key_type:value_type:value:expires
1:102:0:1:7:0
so, simple hash table type with an integer key of value 7 and no expiry
In dispatcher I have the following modparams set, so that
ds_is_from_list() will set them if found:
modparam("dispatcher", "setid_pvname", "$var(ds_setid)")
modparam("dispatcher", "attrs_pvname", "$var(ds_setid_attrs)")
Then in my routing logic I have the following code block:
if ( ds_is_from_list() ) {
if ( $sht(core_setid=>$var(ds_setid)) != $null ) {
setflag( $sht(core_setid=>$var(ds_setid)) );
return;
} else {
send_reply("403", "No flag set for source");
exit;
}
}
When I test this using kamailio -c -f <filename> I get the following error:
0(20629) : <core> [cfg.y:3432]: yyerror_at(): parse error in config
file /shared/kamailio/etc/routing_logic.cfg, line 175, column 21-52:
syntax error
0(20629) : <core> [cfg.y:3432]: yyerror_at(): parse error in config
file /shared/kamailio/etc/routing_logic.cfg, line 175, column 21-52:
missing '(' or ')'?
0(20629) : <core> [cfg.y:3432]: yyerror_at(): parse error in config
file /shared/kamailio/etc/routing_logic.cfg, line 175, column 21-52: bad
command: missing ';'?
0(20629) : <core> [cfg.y:3435]: yyerror_at(): parse error in config
file /shared/kamailio/etc/routing_logic.cfg, line 175, column 53: bad
command
ERROR: bad config file (4 errors)
If I change the setflag line to setflag(7), then I dont get the error.
I was wondering if its possible to have hashtable variables as
parameters to the setflag function, or am I going about this in the wron
way.
Any thoughts would be appreciated.
Thanks
It seems like kamailio when using SRV records does not read and use the ADDITIONAL SECTION, and instead sends another DNS request to get the IP for the host, which is inefficient and could be supported just like mentioned in the [RFC 2782](https://www.ietf.org/rfc/rfc2782.txt) :
For each element in the new list
query the DNS for address records for the Target or
use any such records found in the Additional Data
section of the earlier SRV response.
Example, for our `_sip._udp` service using our service discovery tool :
;; ANSWER SECTION:
_sip._udp.service.consul. 15 IN SRV 1 1 5063 ourserver.node.us.consul.
_sip._udp.service.consul. 15 IN SRV 1 1 5060 ourserver.node.us.consul.
_sip._udp.service.consul. 15 IN SRV 1 1 5062 ourserver.node.us.consul.
_sip._udp.service.consul. 15 IN SRV 1 1 5061 ourserver.node.us.consul.
;; ADDITIONAL SECTION:
ourserver.node.us.consul. 15 IN A 98.XXX.XXX.XXX
It has all the information it needs but it still does an extra request. Any thoughts?
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/366