From 991da0df4c07e20208b251512c650f4224f7914e Mon Sep 17 00:00:00 2001 From: mpmc Date: Fri, 23 Jun 2023 21:07:37 +0100 Subject: [PATCH] asterisk: add pjsip.conf & res_stun_monitor.conf and its .sample --- asterisk/conf/modules.conf | 3 ++- asterisk/conf/pjsip.conf | 21 +++++++++++++++ asterisk/conf/res_stun_monitor.conf | 9 +++++++ .../samples/conf/res_stun_monitor.conf.sample | 27 +++++++++++++++++++ 4 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 asterisk/conf/pjsip.conf create mode 100644 asterisk/conf/res_stun_monitor.conf create mode 100644 asterisk/samples/conf/res_stun_monitor.conf.sample diff --git a/asterisk/conf/modules.conf b/asterisk/conf/modules.conf index 1e49347..ee663a6 100644 --- a/asterisk/conf/modules.conf +++ b/asterisk/conf/modules.conf @@ -1,7 +1,8 @@ ; ; /etc/asterisk/modules.conf ; -; This is the same as the sample but without the text. +; This is the same as the sample but without text. +; [modules] autoload=yes diff --git a/asterisk/conf/pjsip.conf b/asterisk/conf/pjsip.conf new file mode 100644 index 0000000..6fb8680 --- /dev/null +++ b/asterisk/conf/pjsip.conf @@ -0,0 +1,21 @@ +; +; /etc/asterisk/pjsip.conf +; +; Inspired by/Stolen from https://www.sacredheartsc.com/blog/building-a-personal-voip-system/ +; +[global] +; A type is always required (say the docs). +type = global + +; KYE (Know your endpoint ;) ) ordering. +endpoint_identifier_order = ip,username,anonymous + +; Basic UDP Transport. +[ipv4-udp] +type = transport +bind = 0.0.0.0:15000 +protocol = udp +local_net = 172.16.0.0/12 +local_net = 192.168.0.0/16 +local_net = 127.0.0.0/8 +local_net = 10.0.0.0/8 diff --git a/asterisk/conf/res_stun_monitor.conf b/asterisk/conf/res_stun_monitor.conf new file mode 100644 index 0000000..ad5e904 --- /dev/null +++ b/asterisk/conf/res_stun_monitor.conf @@ -0,0 +1,9 @@ +; +; /etc/asterisk/rtp.conf +; +; This really isn't needed unless you're behind NAT. +; +[general] + +stunaddr = stun.aa.net.uk:3478 +stunrefresh = 30 diff --git a/asterisk/samples/conf/res_stun_monitor.conf.sample b/asterisk/samples/conf/res_stun_monitor.conf.sample new file mode 100644 index 0000000..12d32a4 --- /dev/null +++ b/asterisk/samples/conf/res_stun_monitor.conf.sample @@ -0,0 +1,27 @@ +; +; Configuration file for the res_stun_monitor module +; +; The res_stun_monitor module sends STUN requests to a configured STUN server +; periodically. If the monitor detects a change in the external IP address or port +; provided by the STUN server an event is sent out internally within Asterisk +; to alert all listeners to that event of the change. + +; The current default listeners for the network change event include chan_sip +; and chan_iax. Both of these channel drivers by default react to this event +; by renewing all outbound registrations. This allows the endpoints Asterisk +; is registering with to become aware of the address change and know the new +; location. +; +[general] +; +; ---- STUN Server configuration --- +; Setting the 'stunaddr' option to a valid address enables the STUN monitor. +; +;stunaddr = mystunserver.com ; Address of the STUN server to query. + ; Valid form: + ; [(hostname | IP-address) [':' port]] + ; The port defaults to the standard STUN port (3478). + ; Set to an empty value to disable STUN monitoring. + ; Default is disabled. +;stunrefresh = 30 ; Number of seconds between STUN refreshes. + ; Default is 30.