<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<font face="monospace">Hi Ben,<br>
<br>
Could you post the xlog output and the resulting 302 ? Also be
sure you are using the latest 3.2 version - please post the
`opensips -V` here.<br>
<br>
Regards,<br>
</font>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
<a class="moz-txt-link-freetext" href="https://www.siphub.com">https://www.siphub.com</a></pre>
<div class="moz-cite-prefix">On 11/14/23 4:00 PM, Ben Bliss wrote:<br>
</div>
<blockquote type="cite"
cite="mid:LO2P123MB18231FD0EDF604D435DC94B6FCB2A@LO2P123MB1823.GBRP123.PROD.OUTLOOK.COM">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">I am using Opensips v.3.2 and I am
attempting to replicate the 302 redirect outlined on the blog
(<a
href="https://blog.opensips.org/2018/07/05/handling-sip-redirect-requests-in-realtime/"
moz-do-not-send="true">https://blog.opensips.org/2018/07/05/handling-sip-redirect-requests-in-realtime/</a>),
but am running into an odd issue.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am using exec to execute an external
program, which returns a URI as a variable, which is then used
to populate the $branch field, which is then returned as the
contact URI in the 302 response.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For reasons I cannot explain, even though
the URI is correctly formatted in the xlogs which I print off
during the call request, when the 302 message is received, the
Contact URI is missing the end ‘>‘character. This means the
server the 302 is being sent to doesn’t ACK the message, as
the contact URI is invalid.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If I specify the URI directly within
OpenSIPs, then the contact header is then formatted correctly.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Initially I thought the issue was related
to the script returning the variable (bash script), so I
swapped to a Golang program, essentially returning the same
URI, but the same behaviour occurs with this as well.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The script is setup as follows…<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> if ( $si == '10.10.14.71'
&& is_method("INVITE") ) {<o:p></o:p></p>
<p class="MsoNormal">
exec("/usr/local/bin/sbc-route", $tU, $var(out));<o:p></o:p></p>
<p class="MsoNormal"> xlog("Value
returned from Re-direct Script is $var(out)");<o:p></o:p></p>
<p class="MsoNormal"> $branch =
$var(out);<o:p></o:p></p>
<p class="MsoNormal"> xlog("Target is set
as $branch");<o:p></o:p></p>
<p class="MsoNormal"> send_reply(302,
"Server Redirect");<o:p></o:p></p>
<p class="MsoNormal"> exit;<o:p></o:p></p>
<p class="MsoNormal"> }<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Can anyone offer any ideas as to why this
may be occurring?<o:p></o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>