spaconf is a tool which can be used with an analog phone adapter (ATA) such as the Sipura SPA 3000 and Linksys PAP2. These devices are normally configured via a web interface, but this tool allows you to read the configuration from the device and store it in a text file, or take a text file and copy the configuration to the device.
Why would you want to use this?
- you can back up your configuration to a computer
- you can more easily swap configurations with other users
- you can compare configurations easily (using diff)
- you can use this tool to update your configuration programmatically (for different times of day, etc.)
- you can store your configuration in a source control system
- you prefer editing text files to using web interfaces
spaconf is written in python and should run anywhere python runs (Unix, Windows, Mac, etc.).
It requires Python 2.3 or newer.
- Home page:
spaconf is available as source code in .tar.gz format (requires python to run) and as a Windows standalone executable (choose the .zip file).
- All downloads are available from:
- Sample config file:
usage: spaconf.py [-nq] <src> [<dest>]
spaconf.py can read the active configuration from a Sipura SPA or Linksys PAP2 analog telephone adapter (ATA) and store it in a text file, or can take an existing text file and write that configuration to the ATA. Configuration options are stored as key-value pairs.
One of <src> or <dest> should be a local file path, and the other should be a URL to your ATA with the username and password embedded. If <src> or <dest> is a hyphen (-), standard input or output is used. <src> can also be a key-value pair (i.e., key = value).
-n, --noboot Do not reboot the ATA after configuring it. -q, --quiet Do not print informational messages.
- Write ATA config to standard output:
- spaconf.py http://admin:mypassword@myata/
or spaconf.py http://admin:mypassword@myata/ -
- Copy ATA config into a config file:
- spaconf.py http://admin:mypassword@myata/ ata.config
- Or use an explicit IP if necessary:
- spaconf.py http://admin:firstname.lastname@example.org/ ata.config
- Copy a config file to the ATA device (no reboot afterward):
- spaconf.py --noboot ata.config http://admin:email@example.com/
- Copy config options from standard input to the ATA device:
- spaconf.py - http://admin:mypassword@myata/
- Set a single option (key/value pair):
- spaconf.py key = value http://admin:mypassword@myata/
or spaconf.py key value http://admin:mypassword@myata/
When reading a config from an ATA, this script unfortunately cannot retrieve the passwords. They appear as stars ("****"). It is however safe to write such a configuration back to the device; such passwords will be ignored, and the passwords in the device will be left unchanged. If you edit a config file to contain a (non-star) password, however, it will be changed.
It is not necessary that a config file contain key-value pairs for every option supported by the ATA. Any options not present will not be changed.
Lines beginning with # in a config file are taken as comments and ignored. Lines beginning with ! are printed to standard out when the config file is restored to an ATA.
Single and double quotes are permitted around option values (single quotes are used in generated files) but may be omitted. When using a key-value pair in the command, it is good practice to use single quotes around the value to keep the shell from munging it.
This program has been tested with the Sipura SPA 3000 (firmware versions 2.0.13g and 3.1.3), and with the Linksys PAP2 (firmware 3.1.9 and 5.1.5). Your mileage may vary.
- Huge thanks to Jerry Kindall for patches which:
- add better support for Linksys PAP2 devices
- fixed bug where spaconf couldn't handle values containing "="
- allow stdin/stdout to be used for config files
- allow the reboot to be suppressed
- more verbose output (and --quiet option)
- script returns an error code (0 is success)
- allow you to set a single configuration value from command line
Sorry, no windows executable for this version yet.
Added alternate URLs for compatibility with Linksys PAP devices.
- Initial release (0.1).
- Please send me comments, bug reports, etc. firstname.lastname@example.org (better yet, please send patches!)