Hey!
There is no big magic here. You need to catch the event of placing a call on hold, for example, through the function `is_audio_on_hold()`.
And memorize the IP address of the destination FreeSWITCH for the given sip user, e.g. via htable/redis/etc.
The subsequent call from this sip user will determine whether there is an entry in htable and the same FS will be used.
At the end of the initial call you can remove key from htable in `event_route[dialog:end] {}`

https://www.kamailio.org/docs/modules/devel/modules/textops.html#textops.f.is_audio_on_hold
https://www.kamailio.org/docs/modules/devel/modules/dialog.html#idm1715




чт, 2 янв. 2025 г. в 21:25, Social Boh via sr-users <sr-users@lists.kamailio.org>:
Hello,

thank you for your tip. Can you elaborate a little bit more?

Regards

---
I'm SoCIaL, MayBe

El 31/12/2024 a las 3:38 p. m., Ihor Olkhovskyi via sr-users escribió:
> Kotappa,
>
> It's a quite common scenario and in this case the best would be to
> keep "user - FS instance" link in htable on Kamailio to make sure that
> calls to/from this use will go to dedicated FS instance. Point, you
> need to create this like on calling from user and to user as well.
>
> You can keep them while dialog is running.
>
> Le 31/12/2024 à 05:35, Kotappa Gandudi via sr-users a écrit :
>>
>> Dear Kamailio Team,
>>
>> I hope this email finds you well.
>>
>> I am currently working on a project where Kamailio is being utilized
>> as a load balancer to distribute calls across multiple FreeSWITCH
>> instances. I am using the round-robin technique for load
>> distribution, and it is working perfectly for regular call scenarios.
>>
>> However, I am encountering an issue when handling attended transfer
>> calls. Specifically, for a normal call, Kamailio assigns one
>> FreeSWITCH instance, but during the attended transfer call, it
>> assigns another FreeSWITCH instance. This behavior disrupts the
>> continuity of the call handling.
>>
>> My requirement is for Kamailio to use the same FreeSWITCH instance
>> for the entire call, including any attended transfers. I believe
>> maintaining the same FreeSWITCH instance for the entire call flow
>> would ensure consistency and avoid potential issues.
>>
>> Could you please guide me on how to configure Kamailio to achieve
>> this behavior? I would greatly appreciate any suggestions,
>> configurations, or modules that can help resolve this issue.
>>
>> Thank you for your time and assistance.
>>
>> Looking forward to your response.
>>
>> Best regards,
>> Kotappa Y Gandudi
>>
>>
>> __________________________________________________________
>> 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!
> __________________________________________________________
> 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!
__________________________________________________________
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!


--

BR,
Denys Pozniak