Quantcast
Channel: FreePBX Community Forums - Latest posts
Viewing all articles
Browse latest Browse all 225687

Pjsip with a dynamic IP address

$
0
0

I have managed to make some progress with this problem.

Having modified a script I found on the internet as follows (/scripts/ipchange.sh)


#!/bin/sh
# Script that restarts asterisk when the external IP address has changed

# 1. check if IP changed since last update
# 2. If not, die
# 3. if it has, restart asterisk.

# RUN IN FOLDER WHERE PERSISTENT DATA CAN BE STORED.
cd /scripts

echo $(wget http://ipecho.net/plain -O - -q ; echo | grep inet) > newip

NEWIP=$(cut -f2 -d' ' newip)
NEWIP=${NEWIP##addr:}
OLDIP=$(cut -f2 -d' ' oldip)
OLDIP=${OLDIP##addr:}

if [ ! "$NEWIP" == "$OLDIP" ] ; then
service asterisk restart
fi
rm oldip
mv newip oldip


and set it run every five minutes as a cron job the PBX can now recover from an IP change without any user intervention.

However I am still struggling to work out how to change the “Match: xxx.xxx.xx.xxx/32" section of the remote trunk to reflect the the new address.

Again, any assistance would be gratefully received.


Viewing all articles
Browse latest Browse all 225687

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>