AstLinux

AstLinux Add-Ons



 

Alternate Web Interface:

The Alternate Web Interface offers basic AstLinux system configuration and administration via a web browser.
While not all the AstLinux configuration variables in the rc.conf file are configured, many users will find all their required settings are supported via this web interface.

Additionally, asterisk functionality is added, such as organizing and listening to voicemail and editing elements of the internal astdb asterisk database in a user friendly manner.

Beginning with AstLinux 0.6, this web interface has been adopted as the default web interface. The Download and HTTPS Configuration sections below may be skipped, but the remaining sections are equally relevant, regardless of your version of AstLinux.

Download:

AstLinux 1.3.6 and later GUI Version: 1.9.18
Last updated on: Sunday, Sep 29 15:16 UTC 2024
Untar's into altweb/ directory: altweb.tar.gz
Untar's into current (./) directory: altweb-update.tar.gz
install via "tar xzvf altweb-update.tar.gz -C /your_https_dir/"

AstLinux 1.0.0 through 1.3.6 GUI Version: 1.8.49
Untar's into altweb/ directory: altweb.tar.gz
Untar's into current (./) directory: altweb-update.tar.gz

Changelog: altweb-changelog.txt

HTTPS Configuration:

Beginning with AstLinux 0.6, this web interface has been adopted as the default web interface. No installation, no downloading is required. In AstLinix 0.6 the web interface files are located in /stat/var/www/.
If you are using a version before AstLinux 0.6, continue reading this HTTPS Configuration section.

By default, AstLinux starts one HTTP process with nobody permissions, and one HTTPS process with root permissions. This web inteface requires root permissions to interact properly with asterisk and certain system operations. While it is possible to change the HTTP permissions with the HTTPUSER rc.conf variable, the more secure HTTPS server is the recommended method of running this web interface.

By default, AstLinux's HTTPSDIR rc.conf variable points to "/stat/var/www" where the original web interface resides in the standard distribution.
The location of the alternate web interface's files can be about anywhere provided it is not tmpfs space. It is assumned you have either a keydisk configured or are using unionfs, in either case the directory path of /mnt/kd/ is defined and backed by some sort of persistent storage device.
Given a /mnt/kd/ path, one suggestion is to create a directory of /mnt/kd/www/ (when logged in as root) where the web interface can be installed.
The following command will install the alternate web interface at that location:
tar xzvf altweb-update.tar.gz -C /mnt/kd/www/
The next step is to edit your /mnt/kd/rc.conf file and set the following variable:
HTTPSDIR="/mnt/kd/www"
Then reboot, and after a short wait, point your browser to:
https://<astlinix_ip>/
Additionally, if you have no other use for the HTTP server you could have also set the following rc.conf variable:
HTTPDIR="/mnt/kd/www"
This will automatically redirect your browser to a HTTPS session when it is accessed with a HTTP request.

rc.conf vs. rc.conf.d/:

Starting with AstLinux 0.4, Kristian Kielhofner added an enhanced configuration methodology. Rather than using a single /mnt/kd/rc.conf file, and having to remember to update it with new variables as they come along, there is another way.
If a /mnt/kd/rc.conf.d/ directory exists, your system /etc/rc.conf file will be generated by concatenating the /stat/etc/rc.conf with all the *.conf files in the rc.conf.d/ directory.
The alternate web interface creates a gui.network.conf file in the rc.conf.d/ directory when "Save Settings" is clicked from the Network Tab.
If you would like to define a few more variables, or override any decisions the gui makes, a user.conf file is automatically created in the same directory. AstLinux will then concatenate all these files together to create the final variable shell script, /etc/rc.conf. These are done in alphabetical order, so user.conf will be appended to gui.network.conf.

