Hello,
First of all thank you for reading this. We are using asterisk with an external application and a trunk (Twilio). In the dial plan asterisk is communicating with the external application REST API in JSON format which tells what asterisk needs to do.
The pjsip_wizard.conf contains the trunk information
[trunkDefaults](!)
type=wizard
transport=transportSecure
endpoint/allow=!all,ulaw,alaw,G729,G722
endpoint/direct_media=no
endpoint/rewrite_contact=yes
endpoint/rtp_symmetric=yes
endpoint/allow_subscribe=no
endpoint/force_rport=yes
endpoint/media_encryption=sdes
aor/qualify_frequency=60
[twilio](trunkDefaults)
sends_auth=yes
sends_registrations=no
remote_hosts=xxx.pstn.dublin.twilio.com
outbound_auth/username=xxxx
outbound_auth/password=xxxx
endpoint/context=xxxx
The pjsip.conf contains “soft phone” endpoints
[transportSecure]
type=transport
protocol=tls
bind=0.0.0.0:5061
cert_file=/etc/letsencrypt/live/xxxx/fullchain.pem
priv_key_file=/etc/letsencrypt/live/xxxx/privkey.pem
external_media_address=xxxxxx
external_signaling_address=xxxxx
method=tlsv1_2
verify_client=no
verify_server=no
; softPhones
[local1]
type=endpoint
transport=transportSecure
context=xxx
allow=!all,ulaw,alaw
aors=local1
media_encryption=sdes
rtp_symmetric=yes
;direct_media=no
;disable_direct_media_on_nat=yes
;force_rport=yes
;ice_support=yes
dtmf_mode=rfc4733
rewrite_contact=yes
[local1]
type=aor
max_contacts=1
remove_existing=yes
[local1]
type=auth
auth_type=userpass
password=local1
username=somesuperduperpasswordhere
Question
What is the best practise to create a dynamicly configured pjsip.conf file with which can change once in a while ? ( Already checked this out, Setting up PJSIP Realtime - Asterisk Project - Asterisk Project Wiki But all the logic is not happening in asterisk itself, its done based on external output)
Something like this?
Run a script (shell script) every x minutes that repopulates the pjsip.conf file with all the up-to-date end points. And preform a core reload (asterisk -rx “core reload”) to enable the most up-to-date pjsip.conf file.
Question
Is it safe to preform a core reload while calls are running ?