Assigning a variable with a value from a system command?
Hi. I have a need to assign a variable in vars.xml with the value output from a system command (in this specific instance "hostname -s", but I'd like to have a generic solution for future use). How can I do that? Any suggestions are welcome, as is pointing at any documentation I've so far failed to find :) Thanks, Antony. -- Having been asked for a reference for this man, I can confirm that you will be very lucky indeed if you can get him to work for you. Please reply to the list; please *don't* CC me.
Do it through environment. <X-PRE-PROCESS cmd="env-set" data="var=$VAL"/> We also have "exec-set". https://freeswitch.org/confluence/display/FREESWITCH/Understanding+the+Confi... On Wed, Dec 1, 2021 at 4:03 PM Antony Stone < Antony.Stone@freeswitch.open.source.it> wrote:
Hi.
I have a need to assign a variable in vars.xml with the value output from a system command (in this specific instance "hostname -s", but I'd like to have a generic solution for future use).
How can I do that?
Any suggestions are welcome, as is pointing at any documentation I've so far failed to find :)
Thanks,
Antony.
-- Having been asked for a reference for this man, I can confirm that you will be very lucky indeed if you can get him to work for you.
Please reply to the list; please *don't* CC me.
_________________________________________________________________________
The FreeSWITCH project is sponsored by SignalWire https://signalwire.com Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services. Build your next product on our scalable cloud platform.
Join our online community to chat in real time https://signalwire.community
Professional FreeSWITCH Services sales@freeswitch.com https://freeswitch.com
Official FreeSWITCH Sites https://freeswitch.com/oss https://freeswitch.org/confluence https://cluecon.com
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 https://freeswitch.com
On Thursday 02 December 2021 at 11:04:12, Dragos Oancea wrote:
Do it through environment. <X-PRE-PROCESS cmd="env-set" data="var=$VAL"/>
So, that allows a FreeSwitch variable to have the value of an environment variable? That's not quite the same as running a command and assigning the result to a variable, which is what I need.
We also have "exec-set".
Ah, now *that* looks like what I'm looking for - thanks :) Antony -- Bill Gates has personally assured the Spanish Academy that he will never allow the upside-down question mark to disappear from Microsoft word-processing programs, which must be reassuring for millions of Spanish-speaking people, though just a piddling afterthought as far as he's concerned. - Lynne Truss, "Eats, Shoots and Leaves" Please reply to the list; please *don't* CC me.
try exec-set On Thu, Dec 2, 2021 at 11:46 PM Antony Stone < Antony.Stone@freeswitch.open.source.it> wrote:
On Thursday 02 December 2021 at 11:04:12, Dragos Oancea wrote:
Do it through environment. <X-PRE-PROCESS cmd="env-set" data="var=$VAL"/>
So, that allows a FreeSwitch variable to have the value of an environment variable?
That's not quite the same as running a command and assigning the result to a variable, which is what I need.
We also have "exec-set".
Ah, now *that* looks like what I'm looking for - thanks :)
Antony
-- Bill Gates has personally assured the Spanish Academy that he will never allow the upside-down question mark to disappear from Microsoft word-processing programs, which must be reassuring for millions of Spanish-speaking people, though just a piddling afterthought as far as he's concerned.
- Lynne Truss, "Eats, Shoots and Leaves"
Please reply to the list; please *don't* CC me.
_________________________________________________________________________
The FreeSWITCH project is sponsored by SignalWire https://signalwire.com Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services. Build your next product on our scalable cloud platform.
Join our online community to chat in real time https://signalwire.community
Professional FreeSWITCH Services sales@freeswitch.com https://freeswitch.com
Official FreeSWITCH Sites https://freeswitch.com/oss https://freeswitch.org/confluence https://cluecon.com
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 https://freeswitch.com
-- About: http://about.me/dujinfang Blog: http://www.dujinfang.com Proj: http://www.freeswitch.org.cn
participants (3)
-
Antony Stone
-
Dragos Oancea
-
Seven Du