How about something like this:
$vz(i) = 0;
pv_unset("$vn(save_ai)")
while ($vz(i) < $hdrc(P-Asserted-Identity)) {
$vn(temp_holder) = $(hdr(P-Asserted-Identity)[$vz(i)]);
if ( $(vn(temp_holder){nameaddr.uri}{uri.scheme}) =~ "^sip" ) {
$vn(save_ai) = $vn(temp_holder);
break;
}
}
if ( $vn(save_ai) != $null ) {
remove_hf("P-Asserted-Identity");
append_hf("P-Asserted-Identity: $vn(save_ai)\r\n");
}
might need some tuning, and you need the textops module.
On Wed, 29 Jan 2020 at 14:19, Duarte Rocha <[email protected]> wrote:
> Greetings,
>
> I have a client that sends me two P-Asserted-Identity headers, one with
> SIP URI and one with tel URI.
>
> The pseudo variable $ai returns the topmost P-Asserted-Identity header and
> I only need the one with the SIP URI.
>
> How should i proceed ? Is there a way to delete the one with tel URI? the
> header removal functions i find only work with header name.
>
> I could also work with something different than $ai for this scenario.
>
> Best Regards,
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> [email protected]
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
_______________________________________________
Kamailio (SER) - Users Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users