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

Marco Capetta mcapetta at sipwise.com
Thu Sep 10 05:27:58 EDT 2020


Thank Andrew for reporting this bug.

The issue has been addressed internally with ticket number TT#92600.
It will be fixed soon and back-ported to mr8.5.

Cheers
Marco

On 9/4/20 4:33 PM, Andrew Pogrebennyk wrote:
> 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.

-- 
*Marco Capetta *
VoIP Developer

Sipwise GmbH <http://www.sipwise.com> , Campus 21/Europaring F15
AT-2345 Brunn am Gebirge

Phone:  +43(0)1 301 2044 <tel:+4313012044>
Email:  mcapetta at sipwise.com <mailto:mcapetta at sipwise.com>
Website:  www.sipwise.com <http://www.sipwise.com>

Particulars according Austrian Companies Code paragraph 14
"Sipwise GmbH" - Europaring F15 - 2345 Brunn am Gebirge
FN:305595f, Commercial Court Vienna, ATU64002206

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20200910/6b79dd78/attachment-0002.html>


More information about the Spce-user mailing list