<font face="arial,helvetica,sans-serif">Hi Bogdan,<br><br>Thank you, your solution worked!! Is it ok to put &quot;0&quot; in this declaration?<br></font><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">

<font face="arial,helvetica,sans-serif">{&quot;proxy_challenge&quot;,&nbsp;&nbsp;&nbsp;&nbsp; (cmd_function)proxy_challenge,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2,&nbsp; fixup_pvar_pvar, 0, REQUEST_ROUTE},</font><br></blockquote><div><br>I just need my scripting variables (cnonce, nonce_count and if possible digest-algorithm) to finish my gateway.<br>

<br>Regards,<br>Alex<br><br>By the way, have you think about Diameter client in opensips? <br><br><br></div><br><div class="gmail_quote">On Sat, Jun 5, 2010 at 12:23 AM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Alexandre,<br>
<br>
you can use the fixup_pvar_pvar function, but in your implementation<br>
function, take care and evaluate the pvar to the actual string - this<br>
evaluation is not automatically done, but you need to manually do it in<br>
your function.<br>
<br>
For example, see in modules/domain/domain_mod.c :<br>
<br>
{&quot;is_domain_local&quot;, (cmd_function)w_is_domain_local, 1, fixup_pvar_null,<br>
fixup_free_pvar_null, REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|<br>
LOCAL_ROUTE|STARTUP_ROUTE|TIMER_ROUTE},<br>
<br>
and how the w_is_domain_local() handles the parameters.<br>
<div class="im"><br>
Regards,<br>
Bogdan<br>
<br>
Alexandre Westfahl ($B%"%l%C%/%5%s%I%k!!%&%(%9%U%!%k(B) wrote:<br>
</div><div class="im">&gt; My changes are just hack, it may not be optimized. I will make you an<br>
&gt; archive today but could you tell me if fixup_pvar_pvar is supposed to<br>
&gt; do the job correctly? I would like to solve this asap to continue.<br>
&gt;<br>
&gt; Regards,<br>
&gt; Alexandre.<br>
&gt;<br>
&gt; On Fri, Jun 4, 2010 at 4:59 AM, Bogdan-Andrei Iancu<br>
</div><div><div></div><div class="h5">&gt; &lt;<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a> &lt;mailto:<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt; &nbsp; &nbsp; Hi Alexandre,<br>
&gt;<br>
&gt; &nbsp; &nbsp; Could you please send an unified diff with your changes?<br>
&gt;<br>
&gt; &nbsp; &nbsp; Regards,<br>
&gt; &nbsp; &nbsp; Bogdan<br>
&gt;<br>
&gt; &nbsp; &nbsp; Alexandre Westfahl ($B%"%l%C%/%5%s%I%k!!%&%(%9%U%!%k(B) wrote:<br>
&gt; &nbsp; &nbsp; &gt; Hello,<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; I am using OpenSIPS with auth_radius module to simulate to radius<br>
&gt; &nbsp; &nbsp; &gt; client with my Diameter/Radius Gateway. With scripting variables I<br>
&gt; &nbsp; &nbsp; &gt; succeeded for a part but I still have some problems. I change some<br>
&gt; &nbsp; &nbsp; &gt; functions to make opensips and my requests fully compliant to<br>
&gt; &nbsp; &nbsp; RFC 5090.<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; First, there is some bugs in names. For example, two variables have<br>
&gt; &nbsp; &nbsp; &gt; the same name and one of them was with the wrong number to<br>
&gt; &nbsp; &nbsp; parse. Here<br>
&gt; &nbsp; &nbsp; &gt; is a propose change:<br>
&gt; &nbsp; &nbsp; &gt; pvar.c<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; {{&quot;an&quot;, (sizeof(&quot;an&quot;)-1)}, /* */<br>
&gt; &nbsp; &nbsp; &gt; PVT_AUTH_NONCE, pv_get_authattr, 0,<br>
&gt; &nbsp; &nbsp; &gt; 0, 0, pv_init_iname, 5},<br>
&gt; &nbsp; &nbsp; &gt; {{&quot;aR&quot;, (sizeof(&quot;aR&quot;)-1)}, /* */<br>
&gt; &nbsp; &nbsp; &gt; PVT_AUTH_RESPONSE, pv_get_authattr, 0,<br>
&gt; &nbsp; &nbsp; &gt; 0, 0, pv_init_iname, 6},<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; Second, I changed some functions in aaa_radius because I need high<br>
&gt; &nbsp; &nbsp; &gt; customization (to make it compliant with RFC5090).<br>
&gt; &nbsp; &nbsp; &gt; I changed &quot;proxy_challenge&quot; and I want to give as parameters<br>
&gt; &nbsp; &nbsp; realm and<br>
&gt; &nbsp; &nbsp; &gt; nonce (nonce must be done on diameter server). I succeeded in making<br>
&gt; &nbsp; &nbsp; &gt; static parameters but if I try this:<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; xlog(&quot;realm: $var(realm), nonce: $var(nonce)\n&quot;);<br>
&gt; &nbsp; &nbsp; &gt; proxy_challenge( &quot;$var(realm)&quot;, &quot;$var(nonce)&quot;);<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; In xlog, everything is Ok but in proxy_challenge, I obtain variables<br>
&gt; &nbsp; &nbsp; &gt; as they are, e.g.&quot;$var(realm)&quot;. It&#39;s hard to get into opensips<br>
&gt; &nbsp; &nbsp; source<br>
&gt; &nbsp; &nbsp; &gt; in just one day but I found that there is a translator in<br>
&gt; &nbsp; &nbsp; auth_mod.c.<br>
&gt; &nbsp; &nbsp; &gt; Here is the non controlled.<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; {&quot;proxy_challenge&quot;, (cmd_function)proxy_challenge, 2,<br>
&gt; &nbsp; &nbsp; &gt; 0, 0, REQUEST_ROUTE},<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; Obtained values are as I said before.<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; If I try, to activate a translator:<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; {&quot;proxy_challenge&quot;, (cmd_function)proxy_challenge, 2,<br>
&gt; &nbsp; &nbsp; &gt; fixup_pvar_pvar, 0, REQUEST_ROUTE},<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; It&#39;s supposed to work but I obtain &quot;N&quot; for both values.<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; For information, here is my opensips.cfg:<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; # We are in REGISTER part!<br>
&gt; &nbsp; &nbsp; &gt; $var(method)=&quot;REGISTER&quot;;<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; if ($adu == NULL)<br>
&gt; &nbsp; &nbsp; &gt; {<br>
&gt; &nbsp; &nbsp; &gt; radius_send_auth(&quot;Frequest&quot;,&quot;challenge&quot;);<br>
&gt; &nbsp; &nbsp; &gt; #Digest-Realm = $var(realm),Digest-Nonce = $var(nonce),Digest-Qop<br>
&gt; &nbsp; &nbsp; &gt; = $var(qop),Digest-Algorithm = $var(algorithm)<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; xlog(&quot;realm: $var(realm), nonce: $var(nonce)\n&quot;);<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; proxy_challenge( &quot;$var(realm)&quot;, &quot;$var(nonce)&quot;);<br>
&gt; &nbsp; &nbsp; &gt; exit;<br>
&gt; &nbsp; &nbsp; &gt; }<br>
&gt; &nbsp; &nbsp; &gt; else<br>
&gt; &nbsp; &nbsp; &gt; {<br>
&gt; &nbsp; &nbsp; &gt; radius_send_auth(&quot;request&quot;,&quot;result&quot;);<br>
&gt; &nbsp; &nbsp; &gt; xlog( &quot;SECOND REQUEST!!!!!!!!!!!!!!!\n&quot;);<br>
&gt; &nbsp; &nbsp; &gt; }<br>
&gt; &nbsp; &nbsp; &gt; xlog(&quot;**********************************OUT&quot;);<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; I changed all functions after proxy_challenge (like challenge...) to<br>
&gt; &nbsp; &nbsp; &gt; give the nonce, don&#39;t ask for qop (always on) and don&#39;t manage nonce<br>
&gt; &nbsp; &nbsp; &gt; index as it&#39;s not sip server job.<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; I hope I was clear in my questions.<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; Thanks<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; Best regards,<br>
&gt; &nbsp; &nbsp; &gt; Alexandre Westfahl,<br>
&gt; &nbsp; &nbsp; &gt; Keio University, Yokohama<br>
&gt; &nbsp; &nbsp; &gt; Teraoka Lab.<br>
&gt; &nbsp; &nbsp; &gt; Linux User: #458230<br>
&gt; &nbsp; &nbsp; &gt; PGP: EACE5768<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; ------------------------------------------------------------------------<br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &gt; _______________________________________________<br>
&gt; &nbsp; &nbsp; &gt; Devel mailing list<br>
</div></div>&gt; &nbsp; &nbsp; &gt; <a href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a> &lt;mailto:<a href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a>&gt;<br>
<div class="im">&gt; &nbsp; &nbsp; &gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a><br>
&gt; &nbsp; &nbsp; &gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; --<br>
&gt; &nbsp; &nbsp; Bogdan-Andrei Iancu<br>
</div>&gt; &nbsp; &nbsp; <a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a> &lt;<a href="http://www.voice-system.ro" target="_blank">http://www.voice-system.ro</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; _______________________________________________<br>
&gt; &nbsp; &nbsp; Devel mailing list<br>
&gt; &nbsp; &nbsp; <a href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a> &lt;mailto:<a href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a>&gt;<br>
<div><div></div><div class="h5">&gt; &nbsp; &nbsp; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Alexandre Westfahl,<br>
&gt; Keio University, Yokohama<br>
&gt; Teraoka Lab.<br>
&gt; Linux User: #458230<br>
&gt; PGP: EACE5768<br>
&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Devel mailing list<br>
&gt; <a href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a><br>
&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a><br>
&gt;<br>
<br>
<br>
--<br>
Bogdan-Andrei Iancu<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
<br>
<br>
_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Alexandre Westfahl,<br>Keio University, Yokohama<br>Teraoka Lab.<br>Linux User: #458230<br>PGP: EACE5768<br>