<div dir="ltr"><div><div><div><div>Hi,<br><br></div>I have not tested this, but try:<br><br>$avp(s:divhdr) = $(hdr(Diversion)[$var(i)]);<br></div>avp_subst(&quot;$avp(s:divhdr)&quot;, &quot;/.*sip:\+45(.*)(@.*)/\1/&quot;); # Extract number between +45 and @<br>
</div><br>if (is_user_in(&quot;$avp(s:divhdr)&quot;, &quot;1&quot;) { ... }<br><br></div><div>Please note that there can be more than one Diverseion header. In that case you can use:<br><br>                        $var(i)=0;<br>
                        while($(hdr(Diversion)[$var(i)]) != $null ) {<br>                                $avp(s:divhdr) = $(hdr(Diversion)[$var(i)]);<br>                                xlog(&quot;L_WARN&quot;, &quot;$avp(s:divhdr)&quot;);<br>
<br><br>                                $var(i) = $var(i) +1;<br>                        }<br><br><br></div><div><br></div>/Morten<br><div><br><div><div><br><br></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Apr 9, 2013 at 11:12 AM, phillman25 <span dir="ltr">&lt;<a href="mailto:phillman25@gmail.com" target="_blank">phillman25@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Dear List<div><br></div><div>I am currently using the group module to authenticate inbound calls using the From header using the below code:</div><div><br></div><div><div>         if (!is_user_in(&quot;From&quot;, &quot;1&quot;)) {</div>

<div>         sl_send_reply(&quot;403&quot;, &quot;NOT ALLOWED&quot;);</div><div>         exit;</div><div>         };</div><div>         };</div><div><br></div><div>I want to now authenticate the Diversion header, when the call is diverted, the same way as above using the group module how could i proceed with this?</div>

<div><br></div><div>thanking you in advance</div><div>Phillip</div><div><br></div><div><br></div></div></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Morten Isaksen<br>
</div>