Hello,<br><br><div class="gmail_quote">On Wed, Mar 10, 2010 at 7:05 PM, Uriel Rozenbaum <span dir="ltr">&lt;<a href="mailto:uriel.rozenbaum@gmail.com">uriel.rozenbaum@gmail.com</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;">
Thanks guys, I&#39;m using 1.5.3<br><br>So I can use<br><br>define(`SHOULD_AUTH&#39;, 1)<br>...<br>if(SHOULD_AUTH)<br>{<br>     route(5); #Auth<br>}<br><br>within my cfg file? <br></blockquote><div><br>you cannot have that for now. It is for controlling which parts of config is loaded, like:<br>
<br>#!define AUTH<br><br>#ifdef AUTH<br>   route[AUTH);<br>#!endif<br><br>The default kamailio config in 3.0 use it to provide auth, nat, presence, etc. See it online at:<br><a href="http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob;f=etc/kamailio.cfg;hb=kamailio_3.0">http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob;f=etc/kamailio.cfg;hb=kamailio_3.0</a><br>
<br>You can achieve similar functionality as you described above with custom cfg global parameters:<br><br><a href="http://www.kamailio.org/dokuwiki/doku.php/features:new-in-3.0.x#custom_cfg_file_parameters">http://www.kamailio.org/dokuwiki/doku.php/features:new-in-3.0.x#custom_cfg_file_parameters</a><br>
<br>auth.enabled = 1<br>...<br>if($sel<span class="br0">(</span>cfg_get.auth.enabled))<br>{<br>     
route(5); #Auth<br>}<br><br>The extra benefit is that you can change the value at runtime without restart.<br><br>Cheers,<br>Daniel<br><br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br><div class="gmail_quote">On Wed, Mar 10, 2010 at 1:48 PM, Henning Westerholt <span dir="ltr">&lt;<a href="mailto:henning.westerholt@1und1.de" target="_blank">henning.westerholt@1und1.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>On Wednesday 10 March 2010, Uriel Rozenbaum wrote:<br>
&gt; The question&#39;s simple, is there any pre-processor command to DEFINE<br>
&gt; constants?<br>
<br>
</div>Hi Uriel,<br>
<br>
in kamailio 3.0 there is also the #define directive, which works more or less<br>
like the one in other languages.<br>
<br>
<a href="http://by-miconda.blogspot.com/2009/12/best-of-new-in-kamailio-300-2-%0Adefine.html" target="_blank">http://by-miconda.blogspot.com/2009/12/best-of-new-in-kamailio-300-2-<br>
define.html</a><br>
<br>
Cheers,<br>
<font color="#888888"><br>
Henning<br>
</font></blockquote></div><br>
</div></div><br>_______________________________________________<br>
Kamailio (OpenSER) - Users mailing list<br>
<a href="mailto:Users@lists.kamailio.org">Users@lists.kamailio.org</a><br>
<a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
<a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Daniel-Constantin Mierla<br>
  <a href="http://www.asipto.com">http://www.asipto.com</a><br>