plain-purple
plain-purple2w ago

[TECHNICAL] API question regarding Codec Preferences for BYO SIP Trunk

Hey Vapi team, we're facing a critical integration issue and need your technical guidance. Objective: Our SIP trunk provider requires us to limit the offered codecs to PCMA, PCMU, and G729 to mitigate a high percentage of connection failures (503, 403 errors). Problem: We're trying to update our BYO SIP Trunk credential to set these codec preferences. Based on documentation, we attempted to use the codecPreferences field. However, the API rejects the request. API Request Sent: - Method: PATCH - Endpoint: https://api.vapi.ai/credential/da9a3dfc-d738-4c21-ab20-ec18725aeba0 - Body:
{
"codecPreferences": [
"PCMA",
"PCMU",
"G729"
]
}

{
"codecPreferences": [
"PCMA",
"PCMU",
"G729"
]
}

API Response Received: - Status Code: 400 Bad Request - Body:
{"message":["property codecPreferences should not exist"],"error":"Bad Request","statusCode":400}

{"message":["property codecPreferences should not exist"],"error":"Bad Request","statusCode":400}

Question: Could you please provide the correct and currently supported method for setting a prioritized list of audio codecs on a byo-sip-trunk credential via the API? This is a major blocker for our production scaling, and any precise technical help would be greatly appreciated. Thank you!
2 Replies
foreign-sapphire
foreign-sapphire2w ago
cc: @kyle
fascinating-indigo
fascinating-indigo4d ago
@Gerónimo For codec control with BYO SIP trunks, configure codec preferences at your SIP trunk provider level rather than through Vapi's configuration. This gives you the most control over: -Codec selection and priority -Bandwidth management -Quality settings -Fallback options Your SIP trunk provider's codec configuration will be respected during the SIP negotiation process with Vapi's infrastructure. The only codec we don't accept and will actively block is G.729 but everything else should pass through

Did you find this page helpful?