Skip to content

Instantly share code, notes, and snippets.

@lgaetz
Last active December 12, 2024 22:37
Show Gist options
  • Save lgaetz/3c2bc4709607fdde40a278f980dbe9b2 to your computer and use it in GitHub Desktop.
Save lgaetz/3c2bc4709607fdde40a278f980dbe9b2 to your computer and use it in GitHub Desktop.
PJSIP signaling/media encryption reader
; FreePBX dialplan to create a dialable feature code that will play audio back to the caller telling them if the
; pjsip signaling and rtp/srtp audio they are using is encrypted or not
;
; latest version: https://gist.github.com/lgaetz/3c2bc4709607fdde40a278f980dbe9b2
;
; License: GNU GPL3
;
; Usage - place the dialplan below in the file /etc/asterisk/extensions_custom.conf and reload the dialplan (apply config)
; from a local device dial 4511. The audio played will indicate if signaling and/or media is encrypted.
;
; History 2024-12-12 First commit
[from-internal-custom]
exten => 4511,1,Noop()
exten => 4511,n,Answer
exten => 4511,n,GoSubIf($[${CHANNEL(pjsip,secure)}]?secure_sig:insecure_sig)
exten => 4511,n,Wait(0.5)
exten => 4511,n,GoSubIf($[${CHANNEL(rtp,secure)}]?secure_audio:insecure_audio)
exten => 4511,n,Hangup()
exten => 4511,n(insecure_audio),Flite(Audio is not secure)
exten => 4511,n,return
exten => 4511,n(secure_audio),Flite(Audio is secure)
exten => 4511,n,return
exten => 4511,n(secure_sig),Flite(Signaling is secure)
exten => 4511,n,return
exten => 4511,n(insecure_sig),Flite(Signaling is not secure)
exten => 4511,n,return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment