Hi everyone, i’m new to VoIP and SIP so I am confused about how the things work.
I’m trying to understand how a codec is selected when making a call, and i’m very confused as i can select a priority for the codec to use in various places:
In FreePBX under Asterisk SIP Settings
In FreePBX under the Sip Trunk configuration
In the settings of the phone that make the call
In the settings of the phone that receive the call
Which of these above have priority over another?
Is there a way to see which codec is being utilized in a conversation?
On an outgoing call, the phone or other device presents an ordered list of codecs; Asterisk selects the first of them that is allowed by the extension’s config. It then presents its ordered list of allowed codecs for the selected trunk. The VoIP provider generally chooses the first of those that is supported for the call. If the extension and trunk are using different codecs, Asterisk will transcode.
On an incoming call, the VoIP provider presents an ordered list of codecs, sometimes dependent on the DID and/or the caller’s carrier and device. Asterisk selects the first of them allowed by the trunk’s config. It then presents its ordered list of allowed codecs for the called extension. The phone or other device generally chooses the first of them that is enabled in its config. If the extension and trunk are using different codecs, Asterisk will transcode.
On an internal call, the calling extension works as described above for outgoing; the called extension as for incoming.
You can see the codecs in use with
sip show channels
pjsip show channelstats