<div dir="auto"><div>#define is a directive for the cfg scripting. So you won't be able to reach this definition from Lua/python/etc AFAIK.<div dir="auto"><br></div><div dir="auto">But there are at least 2 possibilities how to achieve this:</div><div dir="auto">1 - define global variables/constants in your script instead of #define.</div><div dir="auto">It will be visible across all namespace of your script.</div><div dir="auto">2 - use  pv modparap setvar. Once you done #define put it into variable on a modparam stage via this param. Then you can access those vars via kemi.</div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 13 Jul 2021, 08:55 Daniel-Constantin Mierla, <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
if you have:<br>
<br>
#!define X<br>
<br>
then you can have conditional blocks like:<br>
<br>
#!ifdef X<br>
<br>
#endif<br>
<br>
or:<br>
<br>
#!ifndef X<br>
<br>
#endif<br>
<br>
Or, are you looking for something else?<br>
<br>
Cheers,<br>
Daniel<br>
<br>
On 12.07.21 14:17, Riccardo Villa wrote:<br>
> Hello guys,<br>
><br>
> do you know if it’s possible for a kemi script to know if a name is defined (with #!define) in kamailio.cfg? It would be useful to modify kemi script logic depending on feature/module presence.<br>
><br>
> Thanks in advance for your help.<br>
><br>
> Regards,<br>
><br>
> Riccardo<br>
><br>
><br>
> -- <br>
> --<br>
> NOTICE: This electronic mail transmission may contain confidential <br>
> information and is intended only for the person(s) named. Any use, copying, <br>
> or disclosure by any other person is strictly prohibited. If you have <br>
> received this transmission in error, please notify the sender via e-mail.<br>
><br>
> __________________________________________________________<br>
> Kamailio - Users Mailing List - Non Commercial Discussions<br>
>   * <a href="mailto:sr-users@lists.kamailio.org" target="_blank" rel="noreferrer">sr-users@lists.kamailio.org</a><br>
> Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
> Edit mailing list options or unsubscribe:<br>
>   * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
-- <br>
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" rel="noreferrer noreferrer" target="_blank">www.asipto.com</a><br>
<a href="http://www.twitter.com/miconda" rel="noreferrer noreferrer" target="_blank">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" rel="noreferrer noreferrer" target="_blank">www.linkedin.com/in/miconda</a><br>
<br>
<br>
__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
  * <a href="mailto:sr-users@lists.kamailio.org" target="_blank" rel="noreferrer">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
  * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div></div>