<div dir="auto">Thanks Marco! </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 10 Sep 2020, 11:28 Marco Capetta, <<a href="mailto:mcapetta@sipwise.com">mcapetta@sipwise.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<tt>Thank Andrew for reporting this bug.<br>
<br>
The issue has been addressed internally with ticket number
TT#92600.<br>
It will be fixed soon and back-ported to mr8.5.<br>
<br>
Cheers<br>
Marco<br>
</tt><br>
<div>On 9/4/20 4:33 PM, Andrew Pogrebennyk
wrote:<br>
</div>
<blockquote type="cite">
<pre>Hi,
it seems that $var(caller_uri) is not cleared after being used for
setting From header in mr8.5.1.
I have seen that even with outbound_pai_user=None the PAI is set to
the same value as From. I see "Prepare PAI... no selector" messages
and then "Setting PAI". (This is a call from local user to PSTN where
provider is not supposed to get PAI so it's disabled on peering
server)
I think that before line #PAI anonymization somewhere there should be
$var(caller_uri) = ""; because later it is used for setting
$var(temp_hdr_pai) from it.
But when doing just this, PAI is added as: <> so I also think that
another safety check is required to not add empty brackets. The
following seems to do the trick although not very nice/clean.
</pre>
<blockquote type="cite">
<pre>diff --git a/templates/etc/kamailio/proxy/proxy.cfg.customtt.tt2
b/templates/etc/kamailio/proxy/proxy.cfg.customtt.tt2 index
61766a2..158d184 100644 ---
a/templates/etc/kamailio/proxy/proxy.cfg.customtt.tt2 +++
b/templates/etc/kamailio/proxy/proxy.cfg.customtt.tt2 @@ -10258,7
+10258,7 @@ route[ROUTE_SET_CALLER_CLI] $var(temp_hdr_from) = "\"" +
$var(out_from_display) + "\" <" + $var(caller_uri) + ">" +
$var(temp_hdr_from); $(x_hdr(From)[*]) = $var(temp_hdr_from); }
-
+ $var(caller_uri) = "";
# PAI Anonymisation
if($avp(s:caller_clir) != 1 &&
$xavp(caller_real_prefs[0]=>pai_clir) == 1) {
@@ -10341,19 +10341,24 @@ route[ROUTE_SET_CALLER_CLI]
$var(temp_hdr_pai) =
$(x_hdr(P-Asserted-Identity){s.substr,$var(temp_hdr_len),0}); }
}
- if($var(out_pai_display) == 0)
+ if($var(caller_uri) == "")
+ {
+ xlog("L_NOTICE", "Skip PAI setting because
selector is not set - [% logreq %]\n");
+ }
+ else if($var(out_pai_display) == 0)
{
xlog("L_NOTICE", "Setting PAI to
'<«$var(caller_uri)»>' - [% logreq %]\n"); $var(temp_hdr_pai) = "<" +
$var(caller_uri) + ">" + $var(temp_hdr_pai);
$(x_hdr(P-Asserted-Identity)[*]) = $var(temp_hdr_pai);
+ $dlg_var(pai) = $var(temp_hdr_pai);
}
else
{
xlog("L_NOTICE", "Setting PAI to
'«$var(out_pai_display)» <«$var(caller_uri)»>' - [% logreq %]\n");
$var(temp_hdr_pai) = "\"" + $var(out_pai_display) + "\" <" +
$var(caller_uri) + ">" + $var(temp_hdr_pai);
$(x_hdr(P-Asserted-Identity)[*]) = $var(temp_hdr_pai);
+ $dlg_var(pai) = $var(temp_hdr_pai);
}
- $dlg_var(pai) = $var(temp_hdr_pai);
# set the PPI header
if($var(to_pstn) == 1 &&
($var(use_peer_outbound_preferences) == 1 ||
$var(forced_outbound_call_to_peer) == 0))
</pre>
</blockquote>
<pre>
Please consider to fix it in next release/build.
</pre>
</blockquote>
<br>
<div>-- <br>
<div style="line-height:16px;margin:6px 0;padding:8px 8px 8px 8px;border-top:1px #aeb1a6 dotted;border-bottom:1px #aeb1a6 dotted;font-family:'Lucida Sans',Lucida Grande,Verdana,Arial,Sans-Serif;font-size:11px;color:#555555"> <strong style="color:#333333;text-transform:uppercase;font-size:10px"> Marco Capetta </strong> <br>
VoIP Developer
<p> <a href="http://www.sipwise.com" style="color:rgb(0,136,204)!important;text-decoration:none!important;border-bottom:1px dotted #aaa" target="_blank" rel="noreferrer"> Sipwise GmbH </a> , Campus
21/Europaring F15<br>
AT-2345 Brunn am Gebirge </p>
<p> Phone: <a href="tel:+4313012044" style="color:rgb(0,136,204)!important;text-decoration:none!important;border-bottom:1px dotted #aaa" target="_blank" rel="noreferrer"> +43(0)1 301 2044 </a> <br>
Email: <a href="mailto:mcapetta@sipwise.com" style="color:rgb(0,136,204)!important;text-decoration:none!important;border-bottom:1px dotted #aaa" target="_blank" rel="noreferrer"> mcapetta@sipwise.com </a> <br>
Website: <a href="http://www.sipwise.com" style="color:rgb(0,136,204)!important;text-decoration:none!important;border-bottom:1px dotted #aaa" target="_blank" rel="noreferrer"> www.sipwise.com </a> </p>
<p>
Particulars according Austrian Companies Code paragraph 14<br>
"Sipwise GmbH" - Europaring F15 - 2345 Brunn am Gebirge<br>
FN:305595f, Commercial Court Vienna, ATU64002206
</p>
</div>
</div>
</div>
</blockquote></div>