UA1(192.168.0.1) --> kamailio (internal:192.168.0.2 public:1.1.1.1) --> UA2(2.2.2.2) if in UA1 INVITE, I write KSR.rr.record_route(). so UA2(2.2.2.2) received sip msg (Record-Route: sip:1.1.1.1:7080), so Kamailio can received BYE/ACK from UA2. but,Kamailio can't received BYE/ACK from UA1.
if in UA1 INVITE, i write KSR.rr.record_route_advertised_address("192.168.0.2"), then Kamailio can received BYE/ACK from UA1, but not from UA2.
what can i do, let Kamailio receive BYE/ACK from both sides ?
There are many possibilities. One of - use listen names and advertised address with allow_double_rr option.
Once you do that - you'll be able to add 2 rr headers, and kamailio will be able to handle gateway functionality between interfaces via RR/Route headers
On Thu, 28 Sept 2023, 11:53 codenot--- via sr-users, < sr-users@lists.kamailio.org> wrote:
UA1(192.168.0.1) --> kamailio (internal:192.168.0.2 public:1.1.1.1) --> UA2(2.2.2.2) if in UA1 INVITE, I write KSR.rr.record_route(). so UA2(2.2.2.2) received sip msg (Record-Route: sip:1.1.1.1:7080), so Kamailio can received BYE/ACK from UA2. but,Kamailio can't received BYE/ACK from UA1.
if in UA1 INVITE, i write KSR.rr.record_route_advertised_address("192.168.0.2"), then Kamailio can received BYE/ACK from UA1, but not from UA2.
what can i do, let Kamailio receive BYE/ACK from both sides ? __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions 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! Edit mailing list options or unsubscribe:
If you upload a packet capture, I'll look at it and try to tell you what's going wrong. This is certainly something that can work, and I always find that making a diagnosis with a packet capture is the root to the solution. It's going to be difficult for anyone to help resolve your problem without a code example, a trace, or a detailed description of the problem. If you start with a packet capture, then I'll try to help you. If you give me a sample of code, too, then it'll be easier for me.
James
On Thu, 28 Sept 2023 at 10:56, codenot--- via sr-users sr-users@lists.kamailio.org wrote:
i tried. but it does't work. modparam("rr", "enable_double_rr", 1) __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions 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! Edit mailing list options or unsubscribe:
[cid:026313f8-1d5d-417e-81f6-d9ad8c9934a8] [cid:eadf5c29-8a04-47e3-99e9-e009a7386568]
UA(192.168.0.11) received 183, then send ACK to 36.140.122.12(Kamialio public ip) not 192.168.0.2(kamailio internal ip), so Kamailio can't receive ACK.
this is my config,192.168.0.11 -> Kamailio -> Other SBC(public ip) [cid:71420fb4-862a-4604-adc9-916f7c24f2b6]
[https://res-h3.public.cdn.office.net/assets/mail/file-icon/png/generic_16x16...https://1drv.ms/u/s!AkdU9Y6p5WVyjntDzMvkhGBHaJ1h this is capture packet
This question has been bothering me for a long time, help me ________________________________ 发件人: James Browne james@frideo.com 发送时间: 2023年10月2日 12:03 收件人: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org 抄送: codenot@msn.com codenot@msn.com 主题: Re: [SR-Users] Re: kamailio Behind nat. How Record-Route should be added ?
If you upload a packet capture, I'll look at it and try to tell you what's going wrong. This is certainly something that can work, and I always find that making a diagnosis with a packet capture is the root to the solution. It's going to be difficult for anyone to help resolve your problem without a code example, a trace, or a detailed description of the problem. If you start with a packet capture, then I'll try to help you. If you give me a sample of code, too, then it'll be easier for me.
James
On Thu, 28 Sept 2023 at 10:56, codenot--- via sr-users sr-users@lists.kamailio.org wrote:
i tried. but it does't work. modparam("rr", "enable_double_rr", 1) __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions 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! Edit mailing list options or unsubscribe:
try using a different source port for the outgoing side. i.e. use 2 ports in kamailio.
Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
On Mon, Oct 9, 2023 at 1:14 AM 城门 虾米 via sr-users < sr-users@lists.kamailio.org> wrote:
UA(192.168.0.11) received 183, then send ACK to 36.140.122.12(Kamialio public ip) not 192.168.0.2(kamailio internal ip), so Kamailio can't receive ACK.
this is my config,192.168.0.11 -> Kamailio -> Other SBC(public ip)
kamailio-ack-out-received.pcap https://1drv.ms/u/s!AkdU9Y6p5WVyjntDzMvkhGBHaJ1h this is capture packet
This question has been bothering me for a long time, help me
*发件人:* James Browne james@frideo.com *发送时间:* 2023年10月2日 12:03 *收件人:* Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org *抄送:* codenot@msn.com codenot@msn.com *主题:* Re: [SR-Users] Re: kamailio Behind nat. How Record-Route should be added ?
If you upload a packet capture, I'll look at it and try to tell you what's going wrong. This is certainly something that can work, and I always find that making a diagnosis with a packet capture is the root to the solution. It's going to be difficult for anyone to help resolve your problem without a code example, a trace, or a detailed description of the problem. If you start with a packet capture, then I'll try to help you. If you give me a sample of code, too, then it'll be easier for me.
James
On Thu, 28 Sept 2023 at 10:56, codenot--- via sr-users sr-users@lists.kamailio.org wrote:
i tried. but it does't work. modparam("rr", "enable_double_rr", 1) __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions 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!
Edit mailing list options or unsubscribe:
Kamailio - Users Mailing List - Non Commercial Discussions 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! Edit mailing list options or unsubscribe:
[cid:8bf5d0db-4107-4773-9bdc-c0676aeb0447] [cid:fe9cc6e9-9272-4c1d-980a-a7a629e67901]
UA(192.168.0.11) received 183, find Record-Route(36.140.122.12) then send ACK to 36.140.122.12(Kamialio public ip) not 192.168.0.2(kamailio internal ip), so Kamailio can't receive ACK.
this is my config,192.168.0.11 -> Kamailio -> Other SBC(public ip) function ksr_request_route() if KSR.is_INVITE() then KSR.rr.record_route(); KSR.nathelper.fix_nated_contact() end end
This question has been bothering me for a long time, help me ________________________________ 发件人: James Browne james@frideo.com 发送时间: 2023年10月2日 12:03 收件人: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org 抄送: codenot@msn.com codenot@msn.com 主题: Re: [SR-Users] Re: kamailio Behind nat. How Record-Route should be added ?
If you upload a packet capture, I'll look at it and try to tell you what's going wrong. This is certainly something that can work, and I always find that making a diagnosis with a packet capture is the root to the solution. It's going to be difficult for anyone to help resolve your problem without a code example, a trace, or a detailed description of the problem. If you start with a packet capture, then I'll try to help you. If you give me a sample of code, too, then it'll be easier for me.
James
On Thu, 28 Sept 2023 at 10:56, codenot--- via sr-users sr-users@lists.kamailio.org wrote:
i tried. but it does't work. modparam("rr", "enable_double_rr", 1) __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions 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! Edit mailing list options or unsubscribe:
Hello,
Could you please share part of "listen=" in your config. Do you have two separate interfaces for each IP?
пн, 9 окт. 2023 г. в 06:00, 城门 虾米 via sr-users <sr-users@lists.kamailio.org
:
UA(192.168.0.11) received 183, find Record-Route(36.140.122.12) then send ACK to 36.140.122.12(Kamialio public ip) not 192.168.0.2(kamailio internal ip), so Kamailio can't receive ACK.
this is my config,192.168.0.11 -> Kamailio -> Other SBC(public ip) function ksr_request_route() if KSR.is_INVITE() then KSR.rr.record_route(); KSR.nathelper.fix_nated_contact() end end
This question has been bothering me for a long time, help me
*发件人:* James Browne james@frideo.com *发送时间:* 2023年10月2日 12:03 *收件人:* Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org *抄送:* codenot@msn.com codenot@msn.com *主题:* Re: [SR-Users] Re: kamailio Behind nat. How Record-Route should be added ?
If you upload a packet capture, I'll look at it and try to tell you what's going wrong. This is certainly something that can work, and I always find that making a diagnosis with a packet capture is the root to the solution. It's going to be difficult for anyone to help resolve your problem without a code example, a trace, or a detailed description of the problem. If you start with a packet capture, then I'll try to help you. If you give me a sample of code, too, then it'll be easier for me.
James
On Thu, 28 Sept 2023 at 10:56, codenot--- via sr-users sr-users@lists.kamailio.org wrote:
i tried. but it does't work. modparam("rr", "enable_double_rr", 1) __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions 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!
Edit mailing list options or unsubscribe:
Kamailio - Users Mailing List - Non Commercial Discussions 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! Edit mailing list options or unsubscribe:
listen=udp:0.0.0.0:7080 advertise 36.140.122.12:7080 ________________________________ 发件人: Nick F nik.oloakt@gmail.com 发送时间: 2023年10月9日 6:36 收件人: 城门 虾米 codenot@msn.com 抄送: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org 主题: Re: [SR-Users] 回复: Re: kamailio Behind nat. How Record-Route should be added ?
Hello,
Could you please share part of "listen=" in your config. Do you have two separate interfaces for each IP?
пн, 9 окт. 2023 г. в 06:00, 城门 虾米 via sr-users <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org>:
[cid:8bf5d0db-4107-4773-9bdc-c0676aeb0447] [cid:fe9cc6e9-9272-4c1d-980a-a7a629e67901]
UA(192.168.0.11) received 183, find Record-Route(36.140.122.12) then send ACK to 36.140.122.12(Kamialio public ip) not 192.168.0.2(kamailio internal ip), so Kamailio can't receive ACK.
this is my config,192.168.0.11 -> Kamailio -> Other SBC(public ip) function ksr_request_route() if KSR.is_INVITE() then KSR.rr.record_route(); KSR.nathelper.fix_nated_contact() end end
This question has been bothering me for a long time, help me ________________________________ 发件人: James Browne <james@frideo.commailto:james@frideo.com> 发送时间: 2023年10月2日 12:03 收件人: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> 抄送: codenot@msn.commailto:codenot@msn.com <codenot@msn.commailto:codenot@msn.com> 主题: Re: [SR-Users] Re: kamailio Behind nat. How Record-Route should be added ?
If you upload a packet capture, I'll look at it and try to tell you what's going wrong. This is certainly something that can work, and I always find that making a diagnosis with a packet capture is the root to the solution. It's going to be difficult for anyone to help resolve your problem without a code example, a trace, or a detailed description of the problem. If you start with a packet capture, then I'll try to help you. If you give me a sample of code, too, then it'll be easier for me.
James
On Thu, 28 Sept 2023 at 10:56, codenot--- via sr-users <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> wrote:
i tried. but it does't work. modparam("rr", "enable_double_rr", 1) __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.orgmailto:sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
__________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.orgmailto:sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
Hi
You also uploaded a pcap trace, using this link (which you sent directly to me). - https://1drv.ms/u/s!AkdU9Y6p5WVyjnrodIHt6EgS-h3U I read it and it's clear what's going wrong.
This is your desired flow.
192.168.0.11 ---> 192.168.0.2 ---> 122.97.130.198 192.168.0.11 <--- 36.140.122.12 <--- 122.97.130.198
In this, your INVITE goes to the public IP address (122.97.130.198) like this.
INVITE sip:+8618626439917@122.97.130.198:15060;user=phone SIP/2.0 Record-Route: sip:36.140.122.12:7080 ;lr;ftag=5c1a6b917a705e9e;did=2c4.8532;nat=yes;vst=AAAAAAAAAAAAAAAAAAAAAAAAAAALAAAIARYfAx4cCw4IAgE1MDYwO3VzZXI9cGhvbmU- Via: SIP/2.0/UDP 36.140.122.12:7080 ;branch=z9hG4bKe61a.5fe9d645ef1bbe470ca6d57fa20375bf.0 Via: SIP/2.0/UDP 192.168.0.11:45642 ;received=192.168.0.11;branch=z9hG4bK98457cb5b0e44505;rport=45642
The 200-OK goes to the UAC (192.168.0.11) like this.
SIP/2.0 200 OK Via: SIP/2.0/UDP 36.140.122.12:7080 ;rport=7080;branch=z9hG4bKe61a.5fe9d645ef1bbe470ca6d57fa20375bf.0 Via: SIP/2.0/UDP 192.168.0.11:45642 ;received=192.168.0.11;branch=z9hG4bK98457cb5b0e44505;rport=45642 Record-Route: sip:192.168.0.159;r2=on;lr=on;nat=yes Record-Route: sip:122.97.130.198:15060;r2=on;lr=on;nat=yes Record-Route: sip:36.140.122.12:7080 ;lr;ftag=5c1a6b917a705e9e;did=2c4.8532;nat=yes;vst=AAAAAAAAAAAAAAAAAAAAAAAAAAALAAAIARYfAx4cCw4IAgE1MDYwO3VzZXI9cGhvbmU-
The problem is, as you know, that the ACK from the UAC is routed to the public IP address 36.140.122.12, whereas you want it to be sent to the private IP address. For this, double record-routing is required, as suggested earlier in this thread.
My best guess is that your proxy has one IP address. A problem is that we now know that you have your listen directive set to listen on the private interface, but always advertise the public IP address, but this is not what you want. You want to advertise one address in one direction and another in the other direction. You want two Record-Route header fields when relaying the initial INVITE.
I see two possible solutions (but there may be others). - Get your proxy server to listen on two addresses, and force the socket when relaying messages. This can be cumbersome and tricky. - Try using the record_route_preset() function from the rr module. This can be used to write the two Record-Route header fields exactly as you want (in the correct order, of course).
I recommend the second option, because it would be simpler for me to implement. I don't know how to do it in KEMI, though. https://kamailio.org/docs/modules/5.7.x/modules/rr.html#rr.f.record_route_pr...
James
On Mon, 9 Oct 2023 at 07:12, 城门 虾米 via sr-users sr-users@lists.kamailio.org wrote:
listen=udp:0.0.0.0:7080 advertise 36.140.122.12:7080
*发件人:* Nick F nik.oloakt@gmail.com *发送时间:* 2023年10月9日 6:36 *收件人:* 城门 虾米 codenot@msn.com *抄送:* Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org *主题:* Re: [SR-Users] 回复: Re: kamailio Behind nat. How Record-Route should be added ?
Hello,
Could you please share part of "listen=" in your config. Do you have two separate interfaces for each IP?
пн, 9 окт. 2023 г. в 06:00, 城门 虾米 via sr-users < sr-users@lists.kamailio.org>:
UA(192.168.0.11) received 183, find Record-Route(36.140.122.12) then send ACK to 36.140.122.12(Kamialio public ip) not 192.168.0.2(kamailio internal ip), so Kamailio can't receive ACK.
this is my config,192.168.0.11 -> Kamailio -> Other SBC(public ip) function ksr_request_route() if KSR.is_INVITE() then KSR.rr.record_route(); KSR.nathelper.fix_nated_contact() end end
This question has been bothering me for a long time, help me
*发件人:* James Browne james@frideo.com *发送时间:* 2023年10月2日 12:03 *收件人:* Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org *抄送:* codenot@msn.com codenot@msn.com *主题:* Re: [SR-Users] Re: kamailio Behind nat. How Record-Route should be added ?
If you upload a packet capture, I'll look at it and try to tell you what's going wrong. This is certainly something that can work, and I always find that making a diagnosis with a packet capture is the root to the solution. It's going to be difficult for anyone to help resolve your problem without a code example, a trace, or a detailed description of the problem. If you start with a packet capture, then I'll try to help you. If you give me a sample of code, too, then it'll be easier for me.
James
On Thu, 28 Sept 2023 at 10:56, codenot--- via sr-users sr-users@lists.kamailio.org wrote:
i tried. but it does't work. modparam("rr", "enable_double_rr", 1) __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions 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!
Edit mailing list options or unsubscribe:
Kamailio - Users Mailing List - Non Commercial Discussions 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! Edit mailing list options or unsubscribe:
Kamailio - Users Mailing List - Non Commercial Discussions 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! Edit mailing list options or unsubscribe: