Skip to content

Deploy Configuration Changes

This guide covers deploying Asterisk and platform configuration changes to both the NUC gateway and the cloud PBX server.

Always back up first

Before modifying any configuration file, create a backup:

cp /etc/asterisk/somefile.conf /etc/asterisk/somefile.conf.bak

Git Workflow

All configuration is tracked in the astradial/sip-gateway GitHub repository.

# Make changes locally or on the server
git add -A
git commit -m "description of change"
git push origin main

Tip

Commit and push before deploying so there is always a rollback point.


NUC Configuration Changes

The NUC gateway handles Tata SIP trunk termination and routes calls to the cloud.

Option A: Edit locally and SCP

# Edit the file on your local machine
nano ext_tata_gateway.conf

# Copy to NUC (via local network)
scp ext_tata_gateway.conf user@192.168.0.13:/tmp/

# SSH to NUC and move into place
ssh user@192.168.0.13
sudo cp /tmp/ext_tata_gateway.conf /etc/asterisk/
sudo chown asterisk:asterisk /etc/asterisk/ext_tata_gateway.conf

Option B: Git pull on NUC

ssh user@192.168.0.13
cd /path/to/sip-gateway
git pull origin main
sudo cp configs/nuc/* /etc/asterisk/
sudo chown -R asterisk:asterisk /etc/asterisk/

Apply the changes

After copying files, reload or restart Asterisk on the NUC (see reload commands below).


Cloud Configuration Changes

SSH to the cloud server and edit directly, or pull from git:

ssh root@89.116.31.109

# Direct edit
sudo nano /etc/asterisk/pjsip_wizard.conf

# Or git pull
cd /path/to/sip-gateway
git pull origin main
sudo cp configs/cloud/* /etc/asterisk/
sudo chown -R asterisk:asterisk /etc/asterisk/

Reload Commands

Use the least disruptive reload method for the type of change.

Dialplan changes only

Dialplan changes (extensions.conf, ext_*.conf) require only a dialplan reload. This does not affect active calls.

asterisk -rx 'dialplan reload'

PJSIP changes

Changes to PJSIP configuration (pjsip.conf, pjsip_wizard.conf, endpoint/transport definitions) require a module reload:

asterisk -rx 'module reload res_pjsip.so'

Warning

Reloading res_pjsip.so may briefly interrupt registrations. Endpoints will re-register automatically within their registration interval (typically 60-300 seconds).

Other module-specific reloads

Change type Reload command
Dialplan asterisk -rx 'dialplan reload'
PJSIP asterisk -rx 'module reload res_pjsip.so'
Voicemail asterisk -rx 'voicemail reload'
Music on Hold asterisk -rx 'module reload res_musiconhold.so'
CDR asterisk -rx 'module reload cdr_manager.so'

Full Asterisk restart

Only use this when a module reload is insufficient, or after major changes:

asterisk -rx 'core restart now'

Call disruption

core restart now drops all active calls immediately. Use core restart gracefully to wait for active calls to end before restarting:

asterisk -rx 'core restart gracefully'

Deployment Checklist

  • [ ] Changes committed and pushed to astradial/sip-gateway
  • [ ] Backup of existing config created (.bak file)
  • [ ] Config files copied to /etc/asterisk/ with correct ownership (asterisk:asterisk)
  • [ ] Appropriate reload command issued (not a full restart unless necessary)
  • [ ] Verified changes loaded: asterisk -rx 'dialplan show <context>' or asterisk -rx 'pjsip show endpoints'
  • [ ] Test call placed to confirm routing works
  • [ ] Checked /var/log/asterisk/full for errors

Rollback

If something goes wrong, restore from backup:

sudo cp /etc/asterisk/somefile.conf.bak /etc/asterisk/somefile.conf
sudo chown asterisk:asterisk /etc/asterisk/somefile.conf
asterisk -rx 'dialplan reload'  # or appropriate reload

Or revert the git commit and redeploy:

git revert HEAD
git push origin main
# Then copy and reload as above