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
I have 2 servers running Solaris and Kamailio 3.2.3 where on one
Kamailio is terminating when it tries to save the location for a
register request and the other is producing a core dump when processing
an Option request. I have one server handling Register request while the
other sip server forwards the register requests and handles the other
requests. I have included the backtraces from the core dumps and the
output from the log for the registrar server as well as the command that
is causing kamailio to terminate:
if (!save("location"))
sl_reply_error();
4(3364) ERROR: *** cfgtrace:
c=[/opt/kamailio-3.2/etc/kamailio/kamailio.cfg] l=714 a=17 n=if
4(3364) ERROR: *** cfgtrace:
c=[/opt/kamailio-3.2/etc/kamailio/kamailio.cfg] l=711 a=26 n=save
14(3374) : <core> [pass_fd.c:293]: ERROR: receive_fd: EOF on 15
14(3374) DEBUG: <core> [tcp_main.c:3555]: DBG: handle_ser_child: dead
child 4, pid 3364 (shutting down?)
14(3374) DEBUG: <core> [io_wait.h:617]: DBG: io_watch_del (1003743d8,
15, 0, 0x0) fd_no=18 called
0(3360) ALERT: <core> [main.c:751]: child process 3364 exited by a
signal 10
0(3360) ALERT: <core> [main.c:754]: core was not generated
0(3360) INFO: <core> [main.c:766]: INFO: terminating due to SIGCHLD
6(3366) INFO: <core> [main.c:817]: INFO: signal 15 received
1(3361) INFO: <core> [main.c:817]: INFO: signal 15 received
2(3362) INFO: <core> [main.c:817]: INFO: signal 15 received
3(3363) INFO: <core> [main.c:817]: INFO: signal 15 received
5(3365) INFO: <core> [main.c:817]: INFO: signal 15 received
7(3367) INFO: <core> [main.c:817]: INFO: signal 15 received
8(3368) INFO: <core> [main.c:817]: INFO: signal 15 received
9(3369) INFO: <core> [main.c:817]: INFO: signal 15 received
10(3370) INFO: <core> [main.c:817]: INFO: signal 15 received
11(3371) INFO: <core> [main.c:817]: INFO: signal 15 received
12(3372) INFO: <core> [main.c:817]: INFO: signal 15 received
13(3373) INFO: <core> [main.c:817]: INFO: signal 15 received
14(3374) INFO: <core> [main.c:817]: INFO: signal 15 received
0(3360) DEBUG: presence_xml [presence_xml.c:347]: start
0(3360) ERROR: ctl [ctl.c:379]: ERROR: ctl: could not delete unix
socket /tmp/kamailio_ctl: Permission denied (13)
0(3360) DEBUG: <core> [db_pool.c:102]: removing connection from the pool
0(3360) DEBUG: db_postgres [km_pg_con.c:122]: PQfinish(100842470)
0(3360) DEBUG: db_postgres [km_pg_con.c:126]: pkg_free(1004c1f30)
0(3360) DEBUG: tm [t_funcs.c:122]: DEBUG: tm_shutdown : start
0(3360) DEBUG: tm [t_funcs.c:125]: DEBUG: tm_shutdown : emptying hash
table
0(3360) DEBUG: tm [t_funcs.c:127]: DEBUG: tm_shutdown : removing
semaphores
0(3360) DEBUG: tm [t_funcs.c:129]: DEBUG: tm_shutdown : destroying
tmcb lists
0(3360) DEBUG: tm [t_funcs.c:132]: DEBUG: tm_shutdown : done
Thanks
Nathaniel
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
Oppsie.. forgot to attach the document.
Gnaneshwar Gatla | InTouch Health | Software Developer
6330 Hollister Ave. Goleta CA, 93117 | P: 805.562.8686 ext: 199
From: Gnaneshwar Gatla
Sent: Thursday, April 26, 2012 2:14 PM
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List
Subject: kamailio Crashes with rls module
Hello,
I'm experimenting the usage of rls module with Kamailio. I have been able to successfully update xcap documents on Kamailio XCAP server.
I have tried to use SIPp to get a NOTIFY for subscribing a rls-service list.
Kamailio does get the xml from the xcap table and tries to parse it and crashes. I'm not sure if this is because the format of the XML, I derived the xml format from the RFC 4662 and 4826.
I have attached the Kamailio log. I need help with this.
Any help is appreciated, thank you very much.
Gnaneshwar Gatla | InTouch Health | Software Developer
6330 Hollister Ave. Goleta CA, 93117 | P: 805.562.8686 ext: 199
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,
Is there a way to change/replace anything in body message ?
Used: replace_body_atonce, replace_body_all, replace_all, subst_body.
Nothing is working.
Thanks,
Hi,
I'm trying to setup Kamailio as a Homer capture server itself.
Kamailio listens on 2 ports : 53 for SIP users, and 9060 for homer SIP
capture.
siptrace module duplicates packets to sipcapture module on port 9060.
I'm getting the following error :
ERROR: siptrace [siptrace.c:1669]: invalid port number; must be in
[1024,65536]
This is my conf
-----------------------
listen=udp:10.238.235.173:53
listen=udp:127.0.0.1:9060
#!ifdef WITH_SIPTRACE
modparam("siptrace", "traced_user_avp", "$avp(s:traced_user)")
modparam("siptrace", "trace_on", 1)
modparam("siptrace", "trace_flag", FLD_TRACE)
modparam("siptrace", "duplicate_uri","sip:127.0.0.1:9060")
modparam("siptrace", "hep_mode_on",1);
modparam("siptrace", "trace_to_database", 0);
#!endif
Any help?
Thanks
Reda