Hi,
I have enabled the TOPOH module with mask_callid enabled, but it's
generating a new Call-ID for a BYE which gets rejected with a 481
downstream. If I disable the TOPOH module it works as expected.
Does anyone know where I should start looking? SIP-wise the initial BYE
seems compliant.
This is Kamailio 5.5.3 on Debian 11
Thanks
Matthew
Hi,
I'm in a process of long overdue update of kamailio from 4.3 to 5.5,
after update i can not start kamailio casue:
Mar 24 07:30:13 DEV-SBC-FE1 /usr/sbin/kamailio[22768]: INFO:
carrierroute [cr_data.c:456]: add_route(): adding prefix TR, prob 1.000000
Mar 24 07:30:13 DEV-SBC-FE1 /usr/sbin/kamailio[22768]: INFO:
carrierroute [cr_data.c:469]: add_route(): found carrier and domain, now
adding route
Mar 24 07:30:13 DEV-SBC-FE1 /usr/sbin/kamailio[22768]: ERROR:
carrierroute [cr_domain.c:166]: add_route_to_tree(): cannot insert route
flags into d-trie
Mar 24 07:30:13 DEV-SBC-FE1 /usr/sbin/kamailio[22768]: ERROR: <core>
[dtrie.c:138]: dtrie_insert(): cannot insert non-numerical character
Mar 24 07:30:13 DEV-SBC-FE1 /usr/sbin/kamailio[22768]: ERROR:
carrierroute [cr_data.c:179]: reload_route_data(): could not load
routing data
Mar 24 07:30:13 DEV-SBC-FE1 /usr/sbin/kamailio[22768]: ERROR:
carrierroute [carrierroute.c:240]: mod_init(): could not prepare route data
I know that string TR is non-numeric data ;) but i have thoes routes
deep in my infrastructure logic so i just can not change them to some
numbers, is there any way i can resolve this without changeing routes in
my whole infrastrucure (almost 50 servers)?
Please help :)
--
Arek Łazarczyk
Hello
I'm running K5.5.3 and have checked the 'issues' link in github and saw nothing regarding what I am seeing. I think that there is a bug in the tm module with respect to the "tm:local-response" event route. In the "t_reply.c" file, there is a static variable called '_tm_local_response_set_lookup'. This variable is initialized at load time to zero. It is checked in the '_reply_light()' routine and will initiate a local callback from the config script if "armed". The problem as I see it is that if the callback is readied, the variable is set to one. But it is never reset.
So the practical outworking is as follows. A register is received and the request_route arms the callback. The register requires an authorization (local database sqlite). After the 401 is sent back, the callback via the module event route is called as expected. All good except that the module event route script fragment is never executed again after the first call.
I'm no expert on the tm module but I would think that somewhere in there, the variable should be reset to zero so that subsequent transactions can initiate the event route again.
thanks for any help,
Dan
Hi,
Kamailio / RTPEngine was set up on CentOS 8 running SIP to SIPS and RTP to SDES SRTP conversion. This worked as expected
Attempted to duplicate the setup on RHEL but errors were seen. These errors were present on both RHEL 7 / RHEL 8.
The errors seen were as below
kamailio -c
loading modules under config path: /usr/lib64/kamailio/modules/
0(9165) ERROR: tls [tls_init.c:611]: tls_pre_init(): Unable to set the memory allocation functions
0(9165) ERROR: tls [tls_init.c:613]: tls_pre_init(): libssl current mem functions - m: 0x7f7a77c367a0 r: 0x7f7a77c367f0 f: 0x7f7a77c36770
0(9165) ERROR: tls [tls_init.c:615]: tls_pre_init(): module mem functions - m: 0x7f7a72db7653 r: 0x7f7a72db769f f: 0x7f7a72db76fc
0(9165) ERROR: tls [tls_init.c:617]: tls_pre_init(): Be sure tls module is loaded before any other module using libssl (can be loaded first to be safe)
0(9165) ERROR: <core> [core/sr_module.c:590]: load_module(): /usr/lib64/kamailio/modules/tls.so: mod_register failed
0(9165) CRITICAL: <core> [core/cfg.y:3683]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 137, column 12-19: failed to load module
0(9165) INFO: pv [pv_shv.c:60]: shvar_init_locks(): locks array size 16
0(9165) ERROR: <core> [core/modparam.c:181]: set_mod_param_regex(): No module matching <tls> found
0(9165) CRITICAL: <core> [core/cfg.y:3686]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 249, column 72: Can't set module parameter
0(9165) ERROR: <core> [core/modparam.c:181]: set_mod_param_regex(): No module matching <tls> found
0(9165) CRITICAL: <core> [core/cfg.y:3686]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 250, column 72: Can't set module parameter
0(9165) ERROR: <core> [core/modparam.c:181]: set_mod_param_regex(): No module matching <tls> found
0(9165) CRITICAL: <core> [core/cfg.y:3686]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 251, column 68: Can't set module parameter
0(9165) ERROR: <core> [core/modparam.c:181]: set_mod_param_regex(): No module matching <tls> found
0(9165) CRITICAL: <core> [core/cfg.y:3686]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 256, column 39: Can't set module parameter
ERROR: bad config file (5 errors) (parsing code: 0)
0(9165) INFO: <core> [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized
The kamailio config was exactly the same as on the CentOS systems and started as below
/* Server ports: */
#!substdef "!SIP_PORT!5060!g"
#!substdef "!SIPS_PORT!5061!g"
/* Listen addresses */
#!substdef "!UDP_LOCAL_ADDR!udp:SERVER_IP_ADDR:SIP_PORT!g"
#!substdef "!TCP_LOCAL_ADDR!tcp:SERVER_IP_ADDR:SIPS_PORT!g"
/* Server connections: */
#!ifndef MAX_CONNECTIONS
#!define MAX_CONNECTIONS 8192
#!endif
##!define WITH_DEBUG
/* Transaction and branch flags:
FLT_ - per transaction (message) flags
FLB_ - per branch flags
*/
#!define FLT_ACC 1
#!define FLT_ACCMISSED 2
#!define FLT_ACCFAILED 3
#!define FLT_NATS 5
#!define FLT_OUT 8
#!define FLB_NATB 6
#!define FLB_NATSIPPING 7
#!define KAMAILIODBURL1 "mysql://kamailio:kamailiorw@localhost/kamailio"
#!define WITH_TLS
enable_tls=1
listen=tls:<ipaddr>:5062
####### Global Parameters #########
### LOG Levels: ALERT=-5, BUG=-4, CRIT=-3, ERR=-1, WARN=0, NOTICE=1, INFO=2, DBG=3
#!ifdef WITH_DEBUG
debug=4
log_stderror=no
#!else
debug=2
log_stderror=no
#!endif
memdbg=5
memlog=5
log_facility=LOG_LOCAL0
/* display memory usage on exit */
mem_summary=15
/* join free memory fragments */
mem_join=1
/* proxy will fork and run in daemon mode */
/* one process will be created for each network interface the proxy listens to and for each protocol (TCP/UDP), multiplied with the value of 'children' parameter */
fork=yes
children=8
listen=TCP_LOCAL_ADDR
listen=UDP_LOCAL_ADDR
/* 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
/* sip over websockets may not specify a content length header */
tcp_accept_no_cl=yes
/* buffer size used for tcp reads, limits the maximum message size (SIP, HTTP) that can be received over tcp */
tcp_rd_buf_size=65536
/* max number of tcp connections */
tcp_max_connections=MAX_CONNECTIONS
####### Modules Section ########
# set paths to location of modules
mpath="/usr/lib64/kamailio/modules/"
loadmodule "jsonrpcs.so"
loadmodule "db_mysql.so"
loadmodule "kex.so"
loadmodule "corex.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "ctl.so"
loadmodule "cfg_rpc.so"
loadmodule "acc.so"
loadmodule "dispatcher.so"
loadmodule "cfgutils.so"
loadmodule "textopsx.so"
loadmodule "nathelper.so"
loadmodule "uac.so"
loadmodule "ipops.so"
loadmodule "debugger.so"
loadmodule "exec.so"
loadmodule "avpops.so"
loadmodule "sqlops.so"
loadmodule "rtpengine.so"
loadmodule "sl.so"
loadmodule "tls.so"
# ----------------- setting module-specific parameters ---------------
# ----- usrloc params -----
# store contacts in memory only
modparam("usrloc", "db_mode", 0)
# hash size of 16,384
modparam("usrloc", "hash_size", 14)
# removes contact if ws disconnects
modparam("usrloc", "handle_lost_tcp", 1)
modparam("tm|usrloc", "xavp_contact", "ulattrs")
# ----- jsonrpcs params -----
modparam("jsonrpcs", "fifo_name", "/tmp/kamailio_jsonrpc.fifo")
modparam("jsonrpcs", "dgram_socket", "/tmp/kamailio_rpc.sock")
# ----- tm params -----
# auto-discard branches from previous serial forking leg
modparam("tm", "failure_reply_mode", 3)
# default retransmission timeout: 30sec
modparam("tm", "fr_timer", 30000)
#default invite retransmission timeout after 1xx: 120sec
modparam("tm", "fr_inv_timer", 120000)
# ----- rr params -----
# set next param to 1 to add value to ;lr param (helps with some UAs)
modparam("rr", "enable_full_lr", 0)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 0)
# ----- uac params -----
modparam("uac", "restore_mode", "none")
# ----- registrar params -----
modparam("registrar", "method_filtering", 1)
modparam("registrar", "max_contacts", 1)
# max value for expires of registrations
modparam("registrar", "max_expires", 3600)
# disable GRUU
modparam("registrar", "gruu_enabled", 0)
# ----- acc params -----
/* what special events should be accounted? */
modparam("acc", "early_media", 0)
modparam("acc", "report_ack", 0)
modparam("acc", "report_cancels", 0)
/* by default ww do not adjust the direction of the sequential requests.
if you enable this parameter, be sure the enable "append_fromtag"
in "rr" module */
modparam("acc", "detect_direction", 0)
/* account triggers (flags) */
modparam("acc", "log_flag", FLT_ACC)
modparam("acc", "log_missed_flag", FLT_ACCMISSED)
modparam("acc", "log_extra", "src_user=$fU;src_domain=$fd;src_ip=$si;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)
# ----- dispatcher params -----
modparam("dispatcher", "db_url", KAMAILIODBURL1)
modparam("dispatcher", "flags", 2)
modparam("dispatcher", "ds_ping_method", "OPTIONS")
modparam("dispatcher", "ds_ping_from", "sip:<address>.com")
modparam("dispatcher", "ds_ping_interval", 5)
modparam("dispatcher", "ds_probing_threshold", 1)
modparam("dispatcher", "ds_inactive_threshold", 1)
modparam("dispatcher", "ds_probing_mode", 3)
# ----- pv params -----
modparam("pv", "shvset", "maintenance=i:0")
modparam("pv", "shvset", "virtualIP1=i:0")
modparam("pv", "shvset", "virtualIP2=i:0")
# ----- nathelper params -----
modparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")
# Note: leaving NAT pings turned off here as nathelper is only being used for
# WebSocket connections. NAT pings are not needed as WebSockets have
# their own keep-alives.
# ----- rtpengine params -----
modparam("rtpengine", "rtpengine_sock", "udp:localhost:2223")
modparam("rtpengine", "rtpengine_sock", "udp:localhost:2223")
#modparam("rtpengine", "write_sdp_pv", "$avp(sdp)")
#modparam("rtpengine", "force_send_interface", SERVER_IP_ADDR)
#modparam("rtpengine", "setid_default", -1)
#modparam("rtpengine", "rtp_inst_pvar", "$avp(RTPENGINE)")
#modparam("rtpengine", "rtpengine_retr", 5)
#modparam("rtpengine", "queried_nodes_limit", 5)
#modparam("rtpengine", "rtpengine_allow_op", 1)
#modparam("rtpengine", "hash_table_size", MAX_CONNECTIONS)
#modparam("rtpengine", "hash_table_tout", 7200)
modparam("tls", "private_key", "<cert path>")
modparam("tls", "certificate", "<cert path>")
modparam("tls", "ca_list", "<cert path>")
# modparam("tls", "ca_list", "<cert path>")
modparam("tls", "tls_method", "TLSv1+")
####### Routing Logic ########
If load module lines for TLS are move to near the top of the config file, config will parse and non-SIPS calls will work
loadmodule "sl.so"
loadmodule "tls.so"
But logs will show
WARNING: <core> [main.c:2985]: main(): tls support enabled, but no tls engine available (forgot to load the tls module?)
WARNING: <core> [main.c:2987]: main(): disabling tls...
Presumably loading the module before configuring it just gives it default values so the latter config is ignored
Any advice on the matter would be appreciated
Thanks in advance,
Chris
Hi, all
Kamailio5.5.4
$var(s) = "a=1;b=2;c=3";
$var(s1) = $(var(s){param.value,b}); // work well
$var(s) = "a=1|b=2|c=3";
$var(s1) = $(var(s){param.value,b,|}); // work well
// but
$var(s) = "a=1,b=2,c=3";
$var(s1) = $(var(s){param.value,b,,});
ERROR: <core> [core/pvapi.c:1131]: pv_parse_spec2(): invalid parsing in [$(var(s){param.value,b,,})] at (4)
CRITICAL: <core> [core/cfg.y:3683]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 366, column 13-38: Can't get from cache: $(var(s){param.value,b,,})
how to fix this?
Thanks!
hanxiaofang
Hello, I'm running K5.5.3 and have checked the 'issues' link in github and saw nothing regarding what I am seeing. I think that there is a bug in the tm module with respect to the "tm:local-response" event route. In the "t_reply.c" file, there is a static variable called '_tm_local_response_set_lookup'. This variable is initialized at load time to zero. It is checked in the '_reply_light()' routine and will initiate a local callback from the config script if "armed". The problem as I see it is that if the callback is readied, the variable is set to one. But it is never reset.So the practical outworking is as follows. A register is received and the request_route arms the callback. The register requires and authorization. After the 401 is sent back, the callback via the module event route is called. All good except that the module event route script fragment is never executed again after the first call.I'm no expert on the tm module but I would think that somewhere in there, the variable should be reset to zero so that subsequent transactions can initiate the event route.
thanks for any help,Dan
Dear all,
My use case is :
I defined a username = 112 (for emergency call)
This username doesn't exist in subscribers table and unavailable in location table.
The idea is when Sopftphone1 call the group = 112 then Kamailio will forward the call to a group using SERIAL FORKING.
=> Softphone 1 -> Sends INVITE to 112 -> Kamailio -> FORWARD TO SERIAL FORKING (4x softphone all registered and in location table). The q priority could be hybrid that means 2x softphone could have same priority.
My issues :
- the q priority forced for each softphone is not taking into account.
- the first branch created when send INVITE to 112 is still available.
My setup
Kamailio is behind a NAT.
Kamailio version :
sipsecure@kamailio:/$ kamailio -version
version: kamailio 5.5.4 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 10.2.1
Kamailio.cfg
# ----- tm params -----
# auto-discard branches from previous serial forking leg
modparam("tm", "failure_reply_mode", 3)
# default retransmission timeout: 5sec
modparam("tm", "fr_timer", 5000)
# default invite retransmission timeout after 1xx: 10sec
modparam("tm", "fr_inv_timer", 10000)
# This is the name of an XAVP that the t_load_contacts() function uses to store contacts of the destination set and that t_next_contacts() function uses to restore those contacts.
modparam("tm", "contacts_avp", "tm_contacts")
modparam("tm", "contact_flows_avp", "tm_contact_flows")
# modparam("tm|usrloc", "xavp_contact", "tm_contacts")
# ----- rr params -----
# set next param to 1 to add value to ;lr param (helps with some UAs)
modparam("rr", "enable_full_lr", 0)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 0) route[INVITE]{
route(THREAD_CHECK);
route(AUTH);
route(RECORD_ROUTE);
setflag(FLT_ACC);
switch($tU)
{
case "112":
xlog("MY_SEVERITY"," -- Calling Group Serial");
route(FORK_SERIAL);
break;
case "113":
xlog("MY_SEVERITY"," -- Calling Group Parralelle");
route(FORK_PARALLEL);
break;
default:
xlog("MY_SEVERITY"," -- Calling Someone");
route(LOCATION);
route(RELAY);
break;
}
exit;
}
route[FORK_SERIAL]{
t_on_reply("MANAGE_REPLY");
#!ifndef WITH_BRIDGE_ON_FAIL
setbflag(FLB_BRIDGE);
#!endif
route(IPV4V6);
route(NATMANAGE);
$var(uri1)="sip:9919995@192.168.1.41";
$var(uri2)="sip:9919994@192.168.1.41";
$var(uri3)="sip:9919991@192.168.1.41";
$var(uri4)="sip:9919997@192.168.1.41";
lookup("location","$var(uri4)");
append_branch("$ru","0.2");
lookup("location","$var(uri1)");
append_branch("$ru","0.8");
lookup("location","$var(uri2)");
append_branch("$ru","0.5");
lookup("location","$var(uri3)");
append_branch("$ru","0.5");
t_load_contacts();
t_next_contacts();
t_on_failure("SERIAL");
#!ifdef WITH_SIPSECURE_DEBUG
xlog("MY_SEVERITY"," ROUTE_SERIAL : Relaying \n");
#!endif
#Relay (aka Forward) the request
t_relay();
break;
}
failure_route[SERIAL]{
xlog("MY_SEVERITY","At failure route - Trying next destination");
if (!t_next_contacts()) {
send_reply("408","Nobody available");
exit;
}
t_on_failure("SERIAL");
t_relay();
}
Any highlight will be welcome.
Best Regards,
--
Youssef
If I set $ru in config file and then print $ru to log, the new value is
printed. If I do the same with $fu, the old value is printed.
I haven't found in Pseudo-Variables Wiki any documentation about this.
Does it exist somewhere else?
-- Juha