Jump to content

autoprovision with user-specific files


vincent mazard

Recommended Posts

Hi,

 

I'm fighting hard to find a way to have the SnomOne ipbx send specific files to a snom370 phone via

autoprovisionning (via multicast PnP).

 

When the phone requests its configuration file (which appears to be snom370.htm) the ipbx

generates the file on the fly and sends it to the device.

It also generates the needed xml files (fw, fs, lang, etc...)

And it also generates a file called snom370-[the MAC address of the device].htm

It's this last file I'd like to be able to customize.

According to the Snom 370 it's where custom parameters are supposed to be set.

Is there a way ?

I tried several things, nothing seems to work :

if I write in this file, it is overwritten the next time the device requests it (quite normal).

if a put a pointer to another file in the snom370.xml file, and put this other file in the same folder (generated\domain\extension)

the file is not found (error 404).

if a put this file in the 'html' folder (as read in another post), I get a 302 html error because the server wants the device to authenticate. And anyway it wouldn't provide a specific file (every device would download the same file).

 

I also tried to create a snom370-[the MAC address of the device].htm file in the html folder but it doesn't work either.

I wonder if the device really requests this 'custom' file ...And don't see anything in the log about it.

I wonder if there's a way to have my device inherit from specific parameters via autoprovisionning...

 

Do you have an idea ?

 

Any help will be greatly appreciated.

 

Thanks in advance,

 

Vincent

Link to comment
Share on other sites

If you are looking to customize all snom370's, then you can refer http://wiki.snomone.com/index.php?title=PnP_Customization

 

But if you want to customize just 1 snom370 (using snom370-[the MAC address of the device].htm) you can create that file and then keep it in the 'tftp' folder (which you will have to create under <pbx working dir>)

 

If you keep anything under generated\domain\extension PBX will overwrite it during the next phone reboot.

Link to comment
Share on other sites

If you are looking to customize all snom370's, then you can refer http://wiki.snomone.com/index.php?title=PnP_Customization

 

But if you want to customize just 1 snom370 (using snom370-[the MAC address of the device].htm) you can create that file and then keep it in the 'tftp' folder (which you will have to create under <pbx working dir>)

 

If you keep anything under generated\domain\extension PBX will overwrite it during the next phone reboot.

 

Hi,

 

Thanks for these instructions. Actually I managed to have it work a bit differently :

 

- edited the snom370.xml template and added this pointer :

 

<file url="{https-url tftp}/snom370-{mac}.xml?model=snom370" />

(note the xml extension)

 

- created the snom370-[my MAC].xml file containing the <settings> paragraphs I needed.

- saved this file in the tftp folder as you suggested.

- rebooted the phone

 

This is working. The only problem with this solution is that the xml file is available to anybody without any authentication.

The tftp folder is not protected. And this is not really secure.

 

Access to the /prov files are subject to basic auth or MAC address identification. This is more secure.

And this is really where custom files should reside.

 

 

Now, I also tried your solution, but it doesn't work. Simply because the device never asks for the snom370-[my MAC].htm file

wherever it is located. (note the htm extension)

This is curious because the phone should ask for this file automatically. Unless something in the common config file tells it not to.

