Device Provisioning Setup

Status
Not open for further replies.

ropeguru

New Member
Feb 28, 2019
25
1
3
55
Anyone have a good tutorial on everything that needs to be setup and configured for doing phone provisioning?

I just bought a couple of Grandstream GXP-2140 phones and would like to setup provisioning for them.
 

ad5ou

Active Member
Jun 12, 2018
884
195
43
https://docs.fusionpbx.com/en/latest/hardware.html
https://docs.fusionpbx.com/en/latest/applications/provision/provision_auto_grandstream.html

Basic steps:
Fusionpbx:
In Advanced>default settings under "Provision":
Set enabled to true
Set "http_auth_enabled" to true
Set "http_auth_username" to a username you will later enter into the phone
Set "http_auth_password" to a secure password you will later enter into the phone
Optionally set "cidr" to the IP range the phones will be provisioning from for higher security. Additional "cidr" entries can be added as needed.
When finished, click "Reload" at top right of page

In Accounts>Devices
Add new entry
Enter MAC address of phone
Select a template (there should be a good gxp2140 template available)
Optionally add account info manually or easily add it in step below
Enter a description of phone to find it easier later
Save

In Accounts>Extensions
Edit an extension you want to use
Under Device Provisioning select Line 1, click drop down to select MAC you added earlier, click add. The template will auto fill if the MAC is already in Devices.
Another way to add device MAC's is directly from this screen. Instead of selecting an existing MAC, click the edit icon and enter in a new MAC, then select correct template, then add. This will add the MAC to the devices page with all of the relevant info.

In the Grandstream:
Maintenance>Upgrade and Provisioning page
Set "Config Upgrade via" to HTTPS
Set "Config Upgrade Server Path" to <your.fusionpbx.server>/app/provision
Set "Config Server Username" to the http_auth_username you set earlier
Set "Config Server Password" to the http_auth_password you set earlier
Click Save and Apply
Then Click "provision" at top of page or restart phone

Phone should now be provisioned.

There are many more options available to customize settings and ways to easily manage button configs etc. Most of these can be figured out by reading the docs, testing things, etc. Further examples and documentation is available to Fusionpbx.com Green members in the member documentation and Admin class videos.
 
  • Like
Reactions: mcs3ss2

ad5ou

Active Member
Jun 12, 2018
884
195
43
Also note for programming additional keys on Grandstream phones, the lines's start at "0" which can be a little confusing.
In "Devices" "Lines" 1- 4 equals account 1 - 4, but under "Keys">line 0 equals account 1
1573149961512.png
 

ropeguru

New Member
Feb 28, 2019
25
1
3
55
Went through all the steps and when the phone tries to provision, I am getting a 404 not found for the xml file.

Need to dig in to see if it is really getting created.
 

ropeguru

New Member
Feb 28, 2019
25
1
3
55
So in search the system for the xml files that should have been created, they are non existent on the server.

Where are the files stored on the file system? Wondering if there may be a permissions issue? Creating of the extension and device doesn't give any errors in the GUI.
 

ropeguru

New Member
Feb 28, 2019
25
1
3
55
Here is what I see in the nginx log:

2019/11/07 21:33:34 [error] 9263#9263: *39 open() "/var/www/fusionpbx/app/provision/cfg.xml" failed (2: No such file or directory)

Same for the file cfggxp2140.xml
 

ad5ou

Active Member
Jun 12, 2018
884
195
43
The xml files are generated dynamically.

Grandstreams will usually check for multiple files. The only one Fusion generates is the "<mac>.xml" and "phonebook.xml"
The cfg.xml and cfggxp2150.xml are optional files Grandstream phones can use but are not needed.

You can check if the Fusion settings are correct by attempting to download the files from Accounts>Devices><mac>
On the device edit page in top right, click on "Files" and select the 000b82xxxxxx.xml file
It should then ask for the username/password you set earlier and download the config file.
 

ropeguru

New Member
Feb 28, 2019
25
1
3
55
The xml files are generated dynamically.

Grandstreams will usually check for multiple files. The only one Fusion generates is the "<mac>.xml" and "phonebook.xml"
The cfg.xml and cfggxp2150.xml are optional files Grandstream phones can use but are not needed.

You can check if the Fusion settings are correct by attempting to download the files from Accounts>Devices><mac>
On the device edit page in top right, click on "Files" and select the 000b82xxxxxx.xml file
It should then ask for the username/password you set earlier and download the config file.

Tried that and I get the nginx error of 404 not found

EDIT: I opened an incognito window and pasted in the URL and the file immediately downloaded. So a login issue of some type?
 

ad5ou

Active Member
Jun 12, 2018
884
195
43
Logging out and back in will usually do the trick for that type of problem or you didn't click "reload" after enabling provisioning in default settings.
 

ropeguru

New Member
Feb 28, 2019
25
1
3
55
Logging out and back in will usually do the trick for that type of problem or you didn't click "reload" after enabling provisioning in default settings.


Thanks for all your help...

I have one more "fresh" phone that I will try and get setup and also get DHCP going. Right now I am just using the manual provision option in the phone for testing.
 

ad5ou

Active Member
Jun 12, 2018
884
195
43
Never cared for dealing with DHCP options which is why I have accounts with GAPS, and other redirects servers for the various phones we support
 

ad5ou

Active Member
Jun 12, 2018
884
195
43
Grandstream’s automatic provisioning server/system.
Factory defaulted phones look for initial config from GAPS. Most manufacturers have similar server for basic settings and/or redirect to proper config server.

GAPS access is tied to the distributor phones are purchased from.

Some other manufacturers allow you to “claim” a phone regardless of source once you have an account but with Grandstream you have to get a GAPS account through your distributor and only works on devices purchased from that distributor once they allocate the MAC to your account.
 

henkpls

New Member
Nov 4, 2018
8
2
3
63
Just tested provisioning on my DP750, works great! But I'm missing a lot of settings like 'provision via' and this defaults to HTTP. So my config with password goes over the net without any encryption! Is it possible to add variables to the template?
 

ad5ou

Active Member
Jun 12, 2018
884
195
43
I always suggest making a copy of the model template directory then name it something like dp750-custom before editing things. This way your changes don't conflict with future upgrades.

The default provisioning template for dp750 has provision via "https" <P212>2</P212> but firmware upgrade is hard coded to "http" <P6767>1</P6767>

Once you have a custom template you can easily change any setting you like via hard coded setting or by creating a new variable such as "grandstream_upgrade_via"

In the template it would read <P6767>{$grandstream_upload_via}</P6767>
Then you could create either a new default setting, per device setting, or profile setting to set the new variable to the number you wish to use.

A more advanced and safer variable setting example can be found just below P6767 in the dp750 template by using "if isset" to use the variable if it exists or default to something else.
 

henkpls

New Member
Nov 4, 2018
8
2
3
63
Thank you very much!

In my template and also on Github P212 is set to 1. In this case 2 this is a good default, but this is very useful for other settings.

I found some defaults in /var/www/fusionpbx/app/grandstream/app_config.php and that is a lot more work to customize.
 
Status
Not open for further replies.