<br><div class="gmail_quote">On Sat, Sep 18, 2010 at 7:57 AM, Stefano Pisani <span dir="ltr"><<a href="mailto:stefano.pisani@omnianet.it">stefano.pisani@omnianet.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
No I don't.<br>
I want that opensis uses same port of registration for INVITE.<br>
i.e. the client is register on port 5061, opensips uses from port 5061<br>
for INVITE<br></blockquote><div><br>If you are dealing with more than 2 ports, this might get complicated.<br>But in case of just 2 ports, you could check the ReceivedPort and set a bflag during handling of the REGISTER request:<br>
<br>if($Rp == 5060) {<br> setbflag(BFLAG_RECEIVED_ON_PORT_5060);<br>}<br><br>The bflags are saved with the registration, so you can check them in a branch_route called after lookup and force the port to be used to relay the request:<br>
<br>if (lookup("location")) {<br> t_on_branch("USER_BRANCH");<br> if (!t_relay()) {<br> sl_reply_error();<br> exit;<br> }<br>}<br><br>branch_route [USER_BRANCH] {<br> if (isbflagset(BFLAG_RECEIVED_ON_PORT_5060)) {<br>
force_send_socket(MY_IP_ADDRESS:5060);<br> } else {<br> force_send_socket(MY_IP_ADDRESS:5061);<br> }<br>}<br></div></div><br>(obs: I actually, never tested this. I'm writing from my recollections of similar problems I had to deal with).<br>
<br>