[Spce-user] Question about PAI in mr8.5.1

Andrew Pogrebennyk andrew.nau.ua at gmail.com
Fri Sep 4 10:33:48 EDT 2020


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.

> 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))

Please consider to fix it in next release/build.
-- 
Regards,
Andrew



More information about the Spce-user mailing list