[OpenSIPS-Users] global variables

2012-03-20 Thread Jan D.
Another day, another question: I like to declare some variables at the beginning of my script and use this at several places, the variables must be known till restart. something like ie: $my_eth0_interface = 89.1.2.3; $my_eth1_interface = 10.0.1.2; $my_default_timeout = 100; etc etc. I was

Re: [OpenSIPS-Users] global variables

2012-03-20 Thread Vlad Paiu
Hello, If you want to accomplish this, you can use the localcache module. In startup_route, initialize all of your needed 'constants' and store them with no expiry time ( cache_store ), and when you want to use them later on, just make a call to cache_fetch. Regards Vlad Paiu OpenSIPS

Re: [OpenSIPS-Users] global variables

2012-03-20 Thread Nick
Use m4 macro processor. http://www.opensips.org/Resources/DocsTools -- Nick 2012/3/20 Jan D. j-doe...@zonnet.nl Another day, another question: I like to declare some variables at the beginning of my script and use this at several places, the variables must be known till restart.

Re: [OpenSIPS-Users] global variables

2010-03-12 Thread Bogdan-Andrei Iancu
Hi Josip, Josip Djuricic wrote: Sorry I missed this email, I'll think about using db_virtual, but back to global vars issue, for a test I defined just a global counter variable, so a global C variable, right ? and created new function inside siptrace module, so every time a siptrace

Re: [OpenSIPS-Users] global variables

2010-03-12 Thread Josip Djuricic
In this case we can forget global c variable. I'm thinking about this solution, building custom module, that will start as a single process (one fork), and siptrace will be putting all the data on fifo queue (inside of shared memory) instead of db, and then this new module will take data from

Re: [OpenSIPS-Users] global variables

2010-03-10 Thread Josip Djuricic
Sorry I missed this email, I'll think about using db_virtual, but back to global vars issue, for a test I defined just a global counter variable, and created new function inside siptrace module, so every time a siptrace function is called I also call this function and do counter ++. since

Re: [OpenSIPS-Users] global variables

2010-03-09 Thread Bogdan-Andrei Iancu
Hi Josip, Josip Djuricic wrote: Hi, one probably stupid question, I'm customizing siptrace module further, so I am adding queue for db writing, in case we loose db connectivity and threads for popping the queue and writing to db. why don't you use the new db_virtual module with a

[OpenSIPS-Users] global variables

2010-03-08 Thread Josip Djuricic
Hi, one probably stupid question, I'm customizing siptrace module further, so I am adding queue for db writing, in case we loose db connectivity and threads for popping the queue and writing to db. Written almost everything, but just to be sure, if I use global variable for linked list, will

Re: [OpenSIPS-Users] Global Variables

2009-10-05 Thread Brett Nemeroff
...@lists.opensips.org] *On Behalf Of *Brett Nemeroff *Sent:* Sunday, October 04, 2009 6:27 PM *To:* users@lists.opensips.org *Subject:* [OpenSIPS-Users] Global Variables Hey all, I'm wondering if there is a way to use global variables? I see that $var variables are persistent across the process, but I

Re: [OpenSIPS-Users] Global Variables

2009-10-05 Thread Alex Massover
: [OpenSIPS-Users] Global Variables Hey Alex, I've just tried it with memcache and that works great.. Very fast.. just a little clumsy looking in the scripts; but otherwise works great. Thanks, Brett On Mon, Oct 5, 2009 at 4:36 AM, Alex Massover a...@jajah.commailto:a...@jajah.com wrote: Hi

[OpenSIPS-Users] Global Variables

2009-10-04 Thread Brett Nemeroff
Hey all,I'm wondering if there is a way to use global variables? I see that $var variables are persistent across the process, but I need something that will persist across all processes. Right now, I'm using memcache, but I'm not sure if I'll have race conditions relying on that as I expect many

Re: [OpenSIPS-Users] Global Variables

2009-10-04 Thread Jeff Kronlage
@lists.opensips.org Subject: [OpenSIPS-Users] Global Variables Hey all, I'm wondering if there is a way to use global variables? I see that $var variables are persistent across the process, but I need something that will persist across all processes. Right now, I'm using memcache, but I'm

Re: [OpenSIPS-Users] Global Variables

2009-10-04 Thread Stanisław Pitucha
2009/10/4 Brett Nemeroff br...@nemeroff.com: I'm wondering if there is a way to use global variables? $shv(...) does that: http://www.opensips.org/html/docs/modules/1.5.x/cfgutils.html#id271355 but I'm not sure if I'll have race conditions relying on that as I expect many processes to be