It all depends on who is going to be redirected: the call from Kamailio to a different endpoint, or the originator is informed to redirect the call?

In case you have an ingress client that sends an INVITE to Kamailio and Kamailio needs to inform the client that the call must be redirected to a different IP address, I use:

remove_hf("Contact"); # removes original contact header, if any
append_to_reply("Contact: $myNewContactHeader)\r\n");
send_reply("300", "Multiple Choice");

If you only wish to redirect the call from Kamailio to a different destination endpoint, modifying $ru is enough.

Atenciosamente / Kind Regards / Cordialement / Un saludo,


Sérgio Charrua



On Wed, Mar 26, 2025 at 12:06 PM fabien via sr-users <sr-users@lists.kamailio.org> wrote:
Hello everyone. I'm trying to redirect a call directly through kamailio by modifying the $ru variable. Just wondering if this is the right method or if there is a better way to do it. thanks
__________________________________________________________
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!