Hello,<br><br><div class="gmail_quote">On Wed, Mar 10, 2010 at 7:57 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;">
Daniel,<br><br>I got the idea, but maybe I used a lame example. I&#39;ll need the same method to activate or deactivate some custom features like prepending some prefix and stuff.<br><br>Maybe I&#39;ll just set some variable and ask for that. Do you agree?<br>
</blockquote><div><br>if activation/deactivation is needed at runtime, then custom global parameters is clearly the way to go. You can update via sercmd cli or siremis web interface the value at runtime.<br><br>Cheers,<br>
Daniel<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;"><font color="#888888">
<br>Uriel</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Wed, Mar 10, 2010 at 3:35 PM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</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;">
Hello,<br><br><div class="gmail_quote"><div>On Wed, Mar 10, 2010 at 7:05 PM, Uriel Rozenbaum <span dir="ltr">&lt;<a href="mailto:uriel.rozenbaum@gmail.com" target="_blank">uriel.rozenbaum@gmail.com</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;">
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><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" target="_blank">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" target="_blank">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>(</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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div>
<div><div></div><div><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></div>_______________________________________________<br>
Kamailio (OpenSER) - Users mailing list<br>
<a href="mailto:Users@lists.kamailio.org" target="_blank">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><font color="#888888"><br><br clear="all">

<br>-- <br>Daniel-Constantin Mierla<br>
  <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
</font></blockquote></div><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Daniel-Constantin Mierla<br>  <a href="http://www.asipto.com">http://www.asipto.com</a><br>