Hello,
I'm exploring using Kamailio as a dumb edge proxy, and as such I want to
keep things as lean as possible.
In some scenarios I would like the "core" proxies to signal to the edge
that a request should be dropped without a response. This could be with a
custom header in the reply or perhaps a 444 response ( nginx uses this
internally to drop a request without responding )
I have discovered that if I drop the response in the reply_route, the edge
proxy doesn't send an ACK and keeps retransmitting the request until it
times out, at which point it sends a 408 back to the UA.
Is there any way to ACK the response from the core and destroy the
transaction?
Thanks
Matthew
Hi,
I have configured Kamailio to register a SIP user over websocket. SIP users
are getting registered over webphone like JSSIP fine but not able to
establish the call scenario below.
>From Twilio Trunk - INVITE - KAMAILIO - ASTERISK - play hello world - Dial
SIP user 101@Kamailio_IP - Rings 101 and Answer - Hangup.
Here,
101 is registered with Kamailio IP, and I am sending a call from Twilio SIP
trunk to Kamailio server IP.
Asterisk is on port 5080 and Kamailio is on port 5090 both are on the same
host 45.118.163.244.
This above call scenario is NOT working with Webphones registered via
JSSIP. I think the second call leg from Asterisk -> Kamailio is not getting
set up properly and ACK is not getting confirmed here, call connects for
some time and no voice transmits and then disconnects.
The same call scenario is working with users registered at Softphone like
Zoiper perfectly fine. No idea why it is not working with a webphone.
I have attached kamailio.cfg, Kamailio log and Asterisk's pjsip logs here.
So, please guide me on this as soon as possible.
--
Thanks & Regards,
*Ankit Jayswal* | Specialist - Software Development
i am using dialog and topos module.
but i have an issue i think with topos module.
When topos module is disabled all the call flow works well but when i enable topos module i have this weird behaviour :
after Caller sends BYE and complete the call , i receive later a BYE Request issued by the dialog module towards Caller and Callee.
Does anyone already had that issue ?
modparam("dialog", "enable_stats", 1)
modparam("dialog", "hash_size", 1024)
modparam("dialog", "rr_param", "oovdlg")
modparam("dialog", "dlg_match_mode", 1)
modparam("dialog", "db_mode", 0)
modparam("dialog", "db_update_period", 30)
modparam("dialog", "wait_ack", 1)
modparam("dialog", "ka_timer", 10)
modparam("dialog", "ka_interval", 30)
modparam("dialog", "profiles_with_value", "concurrent_calls")
modparam("dialog", "end_timeout", 180)
modparam("dialog", "default_timeout", 3600)
modparam("dialog", "noack_timeout", 90)
modparam("dialog", "early_timeout", 300)
modparam("dialog", "dlg_extra_hdrs", "X-OOV-Hint: Dlg-hit\r\n")
modparam("db_text", "db_mode", 0)
modparam("db_text", "emptystring", 0)
modparam("db_text", "file_buffer_size", 8192)
modparam("db_text", "max_result_rows", 1000)
modparam("topos", "storage", "db")
modparam("topos", "db_url", "text:///home/sbc/database")
modparam("topos", "mask_callid", 0)
modparam("topos", "sanity_checks", 0)
modparam("topos", "contact_mode", 0)
Daniel,
In a recent thread you stated the following regarding DMQ compatibility between versions:
"if you do dmq replication between kamailio systems running different major versions, then it is likely to get memory leaks due to replication of data and most probably cannot be fixed. This is because internal structures of modules (also dmq commands) can change, practically what an instance does is not ensured to happen on the other instance. Just for example, from my mind, htable got some changes during past releases, dmq also has significant enhancements by getting support for more transport protocols."
Is it possible to get a bit more clarification on this, particularly as it relates to DMQ_USRLOC? I'm hoping to do rolling updates, but don't want to end up in a situation where I've caused myself more problems than I've solved.
Ben Kaufman
Caller <--> (internal_IP) Kamailio (external_IP) <---> Callee
I have this set up of kamailio with 2 interfaces.
i use topos module for topology hiding and what i want to do is to
send external_IP in Contact Header of request relayed to Callee and internal_IP
in Contact Header of response relayed to Caller.
i noticed that :
when i use topos module with contact_mode to 0
all Record-Route and Caller Via Header are removed and thats great.
but i dont find way to put 2 different ip addresses in Request and Response Contact Header?
when i use contact_mode to 2 Record-Route and Caller Via Header are not anymore removed thats bad for
topology hiding. And its seems we can not use $xavu(_tps_=>contact_host) parameter of module
to put 2 different ip addresses in Request and Response Contact Header.
What i want is :
- remove all Record-Route and Caller Via Header for request like when contact_mode to 0
- and put 2 different ip addresses in Request and Response Contact Header
is it possible to achieve it ?
Thanks.
Hi:
I have a 5.2 version of Kamailio running and I was thinking to get it
upgraded to the 5.4 branch. The 5.2 is working well but I have heard the
5.4 is a bit more stable. Thus the question becomes, is it worth the
risk to upgrade and what should I look out for.
Thanks.
Kevin
Hi!
The documentation on the DMQ support in the dialog module is a bit short, so I will ask here for clarifications:
If I want to enable a rough limit on concurrent calls - will all servers share a $DLG_count ?
Will get_profile_size() return the number of dialogs belonging to a profile on ALL servers?
Thank you!
/Olle
Hello,
I need some help in creating a stateless failover balancer for two asterisk servers using kamailio. I followed in the steps of an old project here: https://txlab.wordpress.com/tag/xlab1/
Kamailio is running in a multihomed host, with public ip facing the internet and private ip facing the asterisk servers.
I have partial issues with nat traversal when the external device is also behind nat. All works when the device initates a call/dialog, however when the asterisk server tries to send an "OPTIONS" keep alive to the end device, Kamailio receives the packet from asterisk but tries to send it to the private IP address of the device instead of the public ip:port. Same goes for calls.
My kamailio.cfg is below. I am missing something obvious here, but can't find it.
Thanks
=== CUT====
#!KAMAILIO
################################################################
#
# This is a front-end SIP proxy configuration for the xlab1 project
# See for more details: https://txlab.wordpress.com/tag/xlab1/
# The configuration requires Kamailio version 3.3.x
#
# This work is licensed under a Creative Commons Attribution 3.0 License
# Author: Stanislav Sinyagin <ssinaygin(a)k-open.com>
#
################################################################
#!define WITH_DEBUG
####### Defined Values #########
#### define DBURL "text:///opt/sipfe/etc/kamailio_db"
#!define DBURL "text:///etc/kamailio/kamailio_db"
#!define BACKEND_NET4 10.10.10.0/24
#!define BACKEND_NET6 2a02:200:8:100::/64
####### Global Parameters #########
#!ifdef WITH_DEBUG
debug=2
log_stderror=yes
#!else
debug=1
log_stderror=no
#!endif
memdbg=5
memlog=5
log_facility=LOG_LOCAL0
fork=yes
children=2
auto_aliases=no
#listen=udp:195.x.x.78:5060
# to avoid simple attacks, use unconventional port
#port=5060
# this makes it listen on all ipv6 addresses
auto_bind_ipv6=0
dns_try_ipv6=no
# let kamailio choose the right source IP address
mhomed=3
# life time of TCP connection when there is no traffic
# - a bit higher than registration expires to cope with UA behind NAT
tcp_connection_lifetime=3605
## Hardening
sip_warning=0
server_signature=no
user_agent_header="User-Agent: Kamailio Failover Balancer"
####### Modules Section ########
## NOTE:
## mpath="/opt/sipfe/lib64/kamailio/modules_k/:/opt/sipfe/lib64/kamailio/modules/"
loadmodule "db_text.so"
loadmodule "jsonrpcs.so"
#loadmodule "mi_fifo.so"
loadmodule "tm.so"
loadmodule "kex.so"
loadmodule "sl.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "maxfwd.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "ctl.so"
loadmodule "cfg_rpc.so"
#loadmodule "mi_rpc.so"
loadmodule "path.so"
loadmodule "domain.so"
loadmodule "dispatcher.so"
loadmodule "nathelper.so"
loadmodule "rtpproxy.so"
#!ifdef WITH_DEBUG
loadmodule "debugger.so"
#!endif
# ----------------- setting module-specific parameters ---------------
#modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
# add value to ;lr param to cope with most of the UAs
modparam("rr", "enable_full_lr", 1)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 0)
modparam("nathelper", "received_avp", "$avp(RECEIVED)")
modparam("nathelper", "nortpproxy_str", "a=sdpmangled:yes\r\n")
modparam("path", "use_received", 1)
modparam("domain", "db_url", DBURL)
modparam("dispatcher", "db_url", DBURL)
modparam("dispatcher", "table_name", "dispatcher")
modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:22222")
#modparam("rtpproxy", "rtpproxy_sock", "unix:/var/run/rtpproxy/rtpproxy.sock")
#!ifdef WITH_DEBUG
# ----- debugger params -----
modparam("debugger", "cfgtrace", 1)
#!endif
####### Routing Logic ########
route {
if (!sanity_check()) {
exit;
}
if ( !mf_process_maxfwd_header("10") )
{
sl_send_reply("483","To Many Hops");
xlog("L_NOTICE", "$si $rm $ru -- too many hops\n");
exit;
}
if (af==INET)
{
force_rport();
if (src_ip != BACKEND_NET4)
{
# SIP request packet client->backend
if( !loose_route() )
{
if (!lookup_domain("$td", "dattr_")) {
xlog("L_ERR", "$si $rm $ru -- domain \"$td\" is not " +
"found in domain table\n");
drop();
}
if (!defined $avp(dattr_routeset))
{
xlog("L_ERR",
"$si $rm $ru -- attribute \"routeset\" is " +
"undefined for domain $td\n");
drop();
}
if( !ds_select_dst(4000 + $avp(dattr_routeset), "1") )
{
drop();
}
}
if (nat_uac_test("19")) {
xlog("L_INFO", "Routing NAT in-dialog $rm from $fu to $du\n");
if (method=="REGISTER") {
fix_nated_register();
} else {
fix_nated_contact();
}
}
add_path_received();
#rtpproxy_manage("cwei");
rtpproxy_manage("cw");
record_route();
}
else
{
# SIP request packet backend->client
# Invites from backend contain Route field and it should be used
# to reach the registered client
loose_route();
#rtpproxy_manage("cwie");
rtpproxy_manage("cw");
record_route();
}
}
else
{
# IPv6: no NAT traversal, just pure routing
if (src_ip != BACKEND_NET6)
{
# SIP request packet client->backend
if( !loose_route() )
{
if (!lookup_domain("$td", "dattr_")) {
xlog("L_ERR", "$si $rm $ru -- domain \"$td\" is not " +
"found in domain table\n");
drop();
}
if (!defined $avp(dattr_routeset))
{
xlog("L_ERR",
"$si $rm $ru -- attribute \"routeset\" is " +
"undefined for domain $td\n");
drop();
}
if( !ds_select_dst(6000 + $avp(dattr_routeset), "1") )
{
drop();
}
}
add_path_received();
record_route();
}
else
{
# SIP request packet backend->client
record_route();
}
}
forward();
}
onreply_route {
if (af==INET)
{
if(src_ip != BACKEND_NET4)
{
# SIP reply packet client->backend
#rtpproxy_manage("cwie");
rtpproxy_manage("cw");
fix_nated_contact();
}
else
{
# SIP reply packet backend->client
#rtpproxy_manage("cwei");
rtpproxy_manage("cw");
}
}
return(1);
}
# Local Variables:
# mode: sh
# sh-indent-after-if: 0
# indent-tabs-mode: nil
# tab-width: 4
# End:
====CUT=====
Dear
I am tying to monitor the kamailio with "kamctl monitor" and I got this error.
-e [cycle #: 1; if constant make sure server lives]
-e Kamailio Runtime Details:
kamailio 5.5.4 (x86_64/linux)
now: Wed Mar 16 12:44:43 2022
up_since: Wed Mar 16 12:39:51 2022
uptime: 292
-e Transaction Statistics:
/usr/sbin/kamctl: 245: column: not found
-e Stateless Server Statistics:
/usr/sbin/kamctl: 259: column: not found
-e UsrLoc Statistics:
/usr/sbin/kamctl: 273: column: not found
-e Core Statistics:
/usr/sbin/kamctl: 287: column: not found
-e Shared Memory Statistics:
/usr/sbin/kamctl: 301: column: not foundAny idea
Best Regards
--
Youssef BOUJRAF