runtime codec selection

Home » Asterisk Users » runtime codec selection
Asterisk Users No Comments

Hi All,

I don’t know it’s possible or not. I want to do run time codec selection by

I have an account in sip.conf and I have active only g729 on it


When try to dial that number when I want to use codec GSM.

Is this possbile to change code after making call to exten ?

*extensions.conf information is below:-*

exten => _2xxx,1,Answer()
same => n,GotoIf($[“${EXTEN}” = “2209”]?setchannel:gowithoutit)
same => n(setchannel),Set(foo=${CHANNEL(audioreadformat)})
; same => n,Set(CHANNEL(audioreadformat)=gsm) it’s not update
anything might be readonly property, that’s y commented.
same => n,Set(_SIP_CODEC=gsm)
same => n,Set(_SIP_CODEC_OUTBOUND=gsm)
; same => n,Set(foo=${CHANNEL(audionativeformat)})
; same => n,Set(foo=${CHANNEL(audiowriteformat)})
same => n(gowithoutit),Dial(SIP/${EXTEN},60)
same => n,GotoIf($[“${EXTEN}” = “2209”]?voicemail)
same => n(voicemail),VoiceMail(2209@hyd,u)
same => n,Hangup()