User Tools

Site Tools


asterisk

This is an old revision of the document!


FreePBX 17 and Asterisk on Virtual Box/OCI, Hams Over IP, Cisco SPA504G


Basic FreePBX 17 and Asterisk install

Virtual box setup

NAT and Bridged required.

Debian 12 Install

Setup with opensource only switch. Much better!

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-19.key

# ssh on to cloud instance
sudo ssh -i ./keys/ssh-key-2025-07-19.key ubuntu@xx.xx.xx.xx
sudo apt update
sudo apt full-upgrade

sudo apt install nano
sudo apt install cron
sudo systemctl start cron
sudo systemctl enable cron
sudo apt install ufw
sudo apt install net-tools

UFW install

Revised to install UFW, use this instead of directly changing iptables

sudo ufw status
sudo ufw allow http
sudo ufw allow ssh
sudo ufw allow 5060:5061/udp
sudo ufw allow 10000:20000/udp
sudo ufw enable

Asterisk / FreePBX on Ubuntu

FreePBX Config

Load User and other modules - Admin, Check Online, Select then process.

if you need to Unlock the admin page sudo fwconsole unlock s231lcov0fbdsnhaiidchantu4 (highlighted PHP session text)

User Ext Setup

Had to change SIP port directly in asterisk - FreePBX ad restart did not work sudo nano /etc/asterisk/sip_general_additional.conf

Revise sudo nano /etc/php/*/apache2/php.ini ; Maximum amount of memory a script may consume ; https://php.net/memory-limit memory_limit = 256M

SIP TCP Port Min: 560 - 580 updated 5081


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://www.cisco.com/c/dam/en/us/td/docs/voice_ip_comm/csbpipp/ip_phones/user/guide/50X_sip_user_guide_source/500_SIP_user.pdf

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

UDP 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.

https://community.cisco.com/t5/voice-systems-and-accessories-small-business/programmable-soft-key-help-how-to-solved-answered/m-p/3274669

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.

https://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cuipph/all_models/xsi/9-1-1/CUIP_BK_P82B3B16_00_phones-services-application-development-notes/CUIP_BK_P82B3B16_00_phones-services-application-development-notes_appendix_01011.html

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

Change colours and flashing of line LED's

asterisk.1753031734.txt.gz · Last modified: by nicolas