Beginning with AstLinux 0.6, your system /etc/rc.conf file is generated from either the /mnt/kd/rc.conf or /mnt/kd/rc.conf.d/*.conf files. The /mnt/kd/rc.conf.d/ directory has precedence, so if it exists, the /mnt/kd/rc.conf file will be ignored.

The First Time:

The first time you sucessfully access the alternate web interface, click on the Network tab, the settings should reflect your current configuration state, even so, click "Save Settings". The first time you do this step the /mnt/kd/rc.conf.d/ directory is created and a gui.network.conf file in that directory.

The Network tab will also automatically find system variables that are currently defined, differ from the default, and are not defined in the Network tab, (for example the ZAPMODS system variable). The first time you click "Save Settings" a /mnt/kd/rc.conf.d/user.conf file is automatically generated.
After the /mnt/kd/rc.conf.d/ directory exists, this automatic user.conf generation will not occur and the user is free to customize the user.conf file. The Network tab has a button in "Advanced Configuration" called [Edit User Variables] that allows the user to easily edit their user.conf file.

At this point, you should be able to reboot and have your fully functioning AstLinux system with an alternate web interface.

Single and Multi-User Authentication:

User access to the Alternate Web Interface can be set to four basic security levels.

1) If the management password is not set, all tabs are available by anyone. Not recommended unless user access is restricted elsewhere on the network.
In this security level, no admin/.htpasswd files exists.

2) If the management password is set, user "admin" is required to access all tabs.
In this security level, the admin/.htpasswd file is automatically created, and contains a single entry for user admin. This is the default, AstLinux distribution security level with password astlinux. Be sure to change this password via the System tab.

3) In addition to the "admin" management user, a special user of "staff" may be defined. Permissions for "staff" is the same as "admin" user permissions, but without access to the Network, Edit, Prefs and System tabs. All voicemail and monitor recordings will be displayed when authenticated as "staff".

When authenticated as "admin", the System tab allows either the "admin" or "staff" user password to be defined.

4) Additional numbered users can be appended to the admin/.htpasswd file with the htpasswd shell command or automatically via the Users tab. The usernames of these users should match the voicemail mailbox extensions, ie. 1000, 1234, etc.. These non-admin users can only access the Status, Voicemail and Monitor tabs. The Voicemail tab will only show Mbox's that match the username. The Monitor tab will only show recordings in a directory matching the username. All voicemail's and monitor recordings will be shown when logged in as admin or staff.
In this security level, the admin/.htpasswd file contains multiple entries, user admin, user staff, followed by numbered users.

Be assured that resetting either the admin or staff user password in the System tab will not effect non-admin users.

In Summary:
1) "admin" authentication; ALL tabs are available.
2) "staff" authentication; Status, Directory, Voicemail, Monitor, CDR Log, Speed Dial, Caller*ID, Blacklist, Whitelist and Users tabs are available.
3) "NNNN" (numbered user) authentication; Status, Directory, Voicemail and Monitor tabs are available.

Voicemail Users:

With multi-user authentication, it may be desirable to have the voicemail.conf mailbox users match the web-gui Voicemail tab .htpasswd authentication.

The script below should keep the web-gui .htpasswd file sync'ed to the voicemail.conf file when a voicemail user manually changes his/her password from a phone via asterisk's VoiceMailMain().

Voicemail "externpass" script: ast-vmpass.txt
Remove the ".txt" and set "chmod 700" permissions.
Possibly change the WEB_GUI_HTPASSWD path.
Possibly change the CONTEXT value.
In voicemail.conf set "externpass=" to this script location.

Status Tab:

The Status tab provides a quick at-a-glance view of your AstLinux system.

Even when the management password is set, the Status tab is viewable without a password by default (a Prefs tab option can require a password for the Status tab).
The Status tab is the default entry point when accessing the management interface.

The Prefs tab contains many options for what gets displayed in the Status tab.
One key Prefs tab option applies to the Status tab as well as any tab that accesses asterisk commands.

___ Use Asterisk Manager Interface for Asterisk Commands

When unchecked (the default), the system shell uses "asterisk -rx ..." calls to issue commands to asterisk.

When checked, the asterisk manager interface (AMI) is used to issue commands to asterisk, using user/password 'webinterface'. Using the asterisk manager interface requires the /etc/asterisk/manager.conf file to be properly configured. Note that only connections from localhost to localhost are allowed in the snippet below.

---- /etc/asterisk/manager.conf snippet ----
[general]
enabled = yes
port = 5038
bindaddr = 127.0.0.1

; Web interface localhost user for AstLinux
;
[webinterface]
secret = webinterface
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.255
read = command
write = command
---- /etc/asterisk/manager.conf snippet ----

If openvpn is active, a table of users will be displayed, provided a proper log file is generated.

---- /mnt/kd/openvpn/openvpn.conf snippet ----
status-version 2
status /var/log/openvpn-status.log
---- /mnt/kd/openvpn/openvpn.conf snippet ----

Directory Tab:

The Directory tab displays all Speed Dial entries that have a "Name" specified.
By default this tab is hidden, use the Prefs tab to show this tab.

All users have access to the Directory tab without authentication.

Voicemail Tab:

The Voicemail tab allows local, file based voicemail to be played, organized and deleted.
By default this tab is hidden, use the Prefs tab to show this tab.

In order to play voicemail files, your voicemail.conf "format=" line must include either "wav" or "wav49". The wav49 files are actually encoded as "gsm" but wrapped in a wav header. The wav49 format is preferred since the voice quality is good while the file size is much smaller than the standard wav format. Asterisk distinguishes between the two formats by using a .WAV suffix for wav49 files and .wav suffix for standard wav audio files.

By default, voicemail files can be downloaded by clicking on the "Get" action which will download the file and your browser may automatically start a helper application to play the audio file. The Prefs tab has an option to allow your browser to play the voicemail file within the browser. This usually requires Quicktime to be installed. When this option is checked, the "Play" action is available.

The Prefs tab option "Enable Voicemail External Notify Script" supports the voicemail.conf externnotify feature.

If a user is authenticated as a non-admin user, only voicemails with a mailbox matching the user's username will be displayed. The admin or staff users will be able to play all voicemails for all users.

Monitor Tab:

The Monitor tab allows asterisk monitor recordings to be played and deleted.
By default this tab is hidden, use the Prefs tab to show this tab.

As with voicemail audio files, the monitor recordings must be recorded as either wav49 or wav format.

By default, monitor recordings can be downloaded by clicking on the "Get" action which will download the file and your browser may automatically start a helper application to play the audio file. The Prefs tab has an option to allow your browser to play the monitor recording within the browser. This usually requires Quicktime to be installed. When this option is checked, the "Play" action is available.

If a user is authenticated as a non-admin user, only recordings saved with a base directory matching the user's username will be displayed. For example, user 1000 will only see recordings in the 1000/ directory in the monitor directory. The admin or staff users will be able to play all recordings in the monitor directory.

Follow-Me Tab:

The Follow-Me tab uses Asterisk's internal database (astdb) to maintain a list of Follow-Me numbers and their state.

In particular, Asterisk 1.4 supports a Follow-Me application, which makes adding this feature into your dialplan about as easy as it gets.

---- /etc/asterisk/extensions.conf snippet ----
[macro-local-followme]
exten => s,1,GotoIf($[${DB_EXISTS(followme/${ARG1})}=0]?nofollow)
exten => s,n,GotoIf($[${DB_RESULT:0:1}=0]?nofollow:follow)
exten => s,n(follow),Dial(SIP/${ARG1},20)
exten => s,n,Followme(${ARG1},san)
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s,n(nofollow),Dial(SIP/${ARG1},20)
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Voicemail(${ARG1},u) ; If unavailable, send to voicemail
exten => s-BUSY,1,Voicemail(${ARG1},b) ; If busy, send to voicemail w/ busy ann
exten => _s-.,1,Goto(s-NOANSWER,1)
---- /etc/asterisk/extensions.conf snippet ----

Warning! The Follow-Me tab uses the astdb database family "followme", be warned if you already use this in your dialplan! The tab may be safely viewed, but clicking [Save Changes] will write to the database.

The Asterisk followme.conf file is automatically edited and the Asterisk app_followme.so application module is automatically reloaded. Note that the source database is astdb, so if you already have a followme.conf file, you will need to reenter your numbers into the Follow-Me tab.

The Prefs tab has several options for the Follow-Me tab...

=> Follow-Me Numbers Displayed: 1 - 6
The number of numbers available in the Follow-Me tab, defaults to 4.

=> Schedule Menu: | Never~Skip Local Dial |
The Schedule menu will appear in the Follow-Me tab if this text entry is defined. A list of tilde (~) seperated strings can be defined. The result will be a menu starting with "Always" and then followed in the order of your defined list. The value of "Always" is 0, your first string is 1, etc... This value is easily retrieved from a dialplan, but is not automatically supported by the Asterisk Follow-Me application. Another example...

---- /etc/asterisk/extensions.conf snippet ----
[macro-ring-inside]
exten => s,1,GotoIf($[${DB_EXISTS(followme/${ARG1})}=0]?100)
exten => s,n,Set(FM_OPTIONS=${CUT(DB_RESULT,~,1)})
exten => s,n,Set(FM_COUNT=${CUT(FM_OPTIONS,:,1)})
exten => s,n,Set(FM_SCHEDULE=${CUT(FM_OPTIONS,:,3)})
exten => s,n,GotoIf($[${FM_SCHEDULE}=1]?100) ; Never
exten => s,n,GotoIf($[${FM_SCHEDULE}=2]?50) ; Skip Local Dial
exten => s,n,GotoIf($[${FM_COUNT}=0]?100)
; Local Dial then Follow-Me then Voicemail
exten => s,n,Dial(SIP/${ARG1},20)
exten => s,n,Goto(50)
; Follow-Me then Voicemail
exten => s,50,Followme(${ARG1},sn)
exten => s,n,Voicemail(${ARG1},u)
; Local Dial then Voicemail
exten => s,100,Dial(SIP/${ARG1},20)
exten => s,n,Voicemail(${ARG1},u)
---- /etc/asterisk/extensions.conf snippet ----

=> Use Caller*ID Tab Number Format Rules for Follow-Me
This option is checked by default, giving a sanity check to your phone number entries. The administrator can define the format rule or simply uncheck to disable this feature.

All three security levels are supported by the Follow-Me tab: admin, staff and 'numbered' user. The non-admin 'numbered' user can only edit the status of their Follow-Me numbers.

Finally, it is suggested in the Prefs tab to have
_X_ Use Asterisk Manager Interface for Asterisk Commands
checked, since the performance of the Follow-Me tab will be greatly improved.

CDR Log Tab:

The CDR Log tab displays a quick view of the most recent calls sorted from newest to older.

It is suggested that a special custom CDR format be defined in cdr_custom.conf. That custom CDR format is defined below. If you prefer not to define a custom format, the Prefs tab allows the standard default asterisk CDR log format to be used. The Prefs tab also allows the name and location of the CDR file to be specified.

The Prefs tab allows three CDR Log Format's:

[Standard cdr-csv]
The standard default format logged to /var/log/asterisk/cdr-csv/Master.csv.

[Default cdr-custom]
The default format described in the cdr_custom.conf file, commented-out by default. (Yes, it is different from the [Standard cdr-csv])

[Special cdr-custom]
Below is the CDR Log tab cdr_custom.conf Master.csv definition for [Special cdr-custom].

---- /etc/asterisk/cdr_custom.conf snippet ----
Master.csv => "${CDR(start)}","${CDR(clid)}","${CDR(dst)}","${CDR(dcontext)}","${CDR(billsec)}"
---- /etc/asterisk/cdr_custom.conf snippet ----

The CDR Log Path: defaults to /var/log/asterisk/cdr-csv/Master.csv and CDR Log Format: [Standard cdr-csv].

Speed Dial Tab:

The Speed Dial tab adds a web dialog interface to the asterisk astdb database, using Family: sysdial.
The Name entries are saved in the asterisk astdb database, using Family: sysdialname.

If a Speed Dial entry contains a "Name", the name and and extension will automatically appear in the Directory tab.

The example prefix is "11", but that is your choosing in your extensions.conf dialplan. The Prefs tab allows this prefix "label" to be changed.

The number of speed dial entries defaults to 50, with digits "00 to 49". The Prefs tab allows the user to set the digits from "00 to 09" through "00 to 99". This allows the Speed Dial tab to match your extensions.conf dialplan logic with up to 100 speed dial entries.

Below is an example extensions.conf snippet:

---- /etc/asterisk/extensions.conf snippet ----
exten => _11[01234]X,1,Macro(dial-sysdial,${EXTEN:2:2}) ; DB: sysdial/00-49

[macro-dial-sysdial]
exten => s,1,Answer
exten => s,n,GotoIf($[${DB_EXISTS(sysdial/${ARG1})} = 0]?100)
exten => s,n,Set(CALLERID(num)=${HOME_CIDNUM})
exten => s,n,Set(CALLERID(name)=${HOME_CIDNAME})
exten => s,n,DIAL(${DB_RESULT},${DIALOUTTIME})
exten => s,n,Hangup

exten => s,100,Playback(extras/num-not-in-db)
exten => s,n,Hangup
---- /etc/asterisk/extensions.conf snippet ----

Caller*ID Tab:

The Caller*ID tab adds a web dialog interface to the asterisk astdb database, using Family: cidname

The Prefs tab contains some relevant options.
The default "Number Format:" matches the NANPA numbering system for North America.
^[2-9][0-9][0-9][2-9][0-9][0-9][0-9][0-9][0-9][0-9]$
The "Number Format:" specification is very flexible, using the standard UNIX regular expression syntax.
Another example, allow any number 0-9 with at least 6 digits and at most 16 digits.
^[0-9]{6,16}$
See the Prefs Tab: section for more example regular expressions.

For completeness, edit the "Error String:" to remind you what your number format is when there is an error.

Defining the proper number format ensures only proper asterisk astdb keys are used and minimizes input errors.

The Prefs tab also allows the CID Name field to be limited to a maximum number of characters.

Below is an example extensions.conf snippet:

---- /etc/asterisk/extensions.conf snippet ----
exten => s,100,GotoIf($[${DB_EXISTS(cidname/${CALLERID(num)})} = 0]?200)
exten => s,n,Set(CALLERID(name)=${DB_RESULT:0:15})

exten => s,200,NoOp(${CALLERID(num)})
---- /etc/asterisk/extensions.conf snippet ----

Blacklist Tab:

The Blacklist tab adds a web dialog interface to the asterisk astdb database, using Family: blacklist

See Caller*ID description for Number Format configuration.

Below is an example extensions.conf snippet:

---- /etc/asterisk/extensions.conf snippet ----
exten => s,100,GotoIf($[${DB_EXISTS(blacklist/${CALLERID(num)})} = 0]?200) ; blacklist test
exten => s,n,GotoIf($["${DB_RESULT}" = "0"]?110)
exten => s,n,GotoIf($["${DB_RESULT}" = "2"]?120)
exten => s,n,Goto(blacklist,s,1) ; "1" TN in blacklist database, answer and Zapateller

exten => s,110,Goto(blacklist,no-answer,1) ; "0" TN in blacklist, don't answer
exten => s,120,Goto(voicemail-ivr,s,1) ; "2" TN in blacklist, direct to voicemail

exten => s,200,NoOp(Valid TN:${CALLERID(num)})
---- /etc/asterisk/extensions.conf snippet ----

Whitelist Tab:

The Whitelist tab adds a web dialog interface to the asterisk astdb database, using Family: whitelist
By default this tab is hidden, use the Prefs tab to show this tab.

See Caller*ID description for Number Format configuration.

Below is an example extensions.conf snippet:

---- /etc/asterisk/extensions.conf snippet ----
exten => s,100,GotoIf($[${DB_EXISTS(whitelist/${CALLERID(num)})} = 0]?200) ; whitelist test
exten => s,n,GotoIf($["${DB_RESULT}" = "0"]?110)
exten => s,n,GotoIf($["${DB_RESULT}" = "2"]?120)
exten => s,n,GotoIf($["${DB_RESULT}" = "3"]?130)
exten => s,n,GotoIf($["${DB_RESULT}" = "4"]?140)
exten => s,n,Goto(whitelist,s,1) ; "1" TN in whitelist database, Priority

exten => s,110,Goto(voicemail-ivr,s,1) ; "0" TN in whitelist, direct to voicemail
exten => s,120,Goto(whitelist,standard,1) ; "2" TN in whitelist, Standard
exten => s,130,Goto(whitelist,followme,1) ; "3" TN in whitelist, Follow Me
exten => s,140,Goto(whitelist,ivr,1) ; "4" TN in whitelist, IVR

exten => s,200,NoOp(Valid TN:${CALLERID(num)})
---- /etc/asterisk/extensions.conf snippet ----

Users Tab:

The Users tab provides Voicemail Users Management. The asterisk voicemail.conf file is edited via the web-gui. Additionally, web-gui usernames/passwords (.htpasswd) are automatically generated/deleted to match asterisk's VoiceMailMain() passwords.
By default this tab is hidden, use the Prefs tab to show this tab.

A single voicemail context is supported, "default" is the default context. The Prefs tab allows the user to specify an alternate voicemail context.

Clicking on hightlighted Mailbox numbers will load the edit fields with the current settings for that mailbox. This allows quick changes or a template for a new mailbox entry.

Whenever the "Save Settings" button is clicked, the voicemail.conf is edited to reflect changes. Additionally, the local .htpasswd file is updated to reflect the changes.

After the configuration has been saved, click the "Reload Voicemail" button to force asterisk to reread the resulting voicemail.conf file. The asterisk command that the "Reload Voicemail" button issues can be customized in the Prefs tab.

See the "Voicemail Users:" section in this document to keep passwords sync'ed when users change their password via VoiceMailMain().

Network Tab:

The Network tab allows the AstLinux system variables to be defined in a web based dialog.

While not all the AstLinux configuration variables in the rc.conf file are configured, many users will find all their required settings are supported via the Network tab.

The first time you run this web interface, you will want to click "Save Settings" to create a configuration file. Be sure to read the above "The First Time:" section.

Note: The HTTPS configuration variables can be changed, but changing any of these entries will effect (possibly disable) the web interface, and we wouldn't want that, would we?

Keep in mind that any of the options in the Network tab can be overridden with a user.conf file in the /mnt/kd/rc.conf.d/ directory. If you are having a problem with changes in the Network tab not changing your system after a reboot, make sure no user.conf entry is taking precedence.

Firewall Configuration:
A basic set of firewall rules can be defined by clicking on the [Firewall Configuration] button in the Network tab.

By default, no traffic is allowed from the External Interface (EXT) to either the AstLinux box itself (Local) or all Internal Interfaces (LAN). Additionally, by default, all traffic is allowed from Local to EXT, LAN to EXT, and LAN to Local. Note that LAN users can reach Local by using the IP address of its corresponding Internal Interface.

Firewall Plugins: [ 'Plugin' Enabled/Disabled ] - [Configure Plugin]
This feature shows a list of the available arno firewall plugins, and whether they are Enabled or Disabled. Select a plugin of interest, then click the [Configure Plugin] button to edit the plugin configuration.

Edit Tab:

The Edit tab allows system and asterisk configuration files to be viewed, edited and saved.

A list of configuration files and a brief description is displayed. Select the file and click "Open File".

Any editing changes are not saved until the "Save Changes" button is clicked. Be careful, if you make changes without saving them, then click any tab, your editing will be lost.

The Prefs tab offers some options. If "Save original file as backup with a .bak suffix" is checked a backup of the original file will be automatically created by appending a ".bak" suffix to the original name. Should a disk write fail, the ".bak" file will be available regardless whether this option is checked.
The size of editing area can be set, from 80 to 160 columns and from 20 to 60 rows. The default is 95 columns and 30 rows.

Note: The size of editable files is limited to 250,000 bytes as a safety measure. While the process of filling a browser full of HTML generated from a configuration file, then edited in a web browser, and then POST'ing back to the host, translating characters in both directions... it is amazing this works as well as it does.
It should be made clear that a vi session over ssh is a more robust method of editing configuration files.

Prefs Tab:

The Prefs tab allows the user to customize how the management interface looks and works.

The Prefs tab options are stored in the prefs.txt file at the base of the web directory. Note the Prefs tab operates at a system level, no matter who accesses the web interface, the same Prefs apply.

Not all of the available tabs are shown by default. The Prefs tab allows the user to show only the relevant tabs for their situation.

Most of the Prefs tab options are self explanatory, but one that is not is the "Number Format:".

The default "Number Format:" matches the NANPA numbering system for North America.
^[2-9][0-9][0-9][2-9][0-9][0-9][0-9][0-9][0-9][0-9]$

The "Number Format:" specification is very flexible, using the standard UNIX regular expression syntax.
Example UNIX regular expressions...

Allow one or more digits
^[0-9]+$
Allow any number 0-9 with at least 6 digits and at most 16 digits.
^[0-9]{6,16}$
Allow the number 1 followed by one or more digits
^1[0-9]+$
Allow the number 1 followed by exactly four digits
^1[0-9]{4}$
Allow the number 1 followed by four up to ten digits
^1[0-9]{4,10}$
Allow the numbers 0 or 1 followed by exactly four digits
^[01]([0-9]{4})$
Allow the number 2 followed by exactly three digits, OR
Allow the number 4 followed by exactly five digits
^((2[0-9]{3})|(4[0-9]{5}))$
Allow the number 2 followed by two or three digits, OR
Allow the number 4 followed by four up to nine digits
^((2[0-9]{2,3})|(4[0-9]{4,9}))$

For completeness, edit the "Error String:" to remind you what your number format is when there is an error.

Under the General Options: section, there is a feature that places a persistant html link in the upper-right portion of all web-gui screens.

External URL Link:
External URL Name:

If "External URL Link" is empty, this feature is disabled. The "External URL Link" entry will set the 'href=' value to the html anchor. Usually this will begin with http://... The "External URL Name" will be the text associated with the link.

If the URL contains the string "://localhost" then this special case will replace the "localhost" string with the hostname the user's browser is currently using to access altweb.
For example, if you use https://my.public.tld/status.php to access altweb, you can specify http://localhost:8088/asterisk/ as the "External URL Link" it will expand to http://my.public.tld:8088/asterisk/ in the 'href=' value.
If a port number exists in both the browser and ://localhost:NNNN in the "External URL Link" the "External URL Link" port number NNNN has precedence.

System Tab:

The System tab allows the management passwords to be set or changed.
The Username can be selected as either admin or staff when changing the password. Set the admin password first.

The "Configuration/File Backup:" feature alows the user to easily create tar.gz archives using various backup sets. All backups are performed starting from the /mnt/kd/ directory.

Choose from the backup sets shown in the menu, then click the "Download Backup" button to create a tar.gz backup and download it to your computer via the browser.

Note: The resulting tar archives are created to extract in-place. For example, if you have a backup named "pbx-core-2008-08-09.tar.gz" and want to restore the data, simply ftp the file to your system and type:

tar xzvf pbx-core-2008-08-09.tar.gz -C /mnt/kd/

or, place the backup tar.gz in the /mnt/kd/ directory and:

cd /mnt/kd/
tar xzvf pbx-core-2008-08-09.tar.gz


Note: By default, the temporary file created for the tar backups are in the /tmp/ system directory, which by default is 10MB in size. Be warned that if you have large voicemail or monitor directorys in the /mnt/kd path, the 10MB size may be exceeded for some backup sets. In that case, there is a Prefs tab option

__ Backup temporary file uses /mnt/kd/ instead of /tmp/

When checked, the temporary file is placed on /mnt/kd/.

A list the the current system configuration variables is shown in the System tab. Note that these are the currently active variables, if you have made a change to the Network tab, those changes will not be reflected until a reboot.

System Firmware Upgrade:
A new feature beginning with AstLinux 0.6.2 allows firmware upgrades of the run-image via the System tab. Check for New, Upgrade with New, Show Installed, and Revert to Previous (Firmware) are the available options. The goal is to automatically maintain two run-images.

The "System Firmware Upgrade" repository can be a private or trusted public URL. The Prefs tab allows the Repository URL to be specified. The file format of the repository is described below for three example platforms for the "astlinux-0.6.2" run image:

./net5501/ver
./net5501/astlinux-0.6.2.tar.gz.sha1
./net5501/astlinux-0.6.2.tar.gz
./via/ver
./via/astlinux-0.6.2.tar.gz.sha1
./via/astlinux-0.6.2.tar.gz
./via-serial/ver
./via-serial/astlinux-0.6.2.tar.gz.sha1
./via-serial/astlinux-0.6.2.tar.gz

where: echo "astlinux-0.6.2" > ver

After an upgrade is successful, the system must be rebooted for the new run-image to be made active. By default, the previous run-image is saved and can "Revert to Previous" if desired.