Hi,
I'd like to implement a couple of helper functions for time handling,
e.g. checking day of week, day of month etc. from within the kamailio
config file. What would you prefer, a new module ("timeutils" maybe?) or
adding it to cfgutils (there are already time-based functions there like
sleep and usleep)?
The idea is to implement time based call-forwards, and an approach could
be to provision various time-related values in usr_preferences table,
and then check it in the config. For example, when doing call-forwards
from Monday to Friday only, I could put this into usr_preferences:
attribute: cf_weekday
value: [1, 2, 3, 4, 5] (each entry is a separate row in usr_preferences)
And in kamailio config, I'd call this:
avp_db_load(...);
if(is_weekday("$avp(s:cf_weekday)")) { do CF }
So is_weekday would iterate over the entries in the avp list and return
true if the weekday at the time of routing matches an entry in the list.
A module config param could control whether to use gmtime or localtime
for matching.
Does this make sense? Suggestions for other approaches? I'd rather
prefer to do it directly in config instead of using some external
interpreter like lua, python etc.
Andreas
Hello,
I am trying to implement the following configuration :
- Kamailio as a SIP proxy/registrar behind a one-to-one NAT (port number is
not modified) listening on ports 5060 and 53 (and more ports in the future)
- aliases correctly configured :
alias= udp: public_ip:53
alias= udp: public_ip:5060
alias= udp: hostname:53
alias= udp: hostname:5060
- listen directive correctly on private ip address and both ports :
listen=udp:private_ip:53
listen=udp:private_ip:5060
- advertised_address=public_ip
- record_route_preset("public_ip") is used to announce the public IP
address in the RR header
- user A : registered on port 5060
- user B : registered on port 53
Suppose user A tries to call user B.
The Record-Route header in the INVITE forwarded from Kamailio to user B
should contain the port number on which user B is connected (53), to force
user B to send future requests to that port number. But I have no method to
know which port user B is connected to, and that problem is aggravated when
user B has multiple registrations on different port numbers and parralel
forking is done. Declaring advertised_port doesn't solve the problem. I
cannot force port number 53 in record_route_preset("public_ip:53") since it
wouldn't work when user B calls user A. Using the record_route( ) function,
Kamailio doesn't use the advertised_address to construct the RR header.
Another problem is that the record_route_preset function clears the DID
cookie set by the dialog module, which makes Kamailio fallback to SIP
elements to match the request to an existing dialog, thus dialog matching
becomes slower, and performance is an issue for me.
Any suggestions? I know that one solution would be to run Kamailio with a
public IP address and no NAT, but unfortunately it's not possible.
I suggest that the function record_route( ) takes a public IP address as a
parameter, still doing what it does (correct record routing and cookie
addition did=xxx and loose route lr=on), but only replacing the private IP
address on which Kamailio listens with a public IP address. Or that the
record_route( ) function uses the advertised_address to construct the RR
header.
Thank you
RA
Hello,
We plan to use Kamailio as redirect server. Corresponding contact list is to
be fetched by a Lua script from DB.
The problem is about calling the required 'rewriteuri' function:
1. From lua script. both 'sr.rewriteuri()' and 'sr.modf("rewriteuri",
...)" fails to write the 'contact' field.
2. I tried an alternative way; pushing the value from lua (e.g.
sr.pv.sets("contact", "sip:...")) and got the value in the Kamailio.cfg
($var(contact)). But can't call the rewriteuri function with this variable's
value as argument. This seems to be a general problem of calling a function
from .cfg with a variable's value as parameter.
Any help much appreciated.
--
Sharif
Hello everyone,
I'm doing some TLS performance testing on Kamailio 3.2.1. Here's my setup:
kamailio -V
version: kamailio 3.2.1 (x86_64/linux) 31c991
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS,
USE_RAW_SOCKS, USE_STUN, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK,
SHM_MEM, SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX,
FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 31c991
compiled on 19:38:03 Dec 20 2011 with gcc 4.4.6
uname -a
Linux null.null.com 2.6.32-220.el6.x86_64 #1 SMP Tue Dec 6 19:48:22
GMT 2011 x86_64 x86_64 x86_64 GNU/Linux
CentOS 6.2 on a Dell PowerEdge R610 with 24 Intel X5650 Cores at
2.67GHz and 12GB of RAM (I could use more).
Kamailio is the default config with a few changes:
- WITH_TLS defined
- TLS is using self-generated CAs/certs (essentially openvpn easy-rsa)
with 1024 bit key size
- TLS is *not* configured to verify client OR server certs by default
- I'm using TLS v1 (SSL 3.1)
- TLS cipher suites are set to any (although my simulated UAs only
offer AES 256+SHA)
- Various changes to Kamailio children (up to 256 at times) and memory
sizes (up to 2048mb and even 4096mb at times)
- One DNS based alias added
- Maximum TCP connections increased to 65000
- Kamailio is configured to only listen on tested IP (UDP, TCP, TLS
sockets active)
- Syslog has been configured to log local0 (Kamailio) asynchronously
My test rig/call generator is an Ixia Xcellon-Ultra NP load module
with IXLoad. My call scenario does the following:
- Registers two simulated user agents (100000, 200000) to Kamailio with TLS
- Places call from 100000 to 200000 via Kamailio with TLS
- Increments both user agents by 1 and continues as quickly (cps) as I
like up to a channel limit (also configurable)
- The Ixia generates a valid SDP but no RTP is generated (although
that's certainly possible at these call levels)
Two 1 gig ports on the Ixia are connected to the Broadcom NICs on
the Dell R610 via a Cisco Catalyst 4948 switch. One port on the Ixia
emulates the 100000 agents (A leg) and the other emulates the 200000
agents (B leg). Of course I can provide more information if needed.
Here are some test numbers:
With TLS at 20cps, 120 sec calls, up to a total of 2470 calls (4940
registrations) life is good. Very good - call setup time averages
23ms, the cps rate holds indefinitely, and not a single call or
registration fails over long term tests.
UDP and TCP numbers are excellent (bordering ridiculous) - usually
around 500cps with practically no reasonable upper limit on
simultaneous calls. This doesn't need any further discussion :).
The TLS numbers start falling apart pretty quickly after 20cps,
however. If I change the TLS test to 40cps, 120 sec calls, up to a
total of 4940 calls (9,880 registrations) Kamailio starts to
(seriously) struggle. The rate starts fluctuating all over the place,
call setup time averages jump to 8000ms (or more) and things just
generally get ugly. Interestingly enough all of the user agents are
able to register, the logs look fine (to my eye at this log level) and
the system (CPU, network, etc) doesn't appear to be under stress at
all.
I have a few questions:
1) Is there something obviously wrong or stupid I'm doing here?
2) Why are the TLS tests so much worse than TCP and UDP? Am I
missing something here?
Thanks (in advance) for any advice anyone might be able to offer!
--
Kristian Kielhofner
I have been trying to accomplish a couple tasks with Kamailio over the past
month with no luck. What I need is a bit of one-on-one training with
someone who knows the lay of the land. If you do this kind of consulting
and can use Skype with possibly a shared-screen terminal, please drop me an
email with your rate.
Hi,
I ran into a scenario with couple of serial forks where kamailio loops
to itself and, due to the looping, the INVITE to a new branch happens
before the CANCEL to an old branch. What I do at the moment is force
rtpproxy in branch route, and stop rtpproxy in the failure route.
The problem with this scenario is that in rtpproxy_offer and
unforce_rtpproxy, the rtpproxy module only passes the call-id and
from-tag to rtpproxy (because there is no to-tag yet), which then in
unforce_rtpproxy for a CANCEL deletes all calls related to it (because
it can only match on from-tag and call-id, obviously). This means that
when I do a subsequent rtpproxy_answer for my new branch, rtpproxy
doesn't find the session anymore, since it has been removed with the CANCEL.
A fix I can think of is to also pass the branch of the top-most via to
rtpproxy in order to perform a more fine-grained matching. Are there
solutions to that out there somewhere, or is it something I should just
introduce, eg. as a new param to offer/answer/unforce functions?
Objections? Other approaches?
Andreas
Hello,
I'm trying to upgrade my company's sip server to the latest Kamailio to 3.1.5.
My development environment contained Openssl 0.9.8K version and everything works fine here.
I have tried to install a fresh package for my release, the openssl version from the Ubuntu packages is Openssl 1.0.0e
And I get the following error.
My error looks like this:
sudo /etc/init.d/kamailio start
Not starting kamailio: invalid configuration file!
-e
0(26880) ERROR: <core> [sr_module.c:523]: ERROR: load_module: could not open module </home/p4dev/BLand_password-Evo-N800v_4700/sw/SipServer/main/kamailio/lib/kamailio/modules/tls.so>: /home/p4dev/BLand_password-Evo-N800v_4700/sw/SipServer/main/kamailio/lib/kamailio/modules/tls.so: undefined symbol: SSLv2_client_method
0(26880) : <core> [cfg.y:3416]: parse error in config file /home/p4dev/BLand_password-Evo-N800v_4700/sw/SipServer/main/kamailio/etc/kamailio/kamailio.cfg, line 259, column 12-19: failed to load module
0(26880) WARNING: <core> [sr_module.c:578]: /home/p4dev/BLand_password-Evo-N800v_4700/sw/SipServer/main/kamailio/lib/kamailio/modules_k/perl.so: exports dlflags interface is deprecated and it will not be supported in newer versions; consider using mod_register() instead
0(26880) ERROR: <core> [modparam.c:161]: set_mod_param_regex: No module matching <tls> found
0(26880) : <core> [cfg.y:3419]: parse error in config file /home/p4dev/BLand_password-Evo-N800v_4700/sw/SipServer/main/kamailio/etc/kamailio/kamailio.cfg, line 437, column 118: Can't set module parameter
ERROR: bad config file (2 errors)
I'm not sure if this is a compatibility issue or is there some library missing that I have to install.
I saw this patch online with reference to Crypt-SSLeay at https://rt.cpan.org/Public/Bug/Display.html?id=70565
*The linker complains about missing SSLv2_method. The following patch works for me:*
--- SSLeay.xs~ 2011-08-29 07:25:46.000000000 +0200
+++ SSLeay.xs 2011-08-29 07:29:04.000000000 +0200
@@ -125,13 +125,9 @@
if(ssl_version == 23) {
ctx = SSL_CTX_new(SSLv23_client_method());
}
- else if(ssl_version == 3) {
+ else {
ctx = SSL_CTX_new(SSLv3_client_method());
}
- else {
- /* v2 is the default */
- ctx = SSL_CTX_new(SSLv2_client_method());
- }
SSL_CTX_set_options(ctx,SSL_OP_ALL|0);
SSL_CTX_set_default_verify_paths(ctx);
SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, NULL);
Hi All.
As per the tcp_crlf_ping description, kamailio shall reply CRLF only when
it receives "CRLF CRLF". But In the 3.1.0 version, if kamailio recieves
"CRLF", it respond back CRLF. Is this an expected behavior or an error?
Thanks
Jijo