PJSIP and ISP SIP trunk

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