Skip to content

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.

  • You have Administrator access to the panel.
  • You know which codec the vendor or your service needs, for example G.729 to save bandwidth or G.711u for 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.
  1. Open My Customers → Accounts and edit the account.
  2. Open the Advanced tab.
  3. Under SIP / Services, select Preferred Codec, for example G.729.
  4. Keep Use Preferred Codec Only cleared.
  5. Click Save & Close.
Screenshot "tutorials/account-sip-services" has not been generated yet — see scripts/screenshots/screens.yml.

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.

Use this when the vendor or the service accepts one codec only.

  1. Edit the account again and open the Advanced tab.
  2. Select Use Preferred Codec Only.
  3. 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.

  1. Make a test call from the account.
  2. Open Tools & Debugs → SIP Logs Viewer and open the call.
  3. Check the m=audio line of the INVITE that the switch sent to the vendor: the preferred codec is first, or the only audio codec.