<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p><br>
</p>
<p>at least the next line:</p>
<p><br>
</p>
<p>$ru=$ru+"transport=tcp";</p>
<p><br>
</p>
<p>should be like:</p>
<p><br>
</p>
<p>$ru=$ru+";transport=tcp";</p>
<p><br>
</p>
<p>Note the ; in front of transport.</p>
<p><br>
</p>
<p>But in this case, do you want to change the request uri
(r-uri/$ru) or destination uri ($du)?<br>
</p>
<p><br>
</p>
<p>Cheers,<br>
Daniel</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 17.12.18 08:26, YAS0 CANER wrote:<br>
</div>
<blockquote type="cite"
cite="mid:VI1PR0401MB2446BF1187D7ADC00DB77B3BEFBC0@VI1PR0401MB2446.eurprd04.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
Hello,</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
rewritehostporttrans function solves my problem. but there is
another problem. rewritehostporttrans function dont pass
$avp(val) so t_relay() gives invalid uri Error.</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
Thanks</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
For example</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
1: it works good </div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
rewritehostporttrans("test1.test:5060;transport=tcp");<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span>if (!t_relay_to_tcp()) {<br>
</span>
<div> xlog("L_ERR", "Error t_relay \n");<br>
</div>
<div> t_reply("500","Server - ERROR ");<br>
</div>
<div> exit;<br>
</div>
<span> }</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span style="margin: 0px; font-family: Calibri, Helvetica,
sans-serif; background-color: rgb(255, 255, 255); display:
inline !important">xlog(</span><span style="margin: 0px;
font-family: Calibri, Helvetica, sans-serif; background-color:
rgb(255, 255, 255); display: inline !important">[uri-dst :<span
style="margin: 0px"> </span><span style="margin: 0px;
background-color: rgb(255, 255, 255); display: inline
!important">test1</span>.test:5060;transport=tcp] [uri-now
: <null> ]</span><span style="margin: 0px; font-family:
Calibri, Helvetica, sans-serif; background-color: rgb(255,
255, 255); display: inline !important">)</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span style="margin: 0px; font-family: Calibri, Helvetica,
sans-serif; background-color: rgb(255, 255, 255); display:
inline !important"><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
2: invalid uri error</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
$avp(dstx)=$_s($rd:$rp;transport=tcp);<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
rewritehostporttrans("$avp(dstx)");<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span style="margin: 0px; font-family: Calibri, Helvetica,
sans-serif; background-color: rgb(255, 255, 255); display:
inline !important">xlog(</span><span style="margin: 0px;
font-family: Calibri, Helvetica, sans-serif; background-color:
rgb(255, 255, 255); display: inline !important">[uri-dst :<span> </span><span
style="margin: 0px; background-color: rgb(255, 255, 255);
display: inline !important">test1</span>.test:5060;transport=tcp]
[uri-now : <null> ]</span><span style="margin: 0px;
font-family: Calibri, Helvetica, sans-serif; background-color:
rgb(255, 255, 255); display: inline !important">)</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span style="margin: 0px; font-family: Calibri, Helvetica,
sans-serif; background-color: rgb(255, 255, 255); display:
inline !important"><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
3: invalid uri error</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<div style="margin: 0px; font-size: 12pt; font-family: Calibri,
Helvetica, sans-serif">
$avp(dstx)=$rd+":"+$rp+";transport=tcp;";<br>
</div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri,
Helvetica, sans-serif">
rewritehostporttrans("$avp(dstx)");</div>
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span style="font-family: Calibri, Helvetica, sans-serif;
background-color: rgb(255, 255, 255); display: inline
!important">xlog(</span><span style="font-family: Calibri,
Helvetica, sans-serif; background-color: rgb(255, 255, 255);
display: inline !important">[uri-dst : <span
style="font-family: Calibri, Helvetica, sans-serif;
background-color: rgb(255, 255, 255); display: inline
!important">
test1</span>.test:5060;transport=tcp] [uri-now :
<null> ]</span><span style="font-family: Calibri,
Helvetica, sans-serif; background-color: rgb(255, 255, 255);
display: inline !important">)</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span style="font-family: Calibri, Helvetica, sans-serif;
background-color: rgb(255, 255, 255); display: inline
!important"><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
4: <span style="font-family: Calibri, Helvetica, sans-serif;
background-color: rgb(255, 255, 255); display: inline
!important">invalid uri error</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span style="font-family: Calibri, Helvetica, sans-serif;
background-color: rgb(255, 255, 255); display: inline
!important"><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
$ru=$ru+"transport=tcp";<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
5:invalid Uri <span style="font-family: Calibri, Helvetica,
sans-serif; background-color: rgb(255, 255, 255); display:
inline !important">error</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span>$var(dstx)=$_s($rd:$rp;transport=tcp);<br>
</span><span>rewritehostporttrans("$var(dstx)");</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span>xlog([uri-dst : test1.test:5060;transport=tcp] [uri-now :
<null> ])</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
face="Calibri, sans-serif" color="#000000"><b>From:</b>
Daniel-Constantin Mierla <a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com"><miconda@gmail.com></a><br>
<b>Sent:</b> Friday, December 14, 2018 5:08 PM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List; YAS0 CANER<br>
<b>Subject:</b> Re: [SR-Users] Problem with selection
Transport Protocol - MultiHomed Problem</font>
<div> </div>
</div>
<div style="background-color:#FFFFFF">
<p style="margin-top: 0px; margin-bottom: 0px;">Hello,</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;">is there any
naptr or srv dns record behind test1.test domain? Or just
A/CNAME record?</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Cheers,<br>
Daniel</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<div class="x_moz-cite-prefix">On 14.12.18 14:35, YAS0 CANER
wrote:<br>
</div>
<blockquote type="cite">
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
Hello;</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
i want to force message to send over TCP and IPv6 . so it
should be R/W variable. When i set $fs or
force_send_socket() it gives error about mismatch protocol !</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
Thanks.</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
Yasin CANER</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font
style="font-size:11pt" face="Calibri, sans-serif"
color="#000000"><b>From:</b> sr-users
<a class="x_moz-txt-link-rfc2396E"
href="mailto:sr-users-bounces@lists.kamailio.org"
moz-do-not-send="true">
<sr-users-bounces@lists.kamailio.org></a> on
behalf of YAS0 CANER <a class="x_moz-txt-link-rfc2396E"
href="mailto:caner_yaso@hotmail.com"
moz-do-not-send="true">
<caner_yaso@hotmail.com></a><br>
<b>Sent:</b> Friday, December 14, 2018 4:27 PM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> [SR-Users] Problem with selection
Transport Protocol - MultiHomed Problem</font>
<div> </div>
</div>
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
Hello , </div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
i have trouble about selection transport protocol. i have
tried so many thing but couldnt find TM selected which
IPv? and protocol type (TCP or UDP)</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
For example;</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
i have 2 interface ipv6 and ipv4. i will route my message
(INVITE-Register etc.) another node that use TCP and IPV6
, domain name is test1.test. TM module or some module
resolve this domain to IPV6:UDP but i want to sent it
over IPV6:TCP socket. so i cannot know which protocol is
resolved and cannot route the right socket. </div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
$du variable show only <a class="x_moz-txt-link-freetext"
href="sip:ali@test1.test" moz-do-not-send="true">
sip:ali@test1.test</a> </div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
Conclusion : There isn't any pseudo value about which <u>destination
of IP version</u> will use.</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
Thanks </div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
Flow:</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
UAC (IPv4:UDP) ----------> Kamailio (MultiHomed)
----> (TCP:IPv6)Kamailio</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
----</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
Kamailo (multiHomed ) cfg</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
------</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span>auto_bind_ipv6=1<br>
</span>
<div>dns_try_ipv6=yes<br>
</div>
<div>dns_retr_time=1<br>
</div>
<div>dns_retr_no=1<br>
</div>
<div>dns_cache_flags=4<br>
</div>
<div>mhomed=1<br>
</div>
<div>fork=yes<br>
</div>
<span>tcp_source_ipv6 = [fd61:c23c:b3b6::5]</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span>listen=tcp:[fd61:c23c:b3b2::5]:5060<br>
</span>
<div>listen=udp:[fd61:c23c:b3b2::5]:5060<br>
</div>
<div>listen=<a class="x_moz-txt-link-freetext" href=""
moz-do-not-send="true">udp:192.168.1.107:5060</a><br>
</div>
<span>listen=tcp:192.168.1.107:5060</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span>route []{</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span><span><br>
</span>
<div> if($dP=="TCP"){<br>
</div>
<div> xlog("L_INFO","[<span
style="font-family:Calibri,Helvetica,sans-serif;
background-color:rgb(255,255,255);
display:inline!important">route</span>] [TCP] 1\n");<br>
</div>
<div> if (!t_relay_to_tcp()) {<br>
</div>
<div> xlog("L_ERR", "Error t_relay [<span
style="font-family:Calibri,Helvetica,sans-serif;
background-color:rgb(255,255,255);
display:inline!important">route</span>] \n");<br>
</div>
<div> t_reply("500","Server - ERROR ");<br>
</div>
<div> exit;<br>
</div>
<div> }<br>
</div>
<div> } else if($dP=="TCP"){<br>
</div>
<div> xlog("L_INFO","[<span
style="font-family:Calibri,Helvetica,sans-serif;
background-color:rgb(255,255,255);
display:inline!important">route</span>] [TCP] 2\n");<br>
</div>
<div> if (!t_relay_to_tcp()) {<br>
</div>
<div> xlog("L_ERR", "Error t_relay [<span
style="font-family:Calibri,Helvetica,sans-serif;
background-color:rgb(255,255,255);
display:inline!important">route</span>] \n");<br>
</div>
<div> t_reply("500","Server - ERROR ");<br>
</div>
<div> exit;<br>
</div>
<div> }<br>
</div>
<div> }else if($dP=="UDP"){</div>
<div> xlog("L_INFO","[route] [UDP] 1\n");<br>
</div>
<div> if (!t_relay_to_udp()) {<br>
</div>
<div> xlog("L_ERR", "Error t_relay [<span
style="font-family:Calibri,Helvetica,sans-serif;
background-color:rgb(255,255,255);
display:inline!important">route</span>] \n");<br>
</div>
<div> t_reply("500","Server - ERROR ");<br>
</div>
<div> exit;<br>
</div>
<div> }<br>
</div>
<div> }else{</div>
<div> xlog("L_INFO","[<span
style="font-family:Calibri,Helvetica,sans-serif;
background-color:rgb(255,255,255);
display:inline!important">route</span>] [??] 1\n");<br>
</div>
<div> if (!t_relay()) {<br>
</div>
<div> xlog("L_ERR", "Error t_relay [<span
style="font-family:Calibri,Helvetica,sans-serif;
background-color:rgb(255,255,255);
display:inline!important">route</span>] \n");<br>
</div>
<div> t_reply("500","Server - ERROR ");<br>
</div>
<div> exit;<br>
</div>
<div> }<br>
</div>
<span> }</span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;
font-size:12pt; color:rgb(0,0,0)">
<span>}</span></div>
</div>
<br>
<fieldset class="x_mimeAttachmentHeader"></fieldset>
<pre class="x_moz-quote-pre">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="x_moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" moz-do-not-send="true">sr-users@lists.kamailio.org</a>
<a class="x_moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="x_moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="x_moz-txt-link-abbreviated" href="http://www.asipto.com" moz-do-not-send="true">www.asipto.com</a>
<a class="x_moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a class="x_moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 6-8, 2019 -- <a class="x_moz-txt-link-abbreviated" href="http://www.kamailioworld.com" moz-do-not-send="true">www.kamailioworld.com</a>
Kamailio Advanced Training -- <a class="x_moz-txt-link-abbreviated" href="http://www.asipto.com" moz-do-not-send="true">www.asipto.com</a></pre>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 6-8, 2019 -- <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a>
Kamailio Advanced Training -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a></pre>
</body>
</html>