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
Update firewall rules 80 Web Dashboard
Stateless connection needed for 80? - sudo iptables -I INPUT -p tcp -m tcp –dport 80 -j ACCEPT did not work.
sudo iptables -S
sudo iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT sudo netfilter-persistent save
This gets the web server visible
FreePBX Config
Load User and other modules - Admin, Check Online, Select then process.
Unlock sudo fwconsole unlock s231lcov0fbdsnhaiidchantu4 (highlighted PHP session text)
Update firewall rules 42002 SIP - UDP 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 udp –dport 42002 -j ACCEPT
Check firewall rules
UFW install
Revised to install UFW, use this instead of directly changing iptables
sudo apt install ufw sudo ufw status sudo ufw allow 5060:5061/udp sudo ufw allow 10000:20000/udp
User Ext Setup
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
