[SR-Users] topos xavu_field_contact_host kamailio 5.5

Jonathan Hunter hunterj91 at hotmail.com
Fri Dec 3 10:06:57 CET 2021


Hello Henning,

Yes your comments make perfect sense.

Essentially I want to change the contact in-dialog as essentially the initial INVITE comes in on a private interface from the carrier, and then goes out on a public interface to the subscriber, so the subscriber only see’s public IP address in the SIP contact host and responds to it, and the carrier only see’s the private IP address in the contact host so they respond to the appropriate IP address, so its topology hiding IP addresses across interfaces.

I have done a similar thing with hash tables before and using record_route_preset but was hoping I could do a similar thing with  topos and leave it to manage the dialog.

Does that make sense?

Jon

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

From: Henning Westerholt<mailto:hw at gilawa.com>
Sent: 03 December 2021 08:55
To: Kamailio (SER) - Users Mailing List<mailto:sr-users at lists.kamailio.org>
Cc: Jonathan Hunter<mailto:hunterj91 at hotmail.com>
Subject: RE: topos xavu_field_contact_host kamailio 5.5

Hello Jonathan,

Usually, you want to set the appropriate contact host in the initial INVITE and then the dialog stays “with” this contact. This can be done by just setting the xavp and is the way the topology module usually works.

Maybe you can elaborate why you want to change the contact in-dialog, or even in one transaction (onreply_route example below).

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fskalatan.de%2Fblog%2F&data=04%7C01%7C%7Cb74ad073c33d41b7361908d9b63aa6fe%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637741185290034034%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=qnxxMfZZZu02afBIWDuFd%2BD8aWsONREQKi8NRzSwsCw%3D&reserved=0>
Kamailio services – https://gilawa.com<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgilawa.com%2F&data=04%7C01%7C%7Cb74ad073c33d41b7361908d9b63aa6fe%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637741185290044023%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=NUTMsNTDmv6tedyftRo%2FTZPrtD2ng2SCusJtmbM4ADs%3D&reserved=0>

From: Jonathan Hunter <hunterj91 at hotmail.com>
Sent: Friday, December 3, 2021 9:28 AM
To: Henning Westerholt <hw at gilawa.com>; Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
Subject: RE: topos xavu_field_contact_host kamailio 5.5

HI Henning,

Yes sorry late night 😊 and thank you for reply.

Yes I conditionally want to set it, I have tried this but not sure it has worked to this point hence why I am wondering if I am missing something.

Say for example I have request coming in from carrier on 10.10.10.10 interface and want to route to subscriber who is registered, so flow is simple its just;

Carrier--->kamailio-->subscriber

On branch route out I have set the contact_host to a particular IP address, however on_reply I want to change it again to another IP address, can I do that using the $xavu ?

So branch sees contact host as one IP address, and onreply I change it to another IP.

As currently if I set the Host it stays the same on both sides.

Does that make sense?

Jon

Sent from Mail<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=04%7C01%7C%7Cb74ad073c33d41b7361908d9b63aa6fe%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637741185290044023%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=xcxgA%2BwHWf00Cf64A4Mre4duzS38by1VjvZjARsvQnY%3D&reserved=0> for Windows

From: Henning Westerholt<mailto:hw at gilawa.com>
Sent: 03 December 2021 08:08
To: Kamailio (SER) - Users Mailing List<mailto:sr-users at lists.kamailio.org>
Cc: Jonathan Hunter<mailto:hunterj91 at hotmail.com>
Subject: RE: topos xavu_field_contact_host kamailio 5.5

Hello,

There might be a spelling error below, you probably mean:

“$xavu(_tps_=>contact_host) = "2.2.2.2";
And this works fine but obviously sets the contact_host to 2.2.2.2 across both interfaces, I ideally want it to change between 10.10.10.10 and 2.2.2.2.”

Not sure if I understand your question correctly. You could just conditionally set the contact host to the different values, depending on your configuration logic.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fskalatan.de%2Fblog%2F&data=04%7C01%7C%7Cb74ad073c33d41b7361908d9b63aa6fe%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637741185290054020%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=2vUSFj4kZ3BNtsPpIhMnGf2QvjiMVvofZyQRhBdh3l8%3D&reserved=0>
Kamailio services – https://gilawa.com<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgilawa.com%2F&data=04%7C01%7C%7Cb74ad073c33d41b7361908d9b63aa6fe%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637741185290054020%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=uTddu27CmQJabzFaOtiZQ%2BHA5PcoRsZ8qnQgDTIkyi8%3D&reserved=0>

From: sr-users <sr-users-bounces at lists.kamailio.org<mailto:sr-users-bounces at lists.kamailio.org>> On Behalf Of Jonathan Hunter
Sent: Friday, December 3, 2021 8:57 AM
To: Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>>
Subject: [SR-Users] topos xavu_field_contact_host kamailio 5.5

Hi All,

I was wondering if anyone can help, and advise me if I am missing something when using topos in an environment where I have more than one interface for kamailio.

Essentially I would like to set the contact_host to 2 different values depending on the flow of the SIP requests, as we have a private LAN interconnect for example 10.10.10.10, and a public interconnect using 2.2.2.2 (for example).

I notice there is xavu for A-side contact and B-side contact, but what about just the contact host?

As I have set for example;

modparam("topos", "xavu_cfg", "_tps_")
modparam("topos", "xavu_field_contact_host", "contact_host")
...
    $xavu(_tps_=>contact_host) = "2.2.2.2";

And this works fine but obviously sets the contact_host to 8.8.8.8 across both interfaces, I ideally want it to change between 10.10.10.10 and 2.2.2.2.

How can I set more than one contact_host $xavu that topos can use? As my understanding is you can only set $xavu once, so is there another way to manipulate the contact_host on requests coming in and out on different interfaces?  I assume I am missing something? :)

Thanks in advance

Jon

Sent from Mail<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=04%7C01%7C%7Cb74ad073c33d41b7361908d9b63aa6fe%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637741185290064010%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=kUd%2BaMz98RXCTBuAKS7ahoM%2BbUgJp8OJUlrl3wj7U0g%3D&reserved=0> for Windows



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20211203/18b5f2b3/attachment.htm>


More information about the sr-users mailing list