amaury BOSSE
2005-Dec-05 10:54 UTC
[Asterisk-Users] Include a variable from another file in configfiles
Thanks for your answer but I don't want to include a file, I only want to include a variable. Is it possible to execute linux commands like grep or top in a .conf file in order to parse a file and get a variable? -----Message d'origine----- De?: Administrator TOOTAI [mailto:admin@tootai.net] Envoy??: lundi 5 d?cembre 2005 12:43 ??: Asterisk Users Mailing List - Non-Commercial Discussion Objet?: Re: [Asterisk-Users] Include a variable from another file in configfiles Amaury BOSSE a ?crit :> I would like to know if it is possible to include a variable in > sip_nat.conf. > > I have a file with my network configuration and I want to parse it and > to use LAN IP in sip_nat.conf. > > Is there a way to parse a file and include variables in a .conf file. > > > > Amaury >In your sip.conf #include /path/to/the/file/you/want/to/include In this file Asterisk will find the command, eg localnet=<your LAN IP> -- Daniel
JP Carballo
2005-Dec-05 15:07 UTC
[Asterisk-Users] Include a variable from another file in configfiles
amaury BOSSE wrote:>Thanks for your answer but I don't want to include a file, I only want to include a variable. > >Is it possible to execute linux commands like grep or top in a .conf file in order to parse a file and get a variable? > > >Look into the System() command: http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+System -- JP Carballo http://www.netfone2x.com Bringing the world closer. It might look like I'm doing nothing, but at the cellular level, I'm really quite busy.
Administrator TOOTAI
2005-Dec-06 02:38 UTC
[Asterisk-Users] Include a variable from another file in configfiles
amaury BOSSE a ?crit :>Thanks for your answer but I don't want to include a file, I only want to include a variable. > >Is it possible to execute linux commands like grep or top in a .conf file in order to parse a file and get a variable? > >AGI is your friend>-----Message d'origine----- >De : Administrator TOOTAI [mailto:admin@tootai.net] >Envoy? : lundi 5 d?cembre 2005 12:43 >? : Asterisk Users Mailing List - Non-Commercial Discussion >Objet : Re: [Asterisk-Users] Include a variable from another file in configfiles > >Amaury BOSSE a ?crit : > > > >>I would like to know if it is possible to include a variable in >>sip_nat.conf. >> >>I have a file with my network configuration and I want to parse it and >>to use LAN IP in sip_nat.conf. >> >>Is there a way to parse a file and include variables in a .conf file. >> >> >> >>Amaury >> >> >> >In your sip.conf > >#include /path/to/the/file/you/want/to/include > >In this file Asterisk will find the command, eg localnet=<your LAN IP> > > >-- Daniel