plain-purple•2w 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:
API Response Received:
- Status Code: 400 Bad Request
- Body:
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•2w ago
cc: @kyle
fascinating-indigo•4d 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