Change Audio Codec

Hi,
I want to change the audio codec in favor of a codec whose sampling rate is higher (44.1kHz) like sln44. I read this wiki article about different codecs.
https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Codecs+and+Audio+Formats
I want to know which files I have to edit so I can Monitor() in that codec.

If the underlying codec of the calls is not higher, then monitoring higher doesn’t really increase quality and will actually use more CPU. What codecs are actually in use for the calls?

1 Like

How do I check it? I’ve setup Asterisk 16.6 on a linux machine and calling through zoiper softphone via an Android device.

Codecs are configured using the “allow” option for the endpoint in the respective channel driver (chan_sip or chan_pjsip). For both Monitor and MixMonitor the filename also determines the format the recording is in, with a file extension of sln44 indicating 44.1kHz.

1 Like

I have set the Monitor(sln44,recording,o) in my dialplan. Can you guide me how to change the channel driver settings (chan_pjsip) to the right codec?

There are the supported codecs by both ends, so you’d need to see what is supported and what meets your needs. I can’t guide you because it depends on the configuration and naming of things.

okay. can you tell me which conf files to look at ?

The chan_pjsip module is configured using the pjsip.conf module, or if using wizards then pjsip_wizard.conf. There may be other included files depending on the configuration.

I am making the call from extension 2021 to extension 2020. I have checked the pjsip.conf file and for both the allowed codecs are.
`

allow=ulaw,alaw,gsm,g726,g722,g729

How do I change to one that uses 44.1kHz?

You find a codec that is supported by the endpoint in question that is 44.1kHz and also supported by Asterisk.

if i add slin44 to the “allow” list in both endpoints, will it work? I ran the core show codecs command and it shows that slin44 is installed in my asterisk server.

I doubt it as it is unlikely to be supported by the softphone. You can’t force a softphone to use a codec it doesn’t understand. For example, I can’t force you to speak French if you don’t speak French.