From fa84ba76fd5740bc0eedc90462aec81ee7af5e79 Mon Sep 17 00:00:00 2001 From: Stonewall Jackson Date: Fri, 3 Mar 2023 17:35:07 -0500 Subject: asterisk: add more options for pjsip endpoints --- roles/asterisk/README.md | 24 ++++++++++++---------- .../templates/etc/asterisk/pjsip_wizard.conf.j2 | 3 ++- 2 files changed, 15 insertions(+), 12 deletions(-) (limited to 'roles') 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` |   | Name of the extension (usually a 3- or 4-digit number) -`codecs` |   | Allowed codecs (comma-separated, or list) -`context` |   | Dialplan context for inbound calls -`mailbox` |   | Mailbox name (comma-separated, or list) -`cid_name` |   | Caller ID name -`cid_number` | `{{ ext.name }}` | Caller ID number -`username` | `{{ ext.name }}` | Extension SIP username -`password` |   | Extension SIP password -`max_contacts` | 1 | Maximum simultaneous logins +Key | Default | Description +--------------------|------------------|------------ +`name` |   | Name of the extension (usually a 3- or 4-digit number) +`codecs` |   | Allowed codecs (comma-separated, or list) +`context` |   | Dialplan context for inbound calls +`mailbox` |   | Mailbox name (comma-separated, or list) +`cid_name` |   | Caller ID name +`cid_number` | `{{ ext.name }}` | Caller ID number +`username` | `{{ ext.name }}` | Extension SIP username +`password` |   | 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 %} -- cgit