[OpenSIPS-Users] Sily question: Auto-Indentation

Matti Zemack Matti.Zemack at rtcfactory.com
Wed Jun 17 10:08:29 CEST 2009


Thanks Brett.

 

The do_routing() is next on my list of changes to the scripts. And I'm
sure I've got a lot of new modules to read up on and fully appreciate.

And memcache I've wanted to incorporate for quite some time. Soon.

 

First I just wanted to put 1.5 in staging/production before summer, with
a config that is a SER1.0 that not fully utilizes everything new and
shiny in 1.5 (actually 1.1->1.5). This way I can edit my config in a
more incremental fashion in the future.

 

Thanks again for all the help I've had from this list. Couldn't have
done anything without all your help!

 

/Matti

 

From: Brett Nemeroff [mailto:brett at nemeroff.com] 
Sent: den 17 juni 2009 09:58
To: Matti Zemack
Cc: users at lists.opensips.org
Subject: Re: [OpenSIPS-Users] Sily question: Auto-Indentation

 

Matti,

I'm not really commenting on it being "unreadable", but rather
inefficient. I imagine if I take my LCR and express it in the config
file like:

if ($rU =~ "1713[0-9]{7}") {

     do_something...

}

if ($rU =~ "1512[0-9]{7}") {

     do_something...

}

if ($rU =~ "1214[0-9]{7}") {

     do_something...

}

 

It could grow to be very big. Point being, this isn't a good way to do a
config since there are modules that would replace all of that with:

do_routing();

 

The newer OpenSIP are really much easier than the original SER. The
scripting pv-s and some of the advanced modules really make designing an
efficient call flow pretty easy to do in a nice compact config.
Especially the memcache bits. :)

 

-Brett

 

 

 

On Wed, Jun 17, 2009 at 2:52 AM, Matti Zemack
<Matti.Zemack at rtcfactory.com> wrote:

Brett,

 

You're absolutely right. 10.000 lines of config sounds unreadable.

My code is around 1000-2000 lines per config. And then there are a few
different configs for different systems. All in all around 10.000 lines.
In the future I'll try to boil these down to ONE config (fits all).

 

My code is working quite fine (good enough) actually. Sure I could do
some shortcuts here and there.

 

Basically I was handed a few systems using SER_0.9.0 and SER_1.0. They
wanted to move on up into OpenSIPS_1.4, and I forced them to 1.5. And it
has been a good few months learning about OpenSIPS. Before I've only
handled Asterisk. OpenSIPS was a happy surprise in my life.

 

Sure, I've been moaning about the syntax sometimes. All the different
types of variables. No way of debugging except tons and tons of xlog's.
Others example configs... But now, I quite like and enjoy it! Thanks to
all who made (and documented) OpenSIPS.

 

Hopefully this summer I will have some free time when I could write all
my notes "New to OpenSIPS" into actual readable text, with examples. So
that other newbies have something to work from.

 

Thanks again,

Matti Zemack, Stockholm, Sweden

 

 

 

From: Brett Nemeroff [mailto:brett at nemeroff.com] 
Sent: den 17 juni 2009 09:35
To: Matti Zemack
Cc: users at lists.opensips.org
Subject: Re: [OpenSIPS-Users] Sily question: Auto-Indentation

 

I said this in an earlier message and I think it's worth saying again..
If your code REALLY IS 10,000 lines long. You are probably doing
something wrong or at least, the hard way.. Maybe we can help you out
there.

 

-Brett

 

On Wed, Jun 17, 2009 at 2:18 AM, Matti Zemack
<Matti.Zemack at rtcfactory.com> wrote:

Hi,

Thanks. Will find the vim syntax file at vimscripts website.
And, yes, my wife also recognizes config files by now. But you're right
she's not a tool.

All my changes to the config files have been great! (thanks to all help
from you list people.) It's just that my boss wants the code to be a bit
tidier...

/Matti

2009/6/16 I?aki Baz Castillo <ibc at aliax.net>:

> What do you mean with a "tool that recognizes the configs"?
> There is noly one: OpenSIPS itself :)
>
> BTW, when I edit my config files, I use "Bash" syntax. It works great
> (except when using "switch/case" stament).

>I sometimes just enable autoindent and smartindent from C syntax in
>vim - that works. There's also openser syntax file available on
>vimscripts website.

>And, how do you know if changes in the config file are good or not?

_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090617/5a29b84a/attachment-0001.htm 


More information about the Users mailing list