I think understand in which case it happens.
When I receive a REGISTER, I create a transaction since I need to use the
t_continue feature to wake up a suspended transaction. However, the save()
command of the REGISTRAR module doesn't seem to call t_reply for replying
the 200 (it looks like the SL module is used instead). Therefore, I get the
warning every time it happens since the transaction is not released
explicitly.
Should I call t_release just before exiting the block handling the REGISTER?
From: Mickael Marrache [mailto:mickaelmarrache@gmail.com]
Sent: Thursday, April 09, 2015 1:43 PM
To: sr-users(a)lists.sip-router.org
Subject: Avoiding "script writer didn't release transaction" warnings
Hi,
In my logs, I get a lot of the following warnings:
WARNING: tm [t_lookup.c:1476]: t_unref(): WARNING: script writer didn't
release transaction
I force transaction creation from my script to absorb retransmissions as
soon as possible. I understand that I need to explicitly call t_release in
order to avoid this warning.
What is the most appropriate place in the script to call t_release?
Thanks,
Mickael
Hi,
In my logs, I get a lot of the following warnings:
WARNING: tm [t_lookup.c:1476]: t_unref(): WARNING: script writer didn't
release transaction
I force transaction creation from my script to absorb retransmissions as
soon as possible. I understand that I need to explicitly call t_release in
order to avoid this warning.
What is the most appropriate place in the script to call t_release?
Thanks,
Mickael
Hi.
I have scheme:
User -> Kamailio -> Asterisk -> PSTN
|
V
Radius Server
At the beginning dialog (INVITE) kamailio send to radius server START packet which indicates Called, Calling, Accounting Session ID, connect_time, setup_time.
When the terminating call (BYE) kamailio forms STOP package. How can I get on kamailio Called, Calling, connect_time that I have in kamailio for START packet
if I only match Accounting Session ID?
Thank.
Hi, all
I'm trying to set up 2 kamailio servers for active-active redundancy. The two kamailio severs share the the same database with db_mode=3, and no registration replication. Use pjsua2 as SIP client for testing. The test setup is as follows:
kamailio server 1(k1): 10.0.1.30:5061 <http://10.0.1.30:5061/>
kamailio server 2(k2): 10.0.1.32:5061 <http://10.0.1.32:5061/>
sip client c1: sip:16317@10.0.1.30 <mailto:sip%3A16317@10.0.1.30>, client ip: 10.0.1.254
sip client c2: sip:72316@10.0.1.30 <mailto:sip%3A72316@10.0.1.30>, client ip: 10.0.1.254
c1 is registered with k1.
c2 is registered with k2.
When c1 calls c2, the call flow is as follows:
INVITE:
c1------>k1------>k2------>c2
200 OK:
c1<------k1<------k2<------c2
So far, the INVITE works. c1 and c2 can establish a call. However, when c2 hangs up and sends BYE, the BYE is forwarded all the way to k1, and then k1 gives a 500 server error.
The log on k1 seems to indicate k1 was attempting to create a TLS connection to itself instead of using the existing TLS connection to c1 to forward the BYE.
BYE:
c1 X k1<------k2<------c2
|
|------->Connection refused/500
Here is the kamailio log on k1:
Mar 16 10:34:21 kamailio.sip.com <http://kamailio.sip.com/> /usr/sbin/kamailio[13396]: ERROR: <core> [tcp_main.c:2740]: tcpconn_1st_send(): connect 10.0.1.30:55999 <http://10.0.1.30:55999/> failed (RST) Connection refused
Mar 16 10:34:21 kamailio.sip.com <http://kamailio.sip.com/> /usr/sbin/kamailio[13396]: ERROR: <core> [tcp_main.c:2750]: tcpconn_1st_send(): 10.0.1.30:55999 <http://10.0.1.30:55999/>: connect & send for 0x7fc96a68a1a0 failed: Connection refused (111)
This is the routing logic for BYE in kamailio.cfg:
if (loose_route()) {
route(DLGURI);
if (is_method("BYE")) {
xlog("L_DBG", "=====BYE $ru from $fu $si:$sp to $du=====\n");
dlg_manage();
setflag(FLT_ACC); # do accounting ...
setflag(FLT_ACCFAILED); # ... even if the transaction fails
}
else if ( is_method("ACK") ) {
# ACK is forwarded statelessy
route(NATMANAGE);
}
else if ( is_method("NOTIFY") ) {
# Add Record-Route for in-dialog NOTIFY as per RFC 6665.
record_route();
}
route(RELAY);
exit;
} else {......
If I add location based routing for BYE from peer kamailio, then the BYE seems to be forwarded correctly:
if (loose_route()) {
route(DLGURI);
if (is_method("BYE")) {
xlog("L_DBG", "=====BYE $ru from $fu $si:$sp to $du=====\n");
dlg_manage();
setflag(FLT_ACC); # do accounting ...
setflag(FLT_ACCFAILED); # ... even if the transaction fails
# If BYE coming from Kamailio peer, route BYE by location
$var(peerlist)=$sel(cfg_get.trusted.peers);
$var(i) = 0;
while($var(i)<$(var(peerlist){param.count})) {
xlog("L_DBG", "=====$(var(peerlist){param.count})=====$(var(peerlist){param.valueat,$var(i)})=====\n");
if(src_ip==$(var(peerlist){param.valueat,$var(i)})) {
lookup("location");
xlog("L_DBG", "=====BYE from $fu $si:$sp to $du=====\n");
break;
}
$var(i) = $var(i) + 1;
}
}
else if ( is_method("ACK") ) {
# ACK is forwarded statelessy
route(NATMANAGE);
}
else if ( is_method("NOTIFY") ) {
# Add Record-Route for in-dialog NOTIFY as per RFC 6665.
record_route();
}
route(RELAY);
exit;
} else {......
My first question is why k1 loose_route sends the BYE to itself instead of the client. Is this a bug?
My next question is whether the above location routing for BYE from peer kamailio a good/safe approach.
The SIP traces will be sent later to avoid exceeding email size limit.
Thanks
In the documentation at:
http://kamailio.org/docs/modules/4.2.x/modules/rtpproxy.html
I see a variable called $rtpstat which "Returns the RTP-Statistics from
the RTP-Proxy. The RTP-Statistics from the RTP-Proxy are provided as a
string and it does contain several packet-counters."
But I cannot find out where exactly it describes the packet counters.
For example the xlog entry:
log("L_ALERT", "STATS-rtpproxy,$rtpstat\n");
Will yield an output like:
STATS-rtpproxy,60 596 660 1256 0#012
I need to find the documentation for those counters. Any ideas?
Thanks,
--
Technical Support
http://www.cellroute.net
Hello,
There seems to be an implementational difference in interpolation of PVs
in AVP and XAVP identifiers and/or field names.
The pseudovariables documentation[1] on classical AVPs says:
The 'id' can be:
...
pseudo variable - if value of pv is integer, id is integer,
if string, id is string
So, for example, this composition of variables works:
$var(f) = 'donkey';
$avp($var(f) = 'eehaw';
xlog("L_INFO", "Donkey says: $avp(donkey)\n");
It correctly prints:
Donkey says: eehaw
Making some assumptions, I tried this, and it did not work similarly as
expected:
$var(f) = 'donkey';
$xavp(r=>$var(f)) = 'eehaw';
xlog("L_INFO", "Donkey says: $xavp(r=>donkey)\n");
This prints:
Donkey says: <null>
And a PV dump confirms that the PV value is not interpolated:
Mar 31 18:26:15 localhost /usr/local/sbin/kamailio[2399]: INFO: debugger
[debugger_api.c:1799]: dbg_dump_json(): {"$xavp(r)":[{"$var(f)":["eehaw"]}]}
Interpolation of variables does not work for either field or stem names.
Is this a design principle of XAVPs, or an oversight?
Thanks,
-- Alex
[1]
http://www.kamailio.org/wiki/cookbooks/4.2.x/pseudovariables#avp_id_-_avps
--
Alex Balashov | Principal | Evariste Systems LLC
303 Perimeter Center North, Suite 300
Atlanta, GA 30346
United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Hello,
I have the following setup:
UAC (Bria) ------ Kamailio -------- Freeswitch
Kamailio is used to authenticate the client using basic authentication.
Upon authentication the INVITE is sent to Freeswitch for further handling.
Kamailio stays in the path using record-route.
At this point, the authentication and calling FS works fine.
For now, FS just answers, plays a file and hangsup the call.
Answering the call and playing a file works fine.
When FS hangs up the call, the BYE message is sent back to Kamailio.
The problem is the BYE message from FS contains a Route header which points to Kamailio again.
Which causes Kamailio to send the BYE message back to itself. Kamailio then replies with a 404.
The BYE is never sent to the UAC.
When I remove the record_route() for INVITEs, the call works fine, but Kamailio isn't kept in the signaling path.
The BYE is sent directly to the UAC.
T 10.0.5.52:54822 -> 10.0.5.50:5060 [AP]
BYE sip:grant@10.0.0.40:5060;transport=tcp SIP/2.0.
Via: SIP/2.0/TCP 10.0.5.52;rport;branch=z9hG4bK99X8a4Q8BFy1a.
Route: <sip:10.0.5.50;transport=tcp;lr=on>.
Max-Forwards: 70.
From: <sip:123456789@10.0.0.40>;tag=aey7rKe7DmQte.
To: <sip:grant@10.0.0.40>;tag=dbc9c27b.
Call-ID: NmQ4YjYyMDFkNmMwZjg0ZmU5NjQ3ODhjYzU0MDBmNGI.
CSeq: 73909300 BYE.
User-Agent: CM SBC.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, NOTIFY.
Supported: timer, path, replaces.
Reason: Q.850;cause=16;text="NORMAL_CLEARING".
Content-Length: 0.
Here is the WITHINDLG route:
route[WITHINDLG] {
xlog("L_INFO", "[R-ROUTE-WITHINDLG:$ci] !>" "Route:WITHINDLG;UnixTime:$TV(un);RequestURI:$rU;RequestMethod:$rm;FromTag:$ft;ToTag:$tt;CallID:$ci;From:$fU;To:$rU\r\n");
if (!has_totag()) {
return;
}
# Sequential request within a dialog should take the path determined by record-routing
if (loose_route()) {
route(RELAY);
exit;
} else {
if (is_method("ACK")) {
if (t_check_trans()) {
# No Loose-Route, but stateful ACK. Must be ACK after 487
route(RELAY);
exit;
} else {
# ACK without matching transaction
exit;
}
}
sl_send_reply("404","Not here");
}
exit;
}
I'm using TCP as the transport.
Kamailio: 4.2.3
Freeswitch: 1.5.15
I've attached a SIP trace from the point of view of Kamailio.
UAC: 10.0.0.40
Kamailio: 10.0.5.50
Freeswitch: 10.0.5.52
What is going on here?
The whole Record-Route thing confuses me a lot.
Regards,
Grant
Did anyone notice issues with Fritzbox 7390 devices? When upgrading from 4.0.1
to 4.0.7 some of these devices fail to register after some time.
They keep trying to reuse an old nonce and ignore the new one in the 401
response to the REGISTER. It will try 11 times to register with the same cseq,
nonce and nc, then it will try to register (11 times) with cseq+1, nc+1 and
still the old nonce. So www_auth fails with -4: stale nonce. I could find
anything in kamailio auth module to accept this behavior.
--
Telefoon: 088 0100 700
Sales: sales(a)pocos.nl | Service: servicedesk(a)pocos.nl
http://www.pocos.nl/ | Croy 9c, 5653 LC Eindhoven | Kamer van Koophandel
17097024