Any chance we could have the same kind of user definable arguments that are in Create Script in Tenant Management and allow those arguments to be passed to the provisioning piece?
I am using Edgemarc routers at my customer sites, and I need to be able to tell the phones to register with the LAN side of the router instead of to my Thirdland MTE server. The Edgemarc then manages the registrations between itself and the MTE server. I would like to add an argument to Tenant Management so that I can pass a different SERVER argument depending on the IP address of my customer's Edgemarc.
Ok, I have asterisk
Ok, I have asterisk installed in /etc/asterisk. Are you saying I should make a subdirectory like /etc/asterisk/provisioning/{tenant} and put tenant specific templates there? How do you tell Thirdlane where the tenant specific files are when you provision phones?
Or, do you split up your actual .cfg files into {tenant} subdirectories?
What I'm trying to accomplish is a way to vary this attribute for each tenant.
reg.1.server.1.address="192.168.1.1"
I'm considering taking reg.x.server.y.address out of polycom_line.cfg where I have it now and add manually to my tenant-settings-{tenant}.cfg file.
if you dont have
if you dont have user_provisioning create it, then you can make a /etc/asterisk/user_provisioning/${tenant} directory
first it looks for models.txt in user_provisioning/ and then provisioning/ to learn what template files to use. Then it looks for those template files in this order user_provisioning/tenant/ , user_provisioning/ , then provisioning/. It processes the templates in this order for every template. So if you only want to change polycom_line.cfg for each tenant then only copy polycom_line.cfg into the tenant subdir and alter it from
reg.${LINE}.server.1.address="${SERVER}"
to
reg.${LINE}.server.1.address="172.16.100.1"
I use sip proxies with polycoms so each tenant has his own polycom_line.cfg that defines their sip proxy as
reg.${LINE}.outboundProxy.address="some.ip"
I also have my own polycom_local.cfg for each tenant in case they want unique behaviors (special ring tones, different dialplan digit maps based on if they are 3digit or 4 digit dialing, etc. Those get renamed to ${tenant}-settings.cfg instead of the one-size-fits-all local-settings.cfg.
Then it looks for those
Then it looks for those template files in this order user_provisioning/tenant/ , user_provisioning/ , then provisioning/.
This is the part that I was missing. Didn't know about user_provisioning/${tenant}. Cool. Thanks, again!
user variables in templates
I am also considering adding user defined variables in templates. The way it is going to work is like this:
say in user template you have:
something=${SOMEUSERVARiIABLE} where SOMEUSERVARIABLE is the name of the custom variable
in general configuration and on the tenant level you would be able to specify the defaults
SOMEUSERVARIABLE=defaultvalue, which will be used if not specified on the device level
and then in the provisioning (on a device level) you would be able to specify something like this:
SOMEUSERVARIABLE=overrideforthedevice
and pbx manager will replace the value in generated templates.
Does this makes sense? Any suggestions?
Best regards,
Alex
Alex, I think that would be
Alex, I think that would be very helpful as described. Will we have the ability to add multiple "SOMEUSERVARIABLE"s?
Dozment wrote "Alex, I think
Dozment wrote
"Alex, I think that would be very helpful as described. Will we have the ability to add multiple "SOMEUSERVARIABLE"s?"
I agree that this would be a great feature.
-Matt
Eric, I just tried your
Eric, I just tried your suggestion about user_provisioning. Very nice.
Alex, I would still like the SOMEUSERVARIABLE option. And, how about a way to call a shell script at the end of the tenant creation process? That way I could write a shell script to create the /user_provisioning/${TENANT} directory and anything else that I choose to do differently.
Tenant creation
I like the shell script idea - perhaps we could even do theis for other events - the more i think about it the more i like it. I have to which arguments would be useful to pass to it or any other scripts (i.e. when extension is managed?). Any thoughts?
As far as the multiple variables - of course - you would be able to add as many as you need.
I would want the tenant
I would want the tenant passed to the shell script when I add a new tenant. I'm sure I will think of others as soon as you release a version with this functionality. But, for now I can't think of other uses/arguments.
Tenant creation script and user variables in templates
I could use both. When creating a tenant I have to manually create the provisioning directories AND ftp user/password. The ftp user name is the same as the tenant name. For the password, I would like to specify one. I dont want it to be the same as the tenant superuser.
Variables in the provisioning template sounds like a very good idea. Right now I'm abusing the description field to specify an encryption key to provide encrypted provisioning files for pap2 devices. I grab the key from the devices.txt and encrypt the file with a shell script. It works, but it's ugly and an ignorant user might be compelled to delete that ugly stuff in the description field.
Maybe add an image of the phone to the template. The image(s?) could be used to reference which arguments affect which buttons/display-options etc.
it already exists, make subdirectories for each tenant under user_provisioning and alter your template files. You dont have to have a variable called $SERVER, you just put in the IP. I do this with sip proxy registrations.