Automatic Setup of Registration and Mailbox 3
[ F R E Q U E N T L Y A S K E D Q U E S T I O N ]
PHP script
The PHP script generates an html page that could come from a manual conguration
setup.
The MAC address of the phone is provided as argument to the page url and the script puts
this into the variable number. The type of phone is dened in the variable type.
To avoid overwriting already existing mailbox setup, the script rst checks whether a
mailbox has already been set up by checking for a le. This le is created when the mailbox has
been set up at the end of the mailbox setup part of the script.
In this example, the script converts the hex MAC number into a telephone-like number. It
is important that the function does not generate the same number for different MAC addresses.
Typically, this part should be replaced with a database lookup. Here the script could also check
whether the phone has been registered for this service (for example at the point of sale).
The mailbox creation and setup are done with a curl system call. See the FAQ on Controlling
the 4S for details on this.
After this, the necessary settings are printed using the echo instruction of PHP. Here, too,
we set the address of the music on hold server so that callers can hear music when they are
put on hold.
The settings are writable (exclamation mark) so that the user may change them if desired.
Whether this is made stricter depends upon the operator’s policy.