Hi there!
I'm using Kamailio 4.4.3, and I add this code to my Kamailio:
event_route[usrloc:contact-expired] {
xlog("L_INFO", "EXPIRED CONTACT START\n");
xlog("L_INFO", "EXPIRED CONTACT for $ulc(exp=>aor)\n");
xlog("L_INFO", "EXPIRED CONTACT END\n");
}
I can't see this entries in the log.
I read many times the docs and code, but I don't understand why it's not
working.
I have two phone with 60 and 300 expiry seconds, if then expire, when
it's event_route[usrloc:contact-expired] triggered?
Why this event route it's named as usrloc but it's documented in
registrar module?
I need to provide more info about?
Thank you very much.
Hi,
I've run into an issue with handling reinvites in async task
workers--which I need to do in order to introduce a small delay to avoid
a UA race condition--in which some state that is necessary for
rtpengine_manage() to do the right thing seems to be lost.
Specifically, if I do this:
--
loadmodule "mqueue"
loadmodule "rtimer"
...
modparam("rtimer", "timer", "name=reinvite_q1;interval=10000u;mode=1;")
modparam("rtimer", "exec", "timer=reinvite_q1;route=REINVITE_DEQUEUE")
modparam("mqueue", "mqueue", "name=reinvite_q");
...
route {
...
if(has_totag()) {
if(loose_route()) {
...
if(is_method("INVITE")) {
if(!t_suspend()) {
sl_send_reply("500", "Server Internal Error");
exit;
}
mq_add("reinvite_q", "$T(id_index):$T(id_label)", "");
} else
route(IN_DLG_REQ);
exit;
}
...
}
route[REINVITE_DEQUEUE] {
while(mq_fetch("reinvite_q")) {
$var(id) = $(mqk(reinvite_q){s.select,0,:}{s.int});
$var(label) = $(mqk(reinvite_q){s.select,1,:}{s.int});
t_continue("$var(id)", "$var(label)", "IN_DLG_REQ");
}
}
route[IN_DLG_REQ] {
handle_ruri_alias();
if(is_method("BYE"))
rtpengine_manage();
else if(is_method("INVITE") && sdp_content())
rtpengine_manage("replace-origin replace-session-connection ICE=remove")
t_on_reply("MAIN_REPLY");
if(!t_relay())
sl_reply_error();
}
onreply_route[MAIN_REPLY] {
if(is_method("INVITE") && sdp_content())
rtpengine_manage("replace-origin replace-session-connection ICE=remove");
}
--
What I find is that if I generate a reinvite from either side,
rtpengine_manage() passes through the SDP offer in the reinvite
unadulterated, although the answer returns properly adulterated by
RTPEngine.
The same thing occurs if I use 'async', which as I gather is just a
wrapper of convenience around t_suspend/t_continue() anyway. That module
won't do for my purposes because I need a millisecond-level delay
resolution rather than second-level, anyhow.
Anyway, surely enough, this is because the execution context is one that
insinuates a stream deletion. When the reinvite offer comes across and I
call rtpengine_manage(), the command sent is 'delete':
--
Jan 14 20:24:23 staccato.evaristesys.com rtpengine[33830]: INFO: [c94347dcf92e7ccc10dee84c4e0d1c8a]: Received command 'delete' from 209.51.167.66:39788
--
The RTPEngine module documentation actually warns about this:
https://kamailio.org/docs/modules/5.2.x/modules/rtpengine.html#rtpengine.f.…
But this insight is buried in the fourth bullet point:
"If BYE or CANCEL, or called within a FAILURE_ROUTE[], then call
rtpengine_delete(). Be careful with calling this function after
resuming a suspended transaction (e.g., after t_continue()),
because the context of executed route is FAILURE ROUTE (in other
words, rtpengine_manage() in the route block of t_continue()
does the same as in failure_route)."
This would lead one to believe that it applies only in the context of
handling a BYE or CANCEL in a resumed transaction, when in fact it seems
to hold true of non-BYE/CANCEL and non-failure contexts as well, as can
be clearly seen with the reinvite.
The behaviour is exactly as expected if I don't use rtpengine_manage()
and instead manually call rtpengine_offer()/rtpengine_answer(). And
expected behaviour comes from rtpengine_manage() if I don't handle the
request in a resumed transaction context.
This yields the fundamental question:
Is there any way to have my cake and eat it too? I really want to use
rtpengine_manage() because I need to handle a potential SDP offer-in-ACK
scenario and don't want to do a bunch of state-keeping in order to use
the correct choice of rtpengine_{offer|answer}() in the right context,
which is a problem rtpengine_manage() solves beautifully. At the same
time, I absolutely need the slight reinvite delay that can be
accomplished via async processing; a UA on this side has a nasty habit
of sending a reinvite almost simultaneously to the 2xx answer for the
INVITE transaction, leading to indeterminate egress velocity for those
respective messages out of Kamailio worker threads.
Many thanks in advance!
-- Alex
--
Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Hello,
I have a proxy with Kamailio 5.0.6 working since few month without any issue.
Around 4500 locations and 5300 contacts
This weekend we move a very old proxy (Kamailio 3.3.2 with an old server )to this new one, adding around 14’000 users and 15’000 contacts.
Yesterday when calls was starting we get an big issue with this new proxy, lot of phones was disconnected and some calls was rejected.
I see that the issue was the authentication (done via a mysql DB with the cluster db module) many phone get a failure and was disconnected, mostly phone connected via TCP or TLS we see less issue with UDP even we have much more .
The issue was not the number of TCP/TLS connection as we see the REGISTER and the 401 going back, so connection was correctly done
Currently it’s working but I don’t know exactly why ☹, I mean I have done a change but it has really no relation … , during the same time I get another issue, some calls have no voice…
We are using rtpengine (on the old proxy we was using rtpproxy) and with the rtproxy we already face a long time ago such case and to solve it we setup multiple rtpproxy (on the same host)
So I try to do the same, I setup a second rtpengine on the same host and when I reload the config with : kamcmd rtpengine.reload all registration was working perfectly ...
As they is no relation with the registration end the rtpengine I don't know why now it's working.
Any idea ?
BR
Laurent
Greetings,
I have a question about Dispatcher's probing.
I have it configured with ds_probing_mode = 3 and ds_ping_interval = 60.
Currently i have 35 Gateways with state = 8, meaning they will be probed.
However, when i do a SIP capture i get a different scenario. Altough
Kamailio sends OPTIONS at every 60 seconds it only sends to 16 destinations.
Is there a configuration that limits this? What can i do to have every
gateway probed?
Best Regards,
Duarte Rocha
Greetings,
I have a question about Dispatcher's probing.
I have it configured with ds_probing_mode = 3 and ds_ping_interval = 60.
Currently i have 35 Gateways with state = 8, meaning they will be probed.
However, when i do a SIP capture i get a different scenario. Altough
Kamailio sends OPTIONS at every 60 seconds it only sends to 16 destinations.
Is there a configuration that limits this? What can i do to have every
gateway probed?
Best Regards,
Duarte Rocha
Hi all!
I have a question that arises in mailing list sometimes, but it is
still not clear for me how to work with this.
We have AWS instance with standard Amazon bi-nat, so basically
communication with external hosts works with
listen udp:ip:port advertise ip:port
But in case when we need to send external call to internal network by
internal ip addresses, we want to have internal host in record-route.
As far as I understand, basic recommendation is to use separate port
or internal address and select it with appropriate function.
Maybe it is more theoretical question, but can we do something to
generate correct record-routes and VIA for calls coming from external
network to make their softswitches happy, and still maintain internal
address in messages going to internal hosts, using single host and
port on Kamailio behind nat?
Thanks!
--
Best regards,
Dmitry Sytchev,
IT Engineer
Hello,
I'm trying to install Kamailio IMS for my Ubuntu 18.04 device. I have
followed the configuration files which are provided by installation, but I
have a problem about sqlops module.
While I'm trying to execute pcscf module, following errors appear:
root@yagiz-HP-ZBook-15:/usr/local/src/kamailio# kamailio -f
/etc/kamailio/pcscf/kamailio.cfg -c
loading modules under config path:
/usr/lib/x86_64-linux-gnu/kamailio/modules
0(12536) ERROR: sqlops [sql_api.c:669]: sql_parse_param(): invalid sqlops
parameter [mysql://Mysql@localhost/pcscf] at [29]
0(12536) CRITICAL: <core> [core/cfg.y:3449]: yyerror_at(): parse error in
config file /etc/kamailio/pcscf/kamailio.cfg, line 278, column 60: Can't
set module parameter
0(12536) INFO: pv [pv_shv.c:60]: shvar_init_locks(): locks array size 16
0(12536) CRITICAL: <core> [core/cfg.lex:1599]: sr_push_yy_state(): cannot
open included file: route/register.cfg
(/etc/kamailio/pcscf/route/register.cfg)
0(12536) : <core> [core/cfg.lex:1308]: yylex(): error at
/etc/kamailio/pcscf/kamailio.cfg line 907
I have set my sqlops parameter as :
#!define SQLOPS_DBURL "mysql://Mysql@localhost/pcscf"
PS: I have created necessary databases and tables which are mentioned on
usrloc files ( which are ims_usrloc_pcscf-create.sql and
ims_usrloc_scscf-create.sql)
Here is my pcscf.cfg file
# IP-Adress for incoming SIP-Traffic, in the following format:
# SIP / UDP
listen=udp:10.3.0.188:5060
# SIP / TCP
#listen=tcp:11.22.33.44:5060
# SIP / TCP/TLS
#listen=tls:11.22.33.44:5061
alias=pcscf.mnc001.mcc001.3gppnetwork.org
#!define MY_WS_PORT 80
#!define MY_WSS_PORT 443
#!define PCSCF_URL "sip:pcscf.mnc001.mcc001.3gppnetwork.org"
#!define TCP_PROCESSES 8
#!subst "/NETWORKNAME/mnc001.mcc001.3gppnetwork.org/"
#!subst "/HOSTNAME/pcscf.mnc001.mcc001.3gppnetwork.org/"
# SIP-Address of capturing node, if not set, capturing is disabled.
##!define CAPTURE_NODE "sip:127.0.0.1:9060"
# Allowed IPs for XML-RPC-Queries
##!define XMLRPC_WHITELIST_1 "127.0.0.1"
##!define XMLRPC_WHITELIST_2 "127.0.0.1"
##!define XMLRPC_WHITELIST_3 "127.0.0.1"
#!define RTPPROXY_ADDRESS "udp:10.1.2.186:22222"
# Databases:
#!define DB_URL "mysql://Mysql@localhost/pcscf"
##!define DB_URL "mysql://kamailio:kamailiorw@localhost/kamailio/pcscf"
##!define DB_URL2 "con2=>mysql://pcscf:heslo@127.0.0.1/pcscf"
#!define SQLOPS_DBURL "mysql://Mysql@localhost/pcscf"
##!define SQLOPS_DBURL "mysql://root@localhost/pcscf"
#! Optional: Server-URL for Websocket-Requests
##!define WEBSOCKET_WEBSERVER "phone.ng-voice.com"
##!define TRF_FUNCTION "trf.mnc001.mcc001.3gppnetwork.org"
#
# Several features can be enabled using '#!define WITH_FEATURE' directives:
#
# *** To run in debug mode:
# - define WITH_DEBUG
#
# *** To enable nat traversal execute:
# - define WITH_NAT
# - define the connection to the RTP-Proxy: RTPPROXY_ADDRESS
#
# *** To force alls calls through the RTP-Proxy
# - this will automagically enable NAT-Traversal
# - define FORCE_RTPRELAY
#
# *** To enable IPv4/IPv6 Translation (RTPProxy)
# - this will automagically enable NAT-Traversal
# - define WITH_RTPIPV4
#
# *** To enable TCP support execute:
# - define WITH_TCP
#
# *** To enable TLS support execute:
# - adjust CFGDIR/tls.cfg as needed
# - define WITH_TLS
# - this will automagically enable TCP
#
# *** To enable XMLRPC support execute:
# - define WITH_XMLRPC
# - this will automagically enable TCP
#
# *** To enable anti-flood detection execute:
# - adjust pike and htable=>ipban settings as needed (default is
# block if more than 16 requests in 2 seconds and ban for 300 seconds)
# - define WITH_ANTIFLOOD
#
# *** To enable the Rx-Interface:
# - Configure Rx-Diameter-Interface in pcscf.xml
# - define WITH_RX
#
# *** To enable a Homer SIP-Capter-Node:
# - define CAPTURE_NODE with a proper address
#
# *** To enable support for the SEMS-SBC
# - define WITH_SBC
# - configure dispatcher-list with a set of SBC's
#
# Enabled Features for this host:
##!define WITH_DEBUG
#!define WITH_NAT
#!define WITH_NATPING
#!define FORCE_RTPRELAY
##!define WITH_TLS
##!define WITH_XMLRPC
##!define WITH_IPBLOCK
##!define WITH_ANTIFLOOD
##!define WITH_RX
##!define WITH_RX_REG
##!define WITH_RX_CALL
##!define WITH_TCP
##!define WITH_RTPIPV4
##!define WITH_SBC
##!define WITH_SBC_CALL
##!define WITH_REGINFO
##!define WITH_RTPPING
##!define WITH_WEBSOCKET
Any helps would be appreciated,
Regards,
Yağız
--