<div dir="ltr"><div>How about something like this:</div><pre class="gmail-code">  $vz(i) = 0;<br>  pv_unset("$vn(save_ai)")<br>  while ($vz(i) < <span class="gmail-br0"></span>$hdrc<span class="gmail-br0">(P-Asserted-Identity</span><span class="gmail-br0">)</span>) {<br></pre><pre class="gmail-code">      $vn(temp_holder) = $(hdr(P-Asserted-Identity)[$vz(i)]);</pre><pre class="gmail-code">      if ( $(vn(temp_holder){nameaddr.uri}{uri.scheme}) =~ "^sip" ) {<br></pre><pre class="gmail-code">            $vn(save_ai) = $vn(temp_holder);<br></pre><pre class="gmail-code">            break;<br>      }<br>  }<br><br></pre><pre class="gmail-code">  if ( $vn(save_ai) != $null ) {<br>        remove_hf("P-Asserted-Identity");
        append_hf("P-Asserted-Identity: $vn(save_ai)\r\n");<br>  }<br><br></pre><pre class="gmail-code">might need some tuning, and you need the textops module.<br></pre></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 29 Jan 2020 at 14:19, Duarte Rocha <<a href="mailto:duarterocha91@gmail.com">duarterocha91@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto">Greetings, </div><div dir="auto"><br></div><div dir="auto">I have a client that sends me two P-Asserted-Identity headers, one with SIP URI and one with tel URI.</div><div dir="auto"><br></div><div dir="auto">The pseudo variable $ai returns the topmost P-Asserted-Identity header and I only need the one with the SIP URI.</div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto">I could also work with something different than $ai for this scenario.</div><div dir="auto"><br></div><div dir="auto">Best Regards,</div></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>