On Sun, 2008-10-19 at 22:56 -0400, Scott Lawrence wrote: > I've got updates to sipXsupervisor and the new setup scripts ready to > check in, but there are a couple of changes needed to how domain-config > is generated. > > I took a stab at the sipXconfig code today, but I don't grok enough to > make it work... > > Basically, I need to make domain-config come out like: > > SIP_DOMAIN_NAME : domain.example.com > SIP_REALM : realm.example.com > SHARED_SECRET : mySecret > DEFAULT_LANGUAGE : en > ALARM_SERVER_URL : https://master.example.com:8092 > SUPERVISOR_PORT : 8092 > CONFIG_HOST : master.example.com > > > Those last two parameters are new - they moved from > sipxsupervisor-config (and were renamed). For now, the port number can > be fixed (I suppose ultimately it should be configurable, but I'm not > concerned with that now). The CONFIG_HOST parameter needs to be the > fqdn of the sipXconfig host (the master in a cluster). > >
domain-config is generated by the sipXconfig/neoconf/etc/commserver/domain-config.vm template. Adding the port is quite easy... just add it as in your example above (will be more complicated once it becomes configurable). Adding the CONFIG_HOST is a little more difficult. First, in sipXconfig we make the (not always correct) assumption that sipXconfig runs on the Primary server in a cluster. At least, this is the default case. Therefore, calling LocationsManager.getPrimaryLocation() will give us the Location (server) object that hosts sipXconfig. We can then get the FQDN from this Location object. That will need to be injected into the velocity template. That is done through the DomainConfiguration class, where there are already several objects being injected into the template, using key-value pairs. The CONFIG_HOST line is then added to the template and references the injected location. So, in summary: 1. Inject LocationsManager into DomainConfiguration using bean definition in domain.beans.xml 2. Get primary location object from LocationsManager in DomainConfiguration 3. Inject primary location (or primaryLocation.getFqdn(), either way) into template context in DomainConfiguration 4. Modify template (domain-config.vm) to read location/fqdn from context Or, Create new JIRA issue :) Hope this clears things up a bit, Kevin _______________________________________________ sipx-dev mailing list [email protected] List Archive: http://list.sipfoundry.org/archive/sipx-dev Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev
