hi,
i am trying to deploy a way to gracefuly stop kamailio.
the goal is to stop new incoming calls, wait for all active calls to end (i
guess dialog module is a must...)
and then, shutting down kamailio.....
any ideas will be great....
Hello,
keep the mailing list cc-ed, private messages from public mailing list
discussions are going to be discarded.
See the comments inline.
On 11/23/11 12:20 PM, Iurii Andamasov wrote:
> Hello Daniel,
> i
> 23.11.2011, в 8:43, Daniel-Constantin Mierla написал(а):
>
>> Hello,
>>
>> On 11/23/11 4:02 AM, Iurii Andamasov wrote:
>>> Hello list.
>>> First of all sorry for dump question, i'm pretty new to kamailio so i hope someone point me in right direction
>>>
>>> currently i have one sip device which can handle sip request only from one ip,
>>> my goal is to put kamailio in front of it so i can proxy requests from several ips
>>>
>>> i added this to conf
>>>
>>> route{
>>> if ( src_ip == 10.46.1.121 || src_ip == 10.46.1.122 ) {
>>> if(method == "INVITE") {
>>> $rd="10.46.29.10";
>>> t_relay();
>>> }
>>> }
>>>
>>> and calls seems connecting but signaling is completely broken
>>>
>>> i understand that i'm doing something wrong, but can't get what is wrong
>> can you explain what is broken and what you would expect to happen?
> seems that occurs timeouts, from your next message i understand why,
> what i need it just to pass call through kamailio from that 2 ips
If you need to route all requests within a call through kamailio, then
you need to use loose routing (see rr module).
Maybe it would be easier for you to start with an existing example of
config, if the default config is too big to understand, maybe the one
from dispatcher is simpler:
http://kamailio.org/docs/modules/stable/modules_k/dispatcher.html#id2523004
It has the parts of routing requests within dialog, you need to replace
the part that uses dispatcher module with your forwarding to a specific
ip (or use dispatcher and have that ip as single destination there).
Before line 'route(DISPATCH);' add the condition to deny INVITEs that
don't match the trusted source ips:
if ( ! (src_ip == 10.46.1.121 || src_ip == 10.46.1.122 )) {
send_reply("403", "Forbidden");
exit;
}
Cheers,
Daniel
--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Dec 5-8, Berlin: http://asipto.com/u/kathttp://linkedin.com/in/miconda -- http://twitter.com/miconda
Siremis v2.1.0 has been released - this is an update to previous release
v2.0.0, bringing several enhancements and new web pages to manage PUA
and RLS. It is still compatible with Kamailio v3.1.x, the last of this
kind, next one to be out in the near future will be compatible with
Kamailio v3.2.x.
You can find the news about this release, including links to download,
screenshots and demos, at:
* http://siremis.asipto.com/2011/11/23/siremis-v2-1-0-released/
Alternative download site (tarball or git pull) is from sourceforge project:
* http://sourceforge.net/projects/siremis/
Regards,
Ramona
PS. Siremis v2.1.0 is working for most of the components with Kamailio
3.2.0, just the few that changed the database structure may not be fully
functional (e.g., the modules with tables that have new columns, see
http://www.kamailio.org/wiki/install/upgrade/3.1.x-to-3.2.0#sql_commands).
Hello,
I plan to package v3.2.1 after mid of next week (most probably on
Thursday) -- it is about 1 month and a half since 3.2.0 was released and
branch 3.2 accumulated a bunch of patches.
Anyone having comments about it?
Cheers,
Daniel
--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Dec 5-8, Berlin: http://asipto.com/u/kathttp://linkedin.com/in/miconda -- http://twitter.com/miconda
Hi All,
Kamailio is resetting when we do TLS renegotiation dos attack using the
tool available at http://www.thc.org/thc-ssl-dos/.
Anybody looked at this issue? How we could resolve it. Any idea?
The core generated for 3 pid's as below
Pid 1:
Core was generated by `/usr/sbin/kamailio -u swrun -g sw -m 120 -f
/etc/kamailio/kamailio.cfg'.
Program terminated with signal 11, Segmentation fault.
#0 atomic_inc_int () at atomic/atomic_x86.h:225
(gdb) bt
#0 atomic_inc_int () at atomic/atomic_x86.h:225
#1 cfg_update_local () at cfg/cfg_struct.h:228
#2 timer_main () at timer.c:994
#3 0x080b0579 in main_loop () at main.c:1632
#4 0x080b1be4 in main (argc=9, argv=0xbfd61e54) at main.c:2446
Pid 2:
Core was generated by `/usr/sbin/kamailio -u swrun -g sw -m 120 -f
/etc/kamailio/kamailio.cfg'.
Program terminated with signal 11, Segmentation fault.
#0 0x0819bfe8 in qm_insert_free (qm=0xaf6c5000, p=0xb05eec30,
file=0xb6fb4140 "tls: tls_init.c", func=0xb6fb4ce0 "ser_free", line=296)
at mem/q_malloc.c:184
184 if (frag->size <= f->size) break;
(gdb) bt
#0 0x0819bfe8 in qm_insert_free (qm=0xaf6c5000, p=0xb05eec30,
file=0xb6fb4140 "tls: tls_init.c", func=0xb6fb4ce0 "ser_free", line=296)
at mem/q_malloc.c:184
#1 qm_free (qm=0xaf6c5000, p=0xb05eec30, file=0xb6fb4140 "tls:
tls_init.c", func=0xb6fb4ce0 "ser_free", line=296) at mem/q_malloc.c:518
#2 0xb6f95404 in ser_free (ptr=0xb05eec30) at tls_init.c:296
#3 0xb732e9ba in CRYPTO_free (str=0xb05eec30) at mem.c:391
#4 0xb7330bee in int_new_ex_data (class_index=5, obj=0xbfd414f4,
ad=0xbfd41574) at ex_data.c:440
#5 0xb7330443 in CRYPTO_new_ex_data (class_index=5, obj=0xbfd414f4,
ad=0xbfd41574) at ex_data.c:575
#6 0xb73dfde3 in X509_STORE_CTX_init (ctx=0xbfd414f4, store=0xafd8b3d0,
x509=0xafe08ff0, chain=0x0) at x509_vfy.c:2114
#7 0xb74b0f31 in ssl3_output_cert_chain (s=0xb0553a10, x=0xafe08ff0) at
s3_both.c:349
#8 0xb74a4728 in ssl3_send_server_certificate (s=0xb0553a10) at
s3_srvr.c:3034
#9 0xb74a5879 in ssl3_accept (s=0xb0553a10) at s3_srvr.c:353
#10 0xb74afa8f in ssl3_read_bytes (s=0xb0553a10, type=23, buf=0xb0ad44ec
"", len=4095, peek=0) at s3_pkt.c:1266
#11 0xb74ac9c9 in ssl3_read_internal (s=0xb0553a10, buf=0xb0ad44ec,
len=4095, peek=0) at s3_lib.c:3265
#12 0xb74c24a9 in SSL_read (s=0xb0553a10, buf=0xb0ad44ec, num=4095) at
ssl_lib.c:954
#13 0xb6fad1c3 in tls_read_f (c=0xb0ad431c, flags=0xbfd619c4) at
tls_server.c:1058
#14 0x08171c0e in tcp_read_headers (c=0xb0ad431c, read_flags=0xbfd619c4) at
tcp_read.c:406
#15 0x08171db8 in tcp_read_req (con=0xb0ad431c, bytes_read=0xbfd619cc,
read_flags=0xbfd619c4) at tcp_read.c:885
#16 0x08172f67 in handle_io (fm=<value optimized out>, events=1, idx=<value
optimized out>) at tcp_read.c:1234
#17 0x0817583b in io_wait_loop_epoll (unix_sock=89) at io_wait.h:1092
#18 tcp_receive_loop (unix_sock=89) at tcp_read.c:1345
#19 0x0816e2e9 in tcp_init_children () at tcp_main.c:4867
#20 0x080affb1 in main_loop () at main.c:1646
#21 0x080b1be4 in main (argc=9, argv=0xbfd61e54) at main.c:2446
Pid 3:
Core was generated by `/usr/sbin/kamailio -u swrun -g sw -m 120 -f
/etc/kamailio/kamailio.cfg'.
Program terminated with signal 11, Segmentation fault.
#0 0xb76c9e7c in memmove () from /lib/libc.so.6
(gdb) bt
#0 0xb76c9e7c in memmove () from /lib/libc.so.6
#1 0x081724e7 in tcp_read_req (con=0xb022c8f0, bytes_read=0xbfd619cc,
read_flags=0xbfd619c4) at tcp_read.c:1026
#2 0x08172f67 in handle_io (fm=<value optimized out>, events=1, idx=<value
optimized out>) at tcp_read.c:1234
#3 0x0817583b in io_wait_loop_epoll (unix_sock=93) at io_wait.h:1092
#4 tcp_receive_loop (unix_sock=93) at tcp_read.c:1345
#5 0x0816e2e9 in tcp_init_children () at tcp_main.c:4867
#6 0x080affb1 in main_loop () at main.c:1646
#7 0x080b1be4 in main (argc=9, argv=0xbfd61e54) at main.c:2446
Hello list.
I’m having some issues with the Kamailio versión 3.2.0.
I want to ask if someone could give some hints how to optimize the
performance of my kamailio server. For some reason and from time to time
the kamailio process start to answer slower than usual, making calls fail
and register expires. I’m still unable to detect the problem, but I want
to know of maybe i´m running my kamailio not under the best conditions.
This is part of my configuration :
#!KAMAILIO
#!define FLT_NATS 5
#!define FLB_NATB 6
#!define FLB_NATSIPPING 7
# ----------- global configuration parameters ------------------------
debug=2 # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=no # (cmd line: -E)
log_facility=LOG_LOCAL0
children=16
port=5060
memdbg=9
memlog=9
listen=udp:10.0.10:5060
disable_tcp=yes
server_signature=0
port=5060
# ----------------- setting module-specific parameters ---------------
## modparam("registrar", "received_avp", "$avp(s:rcv)")
modparam("usrloc", "db_mode", 1)
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "password_column", "password")
modparam("rr", "enable_full_lr", 1)
modparam("auth_db|permissions|uri_db|usrloc","db_url","mysql://openser:openserrw@localhost
/openser")
modparam("permissions", "db_mode", 1)
modparam("permissions", "trusted_table", "trusted")
modparam("avpops", "db_url", "mysql://openser:openserrw@localhost/openser")
modparam("avpops", "avp_table", "usr_preferences")
modparam("domain", "db_mode", 1)
# ----- nathelper params -----
modparam("nathelper", "natping_interval", 20)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "sipping_bflag", FLB_NATSIPPING)
modparam("nathelper", "sipping_from", "sip:pinger@kamailio.org")
# params needed for NAT traversal in other modules
modparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")
modparam("usrloc", "nat_bflag", FLB_NATB)
modparam("nathelper","natping_interval", 20)
## modparam("nathelper","received_avp", "$avp(i:42)")
modparam("mediaproxy","mediaproxy_socket",
"/var/run/mediaproxy/dispatcher.sock")
modparam("mediaproxy", "signaling_ip_avp", "$avp(s:signaling_ip)")
modparam("registrar|nathelper", "received_avp", "$avp(i:80)")
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
#modparam("tm", "fr_timer", 3)
# ------ dialog params -------
modparam("dialog", "dlg_flag", 4)
modparam("dialog", "profiles_with_value", "caller")
# ------ pike params --------
modparam("pike", "sampling_time_unit", 2)
modparam("pike", "reqs_density_per_unit", 25)
modparam("pike", "remove_latency", 4)
# ------ rr params --------
modparam("rr", "enable_full_lr", 1)
# ----- misc_radius params -----
modparam("misc_radius", "radius_config",
"/usr/local/etc/radiusclient-ng/radiusclient.conf")
modparam("misc_radius", "caller_service_type", 18)
modparam("misc_radius", "callee_service_type", 19)
modparam("misc_radius", "caller_extra", "Called-Station-Id=$ru")
modparam("misc_radius", "callee_extra", "Called-Station-Id=$fu")
# ---- htable param ---------
modparam("htable", "htable", "a=>size=8;")
modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")
modparam("rtimer", "timer", "name=tst;interval=300;mode=1;")
modparam("rtimer", "exec", "timer=tst;route=STATS")
modparam("sqlops","sqlcon",
"ca=>mysql://openser:openserrw@localhost/openser")
#------ uac ---------------
modparam("uac","rr_store_param","my_param")
modparam("uac","from_restore_mode","auto")
modparam("uac","auth_realm_avp","$avp(i:10)")
modparam("uac","auth_username_avp","$avp(i:11)")
modparam("uac","auth_password_avp","$avp(i:12)")
Beside of this I have syslogd in asyn mode…
This is the info of the kamailio –V
version: kamailio 3.2.0 (x86_64/linux) 639f0a
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
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: 639f0a
compiled on 11:35:43 Oct 28 2011 with gcc 4.5.1
I’m using pike to check flood alerts, but I have a white list stored in the
“user_preference” table :
I’m using it like this :
route[REQINIT] {
# flood dection from same IP and traffic ban for a while
# be sure you exclude checking trusted peers, such as pstn gateways
# - local host excluded (e.g., loop to self)
if( !(avp_db_load("pike", "$avp(ip_origen)") &&
avp_check("$avp(ip_origen)", "eq/$src_ip/gi")) )
#+---------+----------+--------+-----------+----------------+------+---------------------+
#| uuid | username | domain | attribute | value | type |
modified |
#+---------+----------+--------+-----------+----------------+------+---------------------+
#| pike | | | ip_origen | 10.0.0.44 | 0 |
2008-01-04 13:24:14 |
#| pike | | | ip_origen | 10.0.0.66 | 0 |
2008-01-04 17:28:59 |
{
if($sht(ipban=>$si)!=$null)
{
# ip is already blocked
xdbg("request from blocked IP - $rm from $fu
(IP:$si:$sp)\n");
exit;
}
if (!pike_check_req())
{
xlog("L_ALERT","ALERT: pike blocking $rm from $fu
(IP:$si:$sp)\n");
xlog("L_INFO","ALERT: pike blocking from $si\n");
$sht(ipban=>$si) = 1;
exit;
}
}
Is this check method too slow? Or intensive in mysql access request??
Hope someone can help me here.
Thanks in advance..
Regards,
*Ricardo Martinez.-*
Hello list.
First of all sorry for dump question, i'm pretty new to kamailio so i hope someone point me in right direction
currently i have one sip device which can handle sip request only from one ip,
my goal is to put kamailio in front of it so i can proxy requests from several ips
i added this to conf
route{
if ( src_ip == 10.46.1.121 || src_ip == 10.46.1.122 ) {
if(method == "INVITE") {
$rd="10.46.29.10";
t_relay();
}
}
and calls seems connecting but signaling is completely broken
i understand that i'm doing something wrong, but can't get what is wrong
Please point me to solution
Thanks
Hi List!
I'm running Kamailio for about 1 year without any serious problems.
When it works with UDP only, it runs perfectly well for us. Without any
major issues.
But now we have a customer who wants to connect Lync to our network.
Unfortunately, Lync does not support UDP for SIP signalling, so we tried
to teach kamailio to send SIP messages via TCP.
And getting strange error:
10(36629) DEBUG: tm [t_reply.c:659]: DEBUG: reply sent out.
buf=0x832c7ac: SIP/2.0 100 trying -..., shmem=0x28d97c7c: SIP/2.0 100
trying -
10(36629) DEBUG: tm [t_reply.c:669]: DEBUG: _reply_light: finished
10(36629) DEBUG: <core> [forward.c:213]: DEBUG: get_out_socket: socket
determined: 0x833ddc0
10(36629) DEBUG: <core> [msg_translator.c:457]: clen_builder:
content-length: 553 (553)
10(36629) DEBUG: <core> [msg_translator.c:204]:
check_via_address(10.200.245.200, 10.200.245.200, 0)
10(36629) DEBUG: <core> [tcp_main.c:1824]: tcp_send: no open tcp
connection found, opening new one
10(36629) DEBUG: <core> [ip_addr.c:247]: tcpconn_new: new tcp
connection: 10.198.3.100
10(36629) DEBUG: <core> [tcp_main.c:1081]: tcpconn_new: on port 5060, type 2
10(36629) DEBUG: <core> [tcp_main.c:1382]: tcpconn_add: hashes: 0:0:0, 1
10(36629) ERROR: <core> [tcp_main.c:2748]: connect 10.198.3.100:5060
failed Socket is not connected
10(36629) ERROR: <core> [tcp_main.c:2754]: 10.198.3.100:5060: connect &
send for 0x28d988ac failed: Socket is not connected (57)
10(36629) DEBUG: <core> [tcp_main.c:2955]: tcpconn_chld_put: destroying
connection 0x28d988ac (1, -1) flags 0060
10(36629) ERROR: tm [../../forward.h:170]: msg_send: ERROR: tcp_send failed
We tested two different variants: one when defined Lync in dr_gateways
table as 10.198.3.100:5068;transport=tcp
And then, tried global options
udp_mtu=1300
udp_mtu_try_proto=TCP
As soon as these options were enabled, all other gateways became
unreachable with the same error as above.
Could you please to point me out, where I'm wrong?
fbsd-kam# /usr/local/sbin/kamailio -V
version: kamailio 3.1.5 (i386/freebsd) ec672a
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
DBG_QM_MALLOC, 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, PKG_SIZE 4MB
poll method support: poll, select, kqueue.
id: ec672a
compiled on 11:02:58 Nov 15 2011 with gcc 4.2.1
FreeBSD fbsd-kam.dprs-consulting.com 8.2-RELEASE-p2 FreeBSD
8.2-RELEASE-p2 #0: Sun Jul 3 17:49:13 GMT 2011
root@fbsd-kam.dprs-consulting.com:/usr/obj/usr/src/sys/GENERIC i386
Routing script could be sent on request.
Thank you very much!
WBR
Dimon
Hi,
How can I set a filter for receiving 5xx messages, i.e. how can I parse 503
messages received by the proxy?
I have tried the following and none works:
t_check_status("503")
is_method("503")
Thanks,
R