<div dir="ltr"><div dir="ltr">This Medium post might also be handy:<br><br><a href="https://medium.com/@tumalevich/kamailio-registration-replication-without-dmq-65e225f9a8a7">https://medium.com/@tumalevich/kamailio-registration-replication-without-dmq-65e225f9a8a7</a><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 14, 2018 at 1:57 PM Daniel Tryba <<a href="mailto:d.tryba@pocos.nl">d.tryba@pocos.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Sep 13, 2018 at 08:19:00AM +0000, Nathanael Eneroth wrote:<br>
> UA1<--->KAM1<---->KAM2<---->UA2<br>
> int1    int1      int3      int3<br>
>         int2      int2<br>
> <br>
<br>
> I would like KAM1 to forward all SIP requests destined to int3 via<br>
> KAM2 and vice versa. I am aware of the routing logic in<br>
> 'kamailio.cfg', but i find rather excessive. Pseudo code of what i'm<br>
> trying to achieve:<br>
<br>
This is a very basic question, but I can't find any explanation/examples<br>
about how to do this. Routing calls happens on<br>
either <br>
$du <a href="https://www.kamailio.org/wiki/cookbooks/5.1.x/pseudovariables#du_-_destination_uri" rel="noreferrer" target="_blank">https://www.kamailio.org/wiki/cookbooks/5.1.x/pseudovariables#du_-_destination_uri</a><br>
of <br>
$ru <a href="https://www.kamailio.org/wiki/cookbooks/5.1.x/pseudovariables#ru_-_request_uri" rel="noreferrer" target="_blank">https://www.kamailio.org/wiki/cookbooks/5.1.x/pseudovariables#ru_-_request_uri</a><br>
<br>
You can manipulate components like the domain with $dd/$rd. Changing<br>
them and than calling t_relay() will route the calls to somewhere else.<br>
Regaring you examples: TIMTOWTDI<br>
<br>
>         if (is_method("INVITE")) {<br>
>              if(dst_ip == int3)<br>
>                  set_next_kamailio_server(KAM2)<br>
>     }<br>
<br>
if()<br>
{<br>
        $rd="ip/dnsofkam2";<br>
        route(RELAY);<br>
        exit;<br>
}<br>
<br>
<br>
> Or:<br>
> <br>
>         if (is_method("INVITE")) {<br>
>              if(callee is unkown)<br>
>                  ask_kamailio_server(KAM2)<br>
>     }<br>
<br>
if(!location())<br>
{<br>
        $rd="ip/dnsofkam2";<br>
        route(RELAY);<br>
        exit;<br>
}<br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>