Extension default media encryption

From my search through this forum i can see a few people have touched on this in the past but their posts seem to go un-noticed, then closed.

Im trying to programatically create extensions through the graphql api (which is successful)
But I need to then go into the UI to set their media_encryption to SRTP in-SDP.

So after seeing everyon elses posts die unanswered, is there definitely no way to set a sort of new extensions default media_encryption=sdes in any of the asterisk config files?

@handleric @Soribus Did you guys ever find anything out about this issue?

It looks like the pjsip_wizard.conf might be the solution, in the docs:

https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/PJSIP-Configuration-Wizard/

It has the following:

user_defaults
type = wizard
transport = ipv4
accepts_registrations = yes
sends_registrations = no
accepts_auth = yes
sends_auth = no
has_hint = yes
hint_context = DLPN_DialPlan1
hint_application = Gosub(stdexten,${EXTEN},1(${HINT}))
endpoint/context = DLPN_DialPlan1
endpoint/allow_subscribe = yes
endpoint/allow = !all,ulaw,gsm,g722
endpoint/direct_media = yes
endpoint/force_rport = yes
endpoint/disable_direct_media_on_nat = yes
endpoint/direct_media_method = invite
endpoint/ice_support = yes

and below it, it says

| This example demonstrates the power of both wizards and templates.Once the template is created, adding a new phone could be as simple as creating a wizard objectOf course, you can override ANYTHING in the wizard object or specify everything and not use templates at all. |

Am i right in thinking I can create the pjsip_wizard.conf file, add the user defaults and each new endpoint made will have these settings?

You would be wrong. FreePBX doesn’t use PJSIP configuration wizards, and configuration wizards don’t globally apply defaults. They use templates in the configuration file with inheritance.

Ohk yea after reading up on the fundamentals more with the config syntax and files.

Ive made an endpoint default template and put it in pjsip.endpoints_custom.conf

endpoint_template
type=endpoint
media_encryption=dtls
dtls_verify=fingerprint
dtls_setup=actpass
dtls_rekey=0
ice_support=yes
media_use_received_transport=yes
use_avpf=yes
rtcp_mux=yes

But the template wouldn’t affect any new endpoints that are created through the GUI or through the FreePBX graphql api, i’d need to manually go into each endpoint and put (endpoint_template) after it?

Looking at the graphql addExtension endpoint there doesnt seem to be any paramter where i can specify a template to use for that new endpoint

Yes, you have to configure each endpoint to inherit from the template.

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