I second this as well. Named flags would make debugging and scripting quite simpler.<div><br></div><div>Regards,</div><div>Ali</div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 8, 2012 at 11:23 AM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Michael,<br>
<br>
You can already use names for the route, not only numerical IDs (without the need of defining).<br>
<br>
For flags, you can use only numbers, indeed - usually I use M4 as text preprocessor to do different complex ops over the script (like defines, ifdefs, etc).<br>
But maybe a built in support for names of flags will not be a big issue, especially it is not a big deal.<br>
<br>
Regards,<br>
<br>
Bogdan-Andrei Iancu<br>
OpenSIPS Founder and Developer<br>
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<u></u>com</a><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On 11/08/2012 01:22 PM, Michael Renzmann wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all.<br>
<br>
I'm relatively new to OpenSIPS and still am at the very beginning of<br>
learning how to tame this wonderful beast ;-).<br>
<br>
One thing that I, personally, find pretty uncomfortable is that in various<br>
places in the opensips.cfg one needs to use plain numbers to define or<br>
modify the behaviour. That easily results in constructs like:<br>
<br>
=== cut ===<br>
route {<br>
...<br>
route(42);<br>
...<br>
}<br>
<br>
route[42] {<br>
...<br>
setflag(8);<br>
...<br>
}<br>
=== cut ===<br>
<br>
Obviously, it is possible to memorize the meaning of the different numbers<br>
depending on the context they are used in - this is what people do now<br>
when they work with OpenSIPS. But I guess things may become pretty painful<br>
when you have a complex configuration and need to urgently debug an issue<br>
in it which just has brought down a heavily loaded, productively used<br>
OpenSIPS instance...<br>
<br>
Using comments certainly helps to relieve the problem a bit, but they can<br>
not solve it. However, things would become much easier if one could use<br>
"speaking names" instead of plain numbers:<br>
<br>
=== cut ===<br>
define(ROUTE_NAT_DETECTION, 42);<br>
define(FLAG_NAT_DETECTED, 8);<br>
<br>
route {<br>
...<br>
route(ROUTE_NAT_DETECTION);<br>
...<br>
}<br>
<br>
route[ROUTE_NAT_DETECTION] {<br>
...<br>
setflag(FLAG_NAT_DETECTED);<br>
...<br>
}<br>
=== cut ===<br>
<br>
Yes, I am aware that this could also be achieved by using an external<br>
macro preprocessor such as M4. But that would add another dependency - one<br>
which could be avoided if OpenSIPS had built-in support for simple macro<br>
definitions like those shown in the example above.<br>
<br>
Bye, Mike<br>
<br>
______________________________<u></u>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>