<div dir="ltr"><div><div><div>Hello! I'm having this issue and I'm not able to solve 
it. I have searched it many times on the Internet but I found nothing, 
that's why I am asking here... I'm sorry I do not wanna cause any 
troubles but I need to get this done...<br><br></div>This is my 
scenario, I want to make a call through a Kamailio server that redirects
 to another server. I have an User A registered to Server A and a User B
 registered to Server B, what I want to do is the following:<br><br>User
 A calls User B using Server A, because Server A doesn't have the User B
 the Server A will redirect to Server B and make the call. I'm using 
Ekiga and of course Kamailio (and I want to make it work both ways).<br><br>This is the code I'm using to do this in kamailio.cfg, I replaced this lines of code:<br><br><i>$avp(oexten) = $rU;<br>    if (!lookup("location")) {<br>        $var(rc) = $rc;<br>        route(TOVOICEMAIL);<br>        t_newtran();<br>        switch ($var(rc)) {<br>            case -1:<br>            case -3:<br>                send_reply("404", "Not Found");<br>                exit;<br>            case -2:<br>                send_reply("405", "Method Not Allowed");<br>                exit;<br>        }<br>    }</i><br><br></div><div>For this ones:<br></div><div><br><i>$avp(oexten) = $rU;<br>    if (!lookup("location")) {<br>      sl_send_reply("300",("REDIRECT"));<br>      rewritehostport("10.80.129.177");<br>      forward(uri:host,uri:port);<br>      break;<br>      }<br></i></div><br></div><div>And it didn't work, then I putted the lines above as the following:<br><br><i>$avp(oexten) = $rU;<br>    if (!lookup("location")) {<br>      </i><i><i> forward(uri:host,uri:port);</i><br>      rewritehostport("10.80.129.177");<br></i><i><i>      sl_send_reply("300",("REDIRECT"));</i>      <br>      break;<br>      }</i><br><br></div><div>And
 it worked but if I do a Wireshark Capture on the Server I get a lot of 
REDIRECT packets and my teacher says this is wrong, that I should only 
get 1. He did not help me and said I must learn and I want but I'm not 
able to understand what's going on, I need to do this because I want to 
pass the exam and not to fail...<br><br></div>Again I'm sorry for taking your time, I'm asshamed.<br><br>Thank you very much</div>