Dear all, I have an Asterisk box serving as gateway to a set of POTS phones that all share the same telephone number, and I register this box as gateway to a H.323 gatekeeper with the telephone number as the gateway prefix. I am wondering if there is a way to have Asterisk-wide (perhaps to be called 'universal') variables that can be used in all config files. As far as I know, now e.g. in extensions.conf you can declare a 'global' variable but it can only be used within extensions.conf. As an example: I set the gateway's telephone number both in extensions.conf, oh323.conf and phones.conf but I don't want to change the same data in three separate files whenever I want to set a different telephone number for the gateway. Thanks for any advice/clarification, Rene.
Hi Rene,> As an example: I set the gateway's telephone number both in > extensions.conf, oh323.conf and phones.conf but I don't want to change > the same data in three separate files whenever I want to set a different > telephone number for the gateway.I have no idea whether this would work or not, but couldn't you do a #include vars.conf in the relevant places in extensions.conf, oh323.conf and phones.conf and then define the variables in vars.conf ?? -- Darryl Ross Senior Network Engineer OEG Australia Email: darryl@oeg.com.au Phone: 08 81228363 Office: 08 81226361 If you want to live up to the whole "There is more than one way to do it" slogan, you have to give someone a swiss army chainsaw ...
--> {Rene wrote:} As an example: I set the gateway's telephone number both in extensions.conf, oh323.conf and phones.conf but I don't want to change the same data in three separate files whenever I want to set a different telephone number for the gateway. -> {Darryl Ross wrote:} I have no idea whether this would work or not, but couldn't you do a #include vars.conf in the relevant places in extensions.conf, oh323.conf and phones.conf and then define the variables in vars.conf ?? {Rene:} Hi Darryl, all, Thanks for your suggestion, I like that idea. It works for extensions.conf, where under [globals] I #include vars.conf and in vars.conf I set MY_E164=31111111111 and in the remainder of the extensions.conf file I can get the variable's value via ${MY_E164}. But for the oh323.conf file this does not work. If I insert at the top [globals] #include vars.conf and further on in oh323.conf alias=${MY_E164} then asterisk tries to register to the H.323 gatekeeper with alias ${MY_E164} instead of with 31111111111, resulting in apparent failure. Should I perhaps use something different than [globals] in oh323.conf? Or is there another reason why it is not working? Cheers, Rene.
Hi Rene, Kramer, R.D.J. wrote:> Dear all, > > I have an Asterisk box serving as gateway to a set of POTS phones that > all share the same telephone number, and I register this box as gateway > to a H.323 gatekeeper with the telephone number as the gateway prefix. > > I am wondering if there is a way to have Asterisk-wide (perhaps to be > called 'universal') variables that can be used in all config files. As > far as I know, now e.g. in extensions.conf you can declare a 'global' > variable but it can only be used within extensions.conf. > > As an example: I set the gateway's telephone number both in > extensions.conf, oh323.conf and phones.conf but I don't want to change > the same data in three separate files whenever I want to set a different > telephone number for the gateway.Currently there is no such capability. You just have to declare the same information to several files.> > Thanks for any advice/clarification, > Rene. >Michael.