[SR-Users] How to make a distinction between sip and tel uri
George Diamantopoulos
georgediam at gmail.com
Wed Jan 29 15:18:36 CET 2020
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 <duarterocha91 at gmail.com> 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
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200129/b17de272/attachment.html>
More information about the sr-users
mailing list