Hi
I see that when kamailio adds rport to the Via header field of a
request that has two Via values on the same line (comma-separated, of
course), it adds the rport (and received) to the wrong value.
I have this test kamailio.cfg for demonstration.
children=1
loadmodule "sl"
loadmodule "textops"
loadmodule "nathelper"
request_route {
force_rport();
sl_send_reply(200, "OK");
}
I send this OPTIONS (truncated) and get this response (truncated). The
rport should be on the first Via value, not the second.
OPTIONS sip:server SIP/2.0
Via: SIP/2.0/UDP 3.9.4.2:5060;branch=z9hG4bK503983089,SIP/2.0/UDP
1.3.4.1:5060;branch=z9hG4bK53805983059
From: <sip:client>;tag=LeonhardEuler
To: <sip:server>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 3.9.4.2:5060;branch=z9hG4bK503983089,SIP/2.0/UDP
1.3.4.1:5060;branch=z9hG4bK53805983059;rport=53805;received=127.0.0.1
From: <sip:client>;tag=LeonhardEuler
To: <sip:server>;tag=9dd61ff61e802d8e2bef5f14621ef3c2.49678e65
Server: kamailio (6.0.0-pre0 (x86_64/linux))
I've tested this with the latest commit (c994fb8) from kamailio. I
can't think how this can be anything other than a bug. Should I log a
bug report for this?
James
Hi folks,
Trying to hook up a new endpoint but am having an issue. Kamailio is in front of an Asterisk box.
They send an INVITE, we send 100, then 200 OK. However, when they send their ACK, the RURI is not set to the Contact of the 200, instead it is<number>@<proxy ip>. This causes the ACK to get routed to the proxy itself and the call fails.
82.160.190.100:5060 = Kamailio IP Port
198.201.240.242:5080 = Asterisk IP/Port
182.33.174.10:5060 = Provider endpoint
The far endpoint say they cannot fix the RURI - should I be able to handle this ACK below? My understanding is the ACK's RURI should be the Contact of the 200 OK.
200 OK sent from us to the Provider (Contact shows correct URI)
=========================================================
2025/01/15 17:14:49.470634 82.160.190.100:5060 -> 182.33.174.10:5060
SIP/2.0 200 OK
Via: SIP/2.0/UDP 182.33.174.10;branch=z9hG4bKefc7.ad07f2d3.0
Via: SIP/2.0/UDP 182.33.174.39:5060;received=182.33.174.39;branch=z9hG4bK5bbf9591;rport=5060
Record-Route: <sip:1800715080@82.160.190.100:5061;r2=on;lr=on;ftag=as0b42eef3;did=f2e.ade2;nat=yes>
Record-Route: <sip:1800715080@82.160.190.100;r2=on;lr=on;ftag=as0b42eef3;did=f2e.ade2;nat=yes>
Record-Route: <sip:182.33.174.10;lr;ftag=as0b42eef3>
From: "0737965510" <sip:0737966610@182.33.174.39>;tag=as0b42eef3
To: <sip:1800715080@82.160.190.100>;tag=as4133584e
Call-ID: 480dc17b3f88516f364778dc4b2528da@182.33.174.39:5060
CSeq: 102 INVITE
Server: Asterisk PBX 18.9.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
*Contact: <sip:1800715080@198.201.240.242:5080>*
Content-Type: application/sdp
Content-Length: 314 ,
ACK Reply from Provider to Us (RURI points to Kamailio ip:port now
===========================================================
2025/01/15 17:14:49.478119 182.33.174.10:5060 -> 82.160.190.100:5060
*ACK sip:1800715080@82.160.190.100:5060 *SIP/2.0
Via: SIP/2.0/UDP 182.33.174.10;branch=z9hG4bKefc7.ad07f2d3.2
Via: SIP/2.0/UDP 182.33.174.39:5060;received=182.33.174.39;branch=z9hG4bK55656469;rport=5060
Route: <sip:1800715080@82.160.190.100;r2=on;lr=on;ftag=as0b42eef3;did=f2e.ade2;nat=yes>,sip:1800715080@82.160.190.100:5061;r2=on;lr=on;ftag=as0b42eef3;did=f2e.ade2;nat=yes>
Max-Forwards: 69
From: "0737965510" <sip:0737966610@182.33.174.39>;tag=as0b42eef3
To: <sip:1800715080@82.160.190.100>;tag=as4133584e
Contact: <sip:0737965510@182.33.174.39:5060>
Call-ID: 480dc17b3f88516f364778dc4b2528da@182.33.174.39:5060
CSeq: 102 ACK
Thanks
-Barry
Hi,
I need to be able to pull in a header provided by a webrtc endpoint so I can use it in my request_route. I understand that I will need to use shm/htable to make it visible but I am unable to get the xhttp header using $header(x-p-push), or any header by name.
In my event_route[xhttp:request] I have the following:
if ($hdr(Upgrade) =~ "websocket" && $hdr(Connection) =~ "Upgrade" && $rm =~ "GET") {
....
xlog("L_INFO", "BF x-p-push header is $hdr(x-p-push) Contact is $hdr(Contact)\n");
}
The log shows both x-p-push and Contact header as null. sipdump shows the headers present in the request.
Am I missing something? Running Kamailio 5.8.4
Thanks
-Barry
Hi,
i have some SIP websocket clients (built using the SIP.js library) SUBSCRIBEd to other clients
via kamailio v5.8.2. If one of the watchers suddenly disappears (e.g. the web page is reloaded),
another connection is made and a new watcher appears in kamailio without the old one disappearing.
For example:
# kamctl rpc presence.watcher_list basic sip:1001@example.voismart.com
{
"jsonrpc": "2.0",
"result": [
{
"pres_uri": "sip:1001@example.com",
"to_user": "1001",
"watcher_user": "1000",
"contact": "sip:1000@mfp0h2dhhmq2.invalid;transport=ws;alias=192.168.56.10~34166~5",
"callid": "1o9b499kj6l65if0p30t",
"user_agent": "sip.js/1.12.1",
"expires": 1736422494,
...
}, {
"pres_uri": "sip:1001@example.com",
"to_user": "1001",
"watcher_user": "1000",
"contact": "sip:1000@0j7qoabnv827.invalid;transport=ws;alias=192.168.56.10~34156~5",
"callid": "8mjhrqifgm39up9t2qq3",
"user_agent": "sip.js/1.12.1",
"expires": 1736422492,
...
}
],
"id": 11753
}
you can see the duplicated watcher in which the old connection is now invalid because the
websocket client disappeared.
In this situation, issuing a pres_refresh_watchers() call will fail to send any notify
(even to the valid connection) because of this error:
WARNING: <core> [core/msg_translator.c:3007]: via_builder(): TCP/TLS connection (id: 0) for WebSocket could not be found
ERROR: tm [t_msgbuilder.c:1423]: assemble_via(): via building failed
ERROR: tm [t_msgbuilder.c:1614]: build_uac_req(): error while assembling Via
ERROR: tm [uac.c:552]: t_uac_prepare(): Error while building message
ERROR: presence [notify.c:1734]: send_notify_request(): in function tm t_request_within()
ERROR: presence [notify.c:1829]: notify(): sending Notify not successful
ERROR: presence [notify.c:1585]: query_db_notify(): Could not send notify for [event]=dialog
ERROR: presence [presence.c:739]: pres_refresh_watchers(): sending Notify requests
in which the building of the notify message fails because it cannot find a valid connection
when building the via header.
Is this a wanted behaviour? shouldn't it just fail the sending of the single message? Is there
anything i can do to fix this?
Trying to reproduce the same problem with a regular tcp client, it seems that the other notifys are
correctly sent and only a timeout error is sent for the single message:
ERROR: <core> [core/tcp_main.c:4622]: handle_tcpconn_ev(): connect 192.168.56.10:21994 failed
which i think is the correct behaviour.
Related question: is it possible to remove active watchers when the connection goes down?
Thanks for the help on this.
Testing out KEMI functionality and running into performance issues. If I exceed 150 calls per second the network receive queue grows and Kamailio is unable to keep up with requests and they begin dropping.
KEMI script for testing is just doing a stateless reply to invites.
Using python3s module.
I've played with Kamailio child processes and memory allocations, but there is no impact. I've also attempted some buffer / memory tweaking at the OS level, again with no impact. Increasing CPU cores and even running the test on bare metal results in the same.
Example of receive queue at 150 calls per second -
Netid State       Recv-Q      Send-Q Local Address:Port
udp   UNCONN      337280      0  x.x.x.x:5060
Just wondering if anyone has experienced similar issues or has an example of the performance they are seeing before I continue down this path.
Thanks,
- dan
Hi List
I have some CPE which require special handling like removing 100rel and
update from the supported methods because they misbehave.
Previously, I was using reg_fetch_contacts and then appending the
branches manually and stacking the UA in an AVP.
With the branch index this allowed me to get the AVP containing the UA
to which the call was branched in the branch route and perform
filtering of methods based on UA, but it was complicated.
Now I use the intended function lookup_to_dset() but now I miss how to
access the register contact UA from within a branch route.
Is there an intended way to access that information?
Mit freundlichen Grüssen
-Benoît Panizzon-
--
I m p r o W a r e A G - Leiter Commerce Kunden
______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00
CH-4133 Pratteln Fax +41 61 826 93 01
Schweiz Web http://www.imp.ch
______________________________________________________
Hello,
I am considering to release Kamailio v5.8.5 (out of branch 5.8) on
Thursday, Jan 23, 2025. If anyone is aware of issues not yet on the bug
tracker, report them there asap in order to have a better chance to be
fixed.
Cheers,
Daniel
--
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com
Hi Gang
I guess, I don't completely understand who to properly perform serial
branching.
I did try to follow the examples from:
https://www.kamailio.org/docs/modules/devel/modules/tm.html#tm.f.t_next_con…
This is, stripped down, the relevant config used.
modparam("tm", "contacts_avp", "tm_contacts")
modparam("tm", "contact_flows_avp", "tm_contact_flows")
route[LOCATION]
{
lookup_to_dset("location", "$var(lookupuri)");
if (!t_load_contacts(1)) {
xlog("L_ERR", "$cfg(route): ######### load_contacts failed\n");
sl_send_reply("500", "Server Internal Error - Cannot load contacts");
exit;
}
xlog("L_INFO", "$cfg(route): Contacts loaded: $cnt($xavp(tm_contacts))\n");
=> Confirms, there is more than one contact loaded.
if (!t_next_contacts()) {
send_reply("480", "Not registered");
}
t_set_fr(5000,1500); # Set 5 second timeout for LAB testing to quickly try the next contact.
t_on_branch("BR_TO_CUST");
t_on_branch_failure("BR_TO_CUST_FAILURE");
exit;
}
event_route[tm:branch-failure:BR_TO_CUST_FAILURE] {
xlog("BRANCH FAILED $T_reply_code to $rm message\n");
t_on_branch("BR_TO_CUST");
t_on_branch_failure("BR_TO_CUST_FAILURE");
if (t_next_contact_flow())
{
xlog("BRANCH FAILED, Try Next\n");
t_relay();
} else {
xlog("L_INFO", "No more flows\n");
t_reply("408", "Branch Timeout");
exit;
}
}
What happens is:
INVITE is sent to the first contact, who is replying RINGING.
After 5 seconds the timeout is reached and the branch-failure route engaged.
Jan 17 15:01:15 dev-cpereg01 kamailio[3599432]: ERROR: <script>: BRANCH FAILED 408 to INVITE message
Jan 17 15:01:15 dev-cpereg01 kamailio[3599432]: INFO: <script>: No more flows
Jan 17 15:01:15 dev-cpereg01 kamailio[3599432]: CRITICAL: tm [tm.c:1554]: ki_t_reply(): w_t_reply entered in unsupported mode
To my understanding, t_next_contact_flow() should have loaded the next ds, but this does not seem to happen.
What am I missing?
--
Mit freundlichen Grüssen
-Benoît Panizzon- @ HomeOffice und normal erreichbar
--
I m p r o W a r e A G - Leiter Commerce Kunden
______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00
CH-4133 Pratteln Fax +41 61 826 93 01
Schweiz Web http://www.imp.ch
______________________________________________________
Anybody experiences with Kamailio IMS modules (ims_registrar_scscf, ims_usrloc_scscf, ims_isc, ........) and the use of IPv6 addresses?
Any pitfalls? DNS issues?
Thanks,
Christoph