aboutsummaryrefslogtreecommitdiffstats
path: root/roles/asterisk
diff options
context:
space:
mode:
authorStonewall Jackson <stonewall@sacredheartsc.com>2023-03-03 17:35:07 -0500
committerStonewall Jackson <stonewall@sacredheartsc.com>2023-03-03 17:35:07 -0500
commitfa84ba76fd5740bc0eedc90462aec81ee7af5e79 (patch)
tree7b78e142bb9ce6edd63f839c1a453996bb05c950 /roles/asterisk
parent56ad4da18ea5c3d02ea61fe846eb1ebbf29fa6c6 (diff)
downloadselfhosted-fa84ba76fd5740bc0eedc90462aec81ee7af5e79.tar.gz
selfhosted-fa84ba76fd5740bc0eedc90462aec81ee7af5e79.zip
asterisk: add more options for pjsip endpoints
Diffstat (limited to 'roles/asterisk')
-rw-r--r--roles/asterisk/README.md24
-rw-r--r--roles/asterisk/templates/etc/asterisk/pjsip_wizard.conf.j23
2 files changed, 15 insertions, 12 deletions
diff --git a/roles/asterisk/README.md b/roles/asterisk/README.md
index aafd9be..fa50f2b 100644
--- a/roles/asterisk/README.md
+++ b/roles/asterisk/README.md
@@ -70,17 +70,19 @@ The `asterisk_sip_extensions` variable describes your internal SIP extensions
(AKA your internal phone numbers). It should contain a list of dictionaries of
the following format:
-Key | Default | Description
--------------------|------------------|------------
-`name` | &nbsp; | Name of the extension (usually a 3- or 4-digit number)
-`codecs` | &nbsp; | Allowed codecs (comma-separated, or list)
-`context` | &nbsp; | Dialplan context for inbound calls
-`mailbox` | &nbsp; | Mailbox name (comma-separated, or list)
-`cid_name` | &nbsp; | Caller ID name
-`cid_number` | `{{ ext.name }}` | Caller ID number
-`username` | `{{ ext.name }}` | Extension SIP username
-`password` | &nbsp; | Extension SIP password
-`max_contacts` | 1 | Maximum simultaneous logins
+Key | Default | Description
+--------------------|------------------|------------
+`name` | &nbsp; | Name of the extension (usually a 3- or 4-digit number)
+`codecs` | &nbsp; | Allowed codecs (comma-separated, or list)
+`context` | &nbsp; | Dialplan context for inbound calls
+`mailbox` | &nbsp; | Mailbox name (comma-separated, or list)
+`cid_name` | &nbsp; | Caller ID name
+`cid_number` | `{{ ext.name }}` | Caller ID number
+`username` | `{{ ext.name }}` | Extension SIP username
+`password` | &nbsp; | Extension SIP password
+`max_contacts` | 1 | Maximum simultaneous logins
+`direct_media` | yes | Allow direct media traffic (disable for NAT)
+`qualify_frequency` | 30 | Interval between [qualify](https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Configuration_res_pjsip#Asterisk13Configuration_res_pjsip-contact_qualify_frequency) attempts (seconds)
### asterisk\_queues
diff --git a/roles/asterisk/templates/etc/asterisk/pjsip_wizard.conf.j2 b/roles/asterisk/templates/etc/asterisk/pjsip_wizard.conf.j2
index 4a6d800..28e894e 100644
--- a/roles/asterisk/templates/etc/asterisk/pjsip_wizard.conf.j2
+++ b/roles/asterisk/templates/etc/asterisk/pjsip_wizard.conf.j2
@@ -39,7 +39,6 @@ type = wizard
accepts_registrations = yes
accepts_auth = yes
aor/remove_existing = yes
-aor/qualify_frequency = 30
endpoint/allow = !all,g722,ulaw
endpoint/from_domain = {{ asterisk_from_domain }}
endpoint/subscribe_context = subscribe
@@ -55,5 +54,7 @@ endpoint/callerid = {{ ext.cid_name }} <{{ ext.cid_number | default(ext.name
inbound_auth/username = {{ ext.username | default(ext.name) }}
inbound_auth/password = {{ ext.password }}
aor/max_contacts = {{ ext.max_contacts | default(1) }}
+aor/qualify_frequency = {{ ext.qualify_frequency | default(30) }}
+endpoint/direct_media = {{ 'yes' if ext.direct_media | default(true) else 'no' }}
{% endfor %}