This is an old revision of the document!
Table of Contents
FreePBX 17 and Asterisk on Virtual Box/OCI, Hams Over IP, Cisco SPA504G
Basic FreePBX 17 and Asterisk install
Virtual box setup
Oracle Cloud Infrastructure PBX Server Setup
# Copy down private key, store and set security on it cd keys sudo chmod 60 ssh-key-2025-07-11.key # ssh on to cloud instance sudo ssh -i ./keys/ssh-key-2025-07-11.key ubuntu@152.67.159.88 sudo apt update sudo apt full-upgrade sudo apt install nano sudo apt install cron sudo systemctl start cron sudo systemctl enable cron
https://www.atlantic.net/vps-hosting/how-to-install-asterisk-and-freepbx-on-ubuntu/
after ./install -n messages about SIP missing fwconsole ma install pm2 Rerun ./install -n
sudo apt update sudo apt full-upgrade sudo apt install apache2 -y sudo usermod -G www-data -a ubuntu sudo usermod -G www-data -a root sudo chown -R www-data:www-data /var/www/html sudo chmod -R 775 /var/www/html sudo apt install php7.4-common php7.4-cgi php7.4 -y sudo apt install libapache2-mod-php7.4 -y
sudo nano /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
sudo nano /etc/apache2/ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 80
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
sudo systemctl restart apache2
Update firewall rules 42002 Reflector and 80 Web Dashboard
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 42002 -j ACCEPT sudo iptables -I INPUT 6 -m state --state NEW -p udp --dport 42002 -j ACCEPT sudo netfilter-persistent save
Check firewall rules
sudo iptables -S
Hams Over IP install
https://hamsoverip.github.io/wiki/endpoints/hard_phones/cisco504g/
Manual provisioning following sign up email
Check in Advanced for HOIP EXT that SIP is over UDP
Cisco SPA504G IP Phone
Firmware update for Cisco SPA504G IP Phone
https://software.cisco.com/download/home/282724650/type/282582477/release/7.5.6
Virtual box windows instance in network bridge mode then on same network as SPA. 7.5.2b then 7.6.2 then 7.6.2SR6 Using the firmware updater from each release. SR7 did not have a firmware updater.
Connect Ext 2 to Local Asterisk PBX
TCP must be enabled. PBX on different IP so can use default port. Ext 2 tab - line enable AND Phone tab - Line key 2 enabled.
Change background image on phone
The picture need to be of a specific size. If size is not correct, it will not show up on your phone. 128 x 48 pixels and 1-bit Deep Convert any picture to this size using any graphic editing tool, then upload to a web server and use it's URL to set-up the picture on your SPA 504G.
Tips and tricks
Reboot
Spare ext 4 button - To send an HTTP request
This might be the only (roundabout) way to get web interaction on the 504G. From a Programmable Soft Key - Call a URL to perform a task, that returns an XML result. No support of HTML or RSS on the 504 phone.
The PHP example on this link is confusing/missing.
Setup on spare ext 4 button
fnc=xml;url=http://192.168.0.186/test.php;nme=TeaPlease!
PHP script
<?php
header('Content-Type: application/xml');
echo '<CiscoIPPhoneText>';
echo '<Title>Tea Status</Title>';
echo '<Prompt>Thanks!</Prompt>';
echo '<Text>Your Tea Request Was Successful!</Text>';
echo '</CiscoIPPhoneText>';
?>
Key thing is only Cisco “SPA50x” XML objects can be used for the reply.
The URL can be called directly - as above, or an XML file can be used to define the URL and handling of response.
The best “Doc” found so far. Obviously only a few of these XML objects apply to the older SPA50x.
Enable SPA50x Debug
SPA504G Configuration Utility
Voice, System, Optional Network Configuration
Syslog Server
sudo nano /etc/rsyslog.conf include UDP/TCP sudo service rsyslog restart sudo tail -f /var/log/syslog
Programmable Softkey for DTMF TX/RX
TBA
Using AllStar
Connecting
https://freestar.network/connect/
Via HamShackHotline 94107
10 Second Bleeps Off! - Thanks M7TLB and G5SRO
SPA504G Configuration Utility
Advanced, Voice ,Text Message From 3rd Party: No, Text Message: No, No Text Alert: Yes, Submit all changes
Configure Soft Key for DTMF TX RX
*99 to key up and # to drop the key
https://help.webex.com/en-us/article/ny1ibtz/Programmable-softkeys-configuration
Change colours and flashing of line LED's
SPA504G Configuration Utility
Admin,Advanced,Voice,Phone
Switch off Line 1 LED
c=o
