Set the preferred codec of an account
The switch does not transcode. It passes the codecs that the caller’s device offers in its SDP on to the vendor, and the two ends agree on one of them. A call cannot use G.729 if the caller’s device does not offer it, even if the vendor requires G.729. What you can change is the order of the offered codecs, or which of them are offered at all. This tutorial does both for one account. Allow 5 minutes.
Before you start
Section titled “Before you start”- You have Administrator access to the panel.
- You know which codec the vendor or your service needs, for example
G.729to save bandwidth orG.711ufor fax. - You know which codecs the customer’s device offers. A SIP trace of one call shows them; see Read the SIP log of a call.
Step 1: Put the preferred codec first
Section titled “Step 1: Put the preferred codec first”- Open My Customers → Accounts and edit the account.
- Open the Advanced tab.
- Under SIP / Services, select Preferred Codec, for example G.729.
- Keep Use Preferred Codec Only cleared.
- Click Save & Close.
Result: when the caller offers the preferred codec, the switch moves it to the top of the list before it sends the call to the vendor. The other codecs stay in the offer as fallbacks. When the caller does not offer it, the call goes through unchanged.
The list offers G.711u, G.711a, G.722, G.723, G.728, G.729 and GSM. – Any – (the default) leaves the offer as it is.
Step 2: Allow only the preferred codec
Section titled “Step 2: Allow only the preferred codec”Use this when the vendor or the service accepts one codec only.
- Edit the account again and open the Advanced tab.
- Select Use Preferred Codec Only.
- Click Save & Close.
Result: the switch removes every other audio codec from the offer and keeps only the preferred one. Dynamic payload types, such as telephone-event for DTMF, stay in the offer.
Step 3: Test it
Section titled “Step 3: Test it”- Make a test call from the account.
- Open Tools & Debugs → SIP Logs Viewer and open the call.
- Check the
m=audioline of the INVITE that the switch sent to the vendor: the preferred codec is first, or the only audio codec.
What’s next
Section titled “What’s next”- Accounts: the other fields of the account form.
- Carry fax calls: codec settings for fax.
- SIP response codes: what
488and other codes mean.