[Freeswitch-users] How to set FS variable to the value returned by linux command

Iskren Hadzhinedev iskren.hadzhinedev at ikiji.com
Tue Mar 11 00:24:16 MSK 2014


On Monday 10 March 2014 17:07:40 Victor Chukalovskiy wrote:
> Hello,
Hi
> 
> I run the same config on multiple boxes. Need to tell apart which box
> CDR is coming from without setting it manually per-box.
> 
> Is there a way to set a global variable to the output of linux 'hostname
> -s' command?
I'm not sure but I think you can use 
https://wiki.freeswitch.org/wiki/Mod_commands#system[1] 
> 
> E.g. instead of:
> <X-PRE-PROCESS cmd="set" data="sbc_hostname=sbc1"/>
> <X-PRE-PROCESS cmd="set" data="sbc_hostname=sbc2"/>
> .....
> <X-PRE-PROCESS cmd="set" data="sbc_hostname=sbcN"/>
> 
> I need something like:
> <X-PRE-PROCESS cmd="set" data="'hostname -s'"/>\
Maybe try <X-PRE-PROCESS cmd="system" data="sbc_hostname=${hostname -s}"/>.
Not sure if it will be executed in the X-PRE-PROCESS but worth a try IMO.
> 
> Thank you,
> -Victor
Cheers,-- 
Iskren Hadzhinedev
System Administrator


The Idea Factory | 20 Mearns Street | Aberdeen | AB11 5AT | UK
T: 01224 607500
VAT Reg No: 982 4936 74. Company registered in Scotland, SC237116

--------
[1] https://wiki.freeswitch.org/wiki/Mod_commands#system
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140310/bfced218/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 4641 bytes
Desc: not available
Url : http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140310/bfced218/attachment.png 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list