Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Assigning a variable with a value from a system command?


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
Antony.Stone at freesw...
Guest





PostPosted: Wed Dec 01, 2021 9:22 am    Post subject: [Freeswitch-users] Assigning a variable with a value from a Reply with quote

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
Back to top
dragos at freeswitch.org
Guest





PostPosted: Thu Dec 02, 2021 5:58 am    Post subject: [Freeswitch-users] Assigning a variable with a value from a Reply with quote

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+Configuration+Files







On Wed, Dec 1, 2021 at 4:03 PM Antony Stone <Antony.Stone@freeswitch.open.source.it (Antony.Stone@freeswitch.open.source.it)> wrote:

Quote:
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 Smile


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 (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 (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
Back to top
Antony.Stone at freesw...
Guest





PostPosted: Thu Dec 02, 2021 10:45 am    Post subject: [Freeswitch-users] Assigning a variable with a value from a Reply with quote

On Thursday 02 December 2021 at 11:04:12, Dragos Oancea wrote:

Quote:
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.

Quote:
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
Back to top
dujinfang at gmail.com
Guest





PostPosted: Sat Dec 04, 2021 8:37 pm    Post subject: [Freeswitch-users] Assigning a variable with a value from a Reply with quote

try exec-set

On Thu, Dec 2, 2021 at 11:46 PM Antony Stone <Antony.Stone@freeswitch.open.source.it (Antony.Stone@freeswitch.open.source.it)> wrote:

Quote:
On Thursday 02 December 2021 at 11:04:12, Dragos Oancea wrote:

Quote:
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.

Quote:
We also have "exec-set".

Ah, now *that* looks like what I'm looking for - thanks Smile


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 (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 (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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services