Thanks, Daniel. I've not fully tested yet (multiple combinations of transport protocols, rport in the request, etc), but testing with *exactly* the same SIP message now has the rport in the correct place.
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 SIP/2.0 200 OK Via: SIP/2.0/UDP 3.9.4.2:5060;branch=z9hG4bK503983089;rport=34321,SIP/2.0/UDP 1.3.4.1:5060;branch=z9hG4bK53805983059;received=127.0.0.1
Although the rport is now in the correct Via value, the received parameter is still attached to the second Via value. I expect I'm still going to have a problem with this. Is this also possible to get fixed? As always, I appreciate the quick responses for this sort of thing.
James
On Tue, 21 Jan 2025 at 18:48, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
can you try with latest git master branch? I have just pushed a commit for it.
As per code, it happened for generated replies when no rport was in incoming request first via and there were many via bodies in the same header.
Cheers, Daniel
On 21.01.25 17:36, James Browne via sr-users wrote:
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 __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.org To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!
-- Daniel-Constantin Mierla (@ asipto.com) twitter.com/miconda -- linkedin.com/in/miconda Kamailio Consultancy, Training and Development Services -- asipto.com