(I didn't find such a parameter).

Maybe something missing in this firmware version (8.4.32).

 

To force the device to request the custom config file, I added a pointer to it in the snom370.xml template. It didn't like it at all...

The phone didn't boot completely (froze). I had to reboot it.

This htm file is supposed to contain only pointers to xml config files, like the snom370.htm. That's probably something the phone didn't expect to find in the snom370.htm pointers (a pointer to a file containing other pointers).

 

My conclusions :

 

1 - There's something wrong on the phone because it doesn't ask for its 'custom' config file

2 - The fact that the PBX is creating a snom370-[MAC].htm in the /generated/domain/extension folder is completely useless because there's no way to add anything to it.

3 - using pointers to xml files in the tftp folder is the only workaround, but it is not secure enough

 

To my opinion, the PBX web UI should allow admins to create/edit a custom config file on a per-extension basis. The contents of this file would be inserted in the snomXXX-[MAC].htm file on the fly. Maybe some different files could be available for the various phone models.

A kind of 'advanced pnp parameters' in the extensions' config pages. Similar to the templates edition pages but for each dedicated extension.

 

 

Thanks very much for your help

 

Vincent

Link to comment
Share on other sites

  • 1 year later...

Hi,

 

I am using v5.0.3 and trying to send custom files to some snom320.

I've also been trying with the customized snom320-MAC.xml & htm files in tftp & changing the snom320.xml settings file but still no go.

 

How can this been done now in v5 ?

 

I want to auto-provision some phones with an additional SIP identity & different ringtones.

 

Fonny

Link to comment
Share on other sites

The file structure has changed for the snom phones. My recommendations:

  • Make sure that you don't have any customized files either through the template editing from the web interface or in the html folder
  • Provision a phone and take a look at the generated folder. There you can see what files are being generated. Then you can start modifying the templates for those files.

Link to comment
Share on other sites

Thanks for the quick reply.

 

All files in the snom_320.xml template file are loaded successful.

Also the snom_320_custom.xml file located in the tftp directory is loaded correctly. I added the line <file url="{https-url tftp}/snom_320_custom.xml" /> in the snom_320.xml template file.

But this custom file is used by all phones.

 

I want to send sip login settings (2nd identity) to a few phones and this info is different for each.

So I added the line <file url="{https-url tftp}/snom320-{mac}.xml" /> but this doesn't work as {mac} does not resolve to the MAC address of the phone but to 000000000000 (e.g. snom320-000000000000.xml).

 

Any idea how I can accomplish this ?

 

Fonny

Link to comment
Share on other sites

Hi,

 

I'm fighting hard to find a way to have the SnomOne ipbx send specific files to a snom370 phone via

autoprovisionning (via multicast PnP).

 

When the phone requests its configuration file (which appears to be snom370.htm) the ipbx

generates the file on the fly and sends it to the device.

It also generates the needed xml files (fw, fs, lang, etc...)

And it also generates a file called snom370-[the MAC address of the device].htm

It's this last file I'd like to be able to customize.

According to the Snom 370 it's where custom parameters are supposed to be set.

Is there a way ?

I tried several things, nothing seems to work :

if I write in this file, it is overwritten the next time the device requests it (quite normal).

if a put a pointer to another file in the snom370.xml file, and put this other file in the same folder (generated\domain\extension)

the file is not found (error 404).

if a put this file in the 'html' folder (as read in another post), I get a 302 html error because the server wants the device to authenticate. And anyway it wouldn't provide a specific file (every device would download the same file).

 

I also tried to create a snom370-[the MAC address of the device].htm file in the html folder but it doesn't work either.

I wonder if the device really requests this 'custom' file ...And don't see anything in the log about it.

I wonder if there's a way to have my device inherit from specific parameters via autoprovisionning...

 

Do you have an idea ?

 

Any help will be greatly appreciated.

 

Thanks in advance,

 

Vincent

 

 

Can you please try and point to a file snom370_[YOUR MAC].htm in the snom370.xml file.

Note that it is underscore '_' and not a dash.

Now put the actual file snom370_[YOUR MAC].xml with the settings in the folder. Note this one is .xml and the pointer to it is .htm.

 

Now you have to add this as a pattern anywhere in the pnp.xml file as shown below, so that pbx knows it has to serve it and also to map the pattern.

 

<file name="snom370_[YOUR MAC].xml" encoding="xml">

<pattern>snom370_[YOUR MAC].htm</pattern>

<vendor>snom</vendor>

<anonymous>true</anonymous>

<protocol>tftp,http,https</protocol>

<pnp-vendor>snom</pnp-vendor>

<pnp-model>snom300</pnp-model>

<pnp-version>^[78]</pnp-version>

<pnp-content-type>application/url</pnp-content-type>

<pnp-url>{https-url}/snom370_[YOUR MAC].htm</pnp-url>

</file>

 

Of course replace [YOUR MAC] with the actual mac.

 

I hope this works for you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...