<div>
<div>
<div>Hi all,</div>
<div>&nbsp;</div>
<div>I'm very new to OpenSER and I would like to ask for your advice to find a solution for my problem:</div>
<div>&nbsp;</div>
<div>I have a SIP gateway (A) which uses UDP transport and a SIP endpoint (B) which only supports TCP. I'd like to use OpenSER to convert UDP to TCP. The second issue is that the TCP endpoint (B) will redirect the incoming INVITE to itself to another TCP port using a &quot;302 Moved temporarily&quot; containing a CONTACT header. 
</div>
<div>&nbsp;</div>
<div>Here is my approach:</div>
<div>My current understanding is that I would have to add something to the routing block to select the traffic for my TCP endpoint. Then I would have to add route where I would have to handle the TCP forwarding, something like: 
</div>
<div>&nbsp;</div>
<div>if (uri=~&quot;...&quot;) {<br>t_relay_to_tcp(&quot;&lt;ip&gt;&quot;, &quot;5060&quot;);</div>
<div>}</div>
<div>&nbsp;</div>
<div>This looks very straight forward and should solve the UDP to TCP issue as I understand it. Is this approach correct?</div>
<div>&nbsp;</div>
<div>For the second issue I don't have a solution right now. As described above the TCP endpoint (B)&nbsp;will answer something like</div>
<div>&nbsp;</div>
<div>SIP/2.0 302 Moved Temporarily<br>FROM: &lt;sip:tel@HOST_A&gt;;tag=1c552078080<br>TO: &lt;sip:tel@HOST_B&gt;;tag=7189e7deae<br>CSEQ: 1 INVITE<br>CALL-ID: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:552077216117200615500@HOST_A" target="_blank">
552077216117200615500@HOST_A </a><br>MAX-FORWARDS: 70<br>VIA: SIP/2.0/TCP HOST_A;branch=z9hG4bKac552089789;alias<br>CONTENT-LENGTH: 0<br>SERVER: RTCC/2.0.6011.0<br>CONTACT: &lt;sip:tel@HOST_B:1223;transport=tcp;maddr=HOST_B;x-mss-call-id=552077216117200615500%40HOST_B&gt; 
<br>&nbsp;</div>
<div>I want OpenSER now to send out another INVITE via TCP to HOST_B Port 1223 (but the port changes&nbsp;for each call). In principle I would need a possiblity to extract the host and the port out of the CONTACT header of the message to send another t_relay_to_tcp(&quot;&lt;host&gt;&quot;, &quot;&lt;port&gt;&quot;). But how to do that? 
</div>
<div>&nbsp;</div>
<div>Or is there another possibility to tell OpenSER to take the target info out of the&nbsp;CONTACT header?</div>
<div>&nbsp;</div>
<div>Thanks in advance!</div></div>
<div><span>
<div>Ingmar</div></span></div></div>