File Access
From Pbxnsip Wiki
Purpose
There are several situations when it is desirable to serve files to attached devices, for example:
- A phone wants to retrieve configuration files
- A phone wants to fetch its firmware
- A user pushes the address book button on the phone and wants to retrieve a XML file with the address book content
The phone can serve these files using tftp, http or https protocol. It does not matter what method being used.
Sending Static Files
Static files are files that are sent without modification from the PBX. They must be put into the tftp directory. This directory is relative to the working directory of the PBX; if it does not exist after the installation just create the directory.
The information in this directory is treated as "public". That means anybody can access the information without authentication, as tftp does not provide any authentication mechanisms. As a consequence, you should not put files there that contain security-relevant information.
If you access the file using tftp, the pathname must not include the tftp directory name (for example, if the file is in tftp/config.xml then tftp would use the file name config.xml). If you access the file using http or https, the path name must include the tftp directory name, for example "http://192.168.1.2/tftp/config.xml").
Generating Files on the Fly
Obviously, provisioning address book information requires that the PBX generates those files on the fly. The mechanism is similar to the generation of web pages, which typically also contain a lot of dynamically generated content.
This topic is more complex than the sending of static files. The content for those files is usually in the html directory. For more information, see Automatic Provisioning.
