Hi, Is it possible to manipulate variables defined for users in /directory/default/1000.xml? Suppose I have a <variable name="flag" value="0"> for each user. Can I dial an extension and change this value, only for the specific user who dialed it? Thanks gs
Not that I'm aware of. To duplicate such functionality, however, there are several options: 1) Use the db to store such variables, see: http://wiki.freeswitch.org/wiki/Mod_db <http://wiki.freeswitch.org/wiki/Mod_db>2) use a complicated script that rewrites the xml and triggers a reload xml (kind of convoluted, I don't recommended it) 3) Use your own sql interface, e.g. using lua or mod_odbc_query from the git contrib. However, familiarizing yourself with mod_db is probably enough. 4) Use mod_xml_curl to process what happens and run the sql query / or file edits within that ruby/php/etc script. I use mod_xml_curl for basically all my dialplan, if you have anything very specific (e.g. dependent on lots of queries, or custom routing and billing) it's the most flexible. Static XML is only so flexible. -Avi On Mon, Jan 10, 2011 at 3:06 AM, guru singh <grsingh750@gmail.com> wrote:
Hi,
Is it possible to manipulate variables defined for users in /directory/default/1000.xml? Suppose I have a <variable name="flag" value="0"> for each user. Can I dial an extension and change this value, only for the specific user who dialed it?
Thanks gs
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Avi, Thanks for the reply, I'd also thought of mod_db, sounds like the best, least convoluted way to do it. Another thing I tried was using set_global to initially set the var, and then test it using global_getvar, this works as expected for users who've dialed an extension to set the var, but for users who haven't the var remains UNDEF and my test fails, is it possible to check if a var is (some value| UNDEF)? thanks On Mon, Jan 10, 2011 at 6:56 AM, Avi Marcus <Avi@amarcus.com> wrote:
Not that I'm aware of. To duplicate such functionality, however, there are several options: 1) Use the db to store such variables, see: http://wiki.freeswitch.org/wiki/Mod_db 2) use a complicated script that rewrites the xml and triggers a reload xml (kind of convoluted, I don't recommended it) 3) Use your own sql interface, e.g. using lua or mod_odbc_query from the git contrib. However, familiarizing yourself with mod_db is probably enough. 4) Use mod_xml_curl to process what happens and run the sql query / or file edits within that ruby/php/etc script. I use mod_xml_curl for basically all my dialplan, if you have anything very specific (e.g. dependent on lots of queries, or custom routing and billing) it's the most flexible. Static XML is only so flexible. -Avi
On Mon, Jan 10, 2011 at 3:06 AM, guru singh <grsingh750@gmail.com> wrote:
Hi,
Is it possible to manipulate variables defined for users in /directory/default/1000.xml? Suppose I have a <variable name="flag" value="0"> for each user. Can I dial an extension and change this value, only for the specific user who dialed it?
Thanks gs
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Got it with help on IRC, UNDEF is just a match to empty string, simple regex. Thanks On Mon, Jan 10, 2011 at 3:17 PM, guru singh <grsingh750@gmail.com> wrote:
Avi, Thanks for the reply,
I'd also thought of mod_db, sounds like the best, least convoluted way to do it. Another thing I tried was using set_global to initially set the var, and then test it using global_getvar, this works as expected for users who've dialed an extension to set the var, but for users who haven't the var remains UNDEF and my test fails, is it possible to check if a var is (some value| UNDEF)?
thanks
On Mon, Jan 10, 2011 at 6:56 AM, Avi Marcus <Avi@amarcus.com> wrote:
Not that I'm aware of. To duplicate such functionality, however, there are several options: 1) Use the db to store such variables, see: http://wiki.freeswitch.org/wiki/Mod_db 2) use a complicated script that rewrites the xml and triggers a reload xml (kind of convoluted, I don't recommended it) 3) Use your own sql interface, e.g. using lua or mod_odbc_query from the git contrib. However, familiarizing yourself with mod_db is probably enough. 4) Use mod_xml_curl to process what happens and run the sql query / or file edits within that ruby/php/etc script. I use mod_xml_curl for basically all my dialplan, if you have anything very specific (e.g. dependent on lots of queries, or custom routing and billing) it's the most flexible. Static XML is only so flexible. -Avi
On Mon, Jan 10, 2011 at 3:06 AM, guru singh <grsingh750@gmail.com> wrote:
Hi,
Is it possible to manipulate variables defined for users in /directory/default/1000.xml? Suppose I have a <variable name="flag" value="0"> for each user. Can I dial an extension and change this value, only for the specific user who dialed it?
Thanks gs
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (2)
-
Avi Marcus
-
guru singh