Skip to content

Instantly share code, notes, and snippets.

@thanosa75
Last active March 28, 2019 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thanosa75/ee81ed01dbd8e0b92438b60350ff581d to your computer and use it in GitHub Desktop.
Save thanosa75/ee81ed01dbd8e0b92438b60350ff581d to your computer and use it in GitHub Desktop.
Getting Asterisk ( version > 13 ) to report the audio codecs selected for incoming or outgoing calls
; custom extension context to log audio media used in a call
; Now logs in CDR (visible in CDR report as userfield)
; Thanos 27/3/19 - sample: https://cdn1.imggmi.com/uploads/2019/3/28/1e6ff7f430551fb30fce25cb5069fa64-full.png
[from-pstn-custom]
exten => _.!,1,Verbose("Incoming: Audio Read: ${CHANNEL(audioreadformat)} - Audio Write: ${CHANNEL(audiowriteformat)} - native Audio ${CHANNEL(audionativeformat)}")
exten => _.!,2,Set(CDR(userfield)="R/W:${CHANNEL(audioreadformat)}/${CHANNEL(audiowriteformat)} N:${CHANNEL(audionativeformat)}")
[from-internal-custom]
exten => _.!,1,Verbose("Outgoing: Audio Read: ${CHANNEL(audioreadformat)} - Audio Write: ${CHANNEL(audiowriteformat)} - native Audio ${CHANNEL(audionativeformat)}")
exten => _.!,2,Set(CDR(userfield)="R/W:${CHANNEL(audioreadformat)}/${CHANNEL(audiowriteformat)} N:${CHANNEL(audionativeformat)}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment