PJSIP and ISP SIP trunk

That seems doing the trick !

In fact, into Asterisk SIP Settings an old IP address was shown, ( being a dynamic address dsl line) , once refreshed with “detect network settings” button and reload , problem seems solved.
Shouldn’t that IP address setting be updated automatically in case of public IP change ?

How would it know?

Not a system expert, but it should be one of simplest things a linux system would be capable of…
i.e. a routine checking external ip address changes periodically, like you hit “detect network settings” button every X minutes…

res_stun_monitor?

but…

I’ve never used it (all asterisk’s I have are static). I’m skeptical.

I wonder whether pjsip makes use of it. This module kind of looks neglected & hasn’t many friends.

All the functions are built into FreePBX’s command line tool fwconsole; you just have to write a script to do that and add it to crontab at a reasonable interval.

#!/bin/bash

CURR_EXT_IP=$( fwconsole kvstore --action get --key externip Sipsettings )
REAL_EXT_IP=\"$( fwconsole extip )\"

# echo "CURR_EXT_IP is $CURR_EXT_IP"
# echo "REAL_EXT_IP is $REAL_EXT_IP"

if [ $CURR_EXT_IP == $REAL_EXT_IP ] ; then
	# echo "No change in IP"
	exit	
else
	# echo "External IP changed"
	fwconsole kvstore --action set --key externip --value $REAL_EXT_IP Sipsettings
	fwconsole r
	# do the following if you have PJSIP transport reload disabled - need to restart asterisk
	asterisk -rx "core restart when convenient"
fi
1 Like

Change log reads as if PJSip should be aware.

Not much for the module itself to do other than check the stun server and raise the event.

Maybe someone with some spare time(does that exist?) can do some testing and figure out if it’s at all useful.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.