limited-planet-15554
09/22/2025, 1:01 AMtall-airline-16756
09/22/2025, 1:01 AMtall-airline-16756
09/22/2025, 1:02 AMmax_call_duration not working as expected in your Python code. Let’s walk through a few steps together to help get this sorted out:
1. First, make sure you’re creating the Duration object correctly using the google.protobuf.duration_pb2 module. Here’s a quick example:
from google.protobuf import duration_pb2 as duration
max_duration = duration.Duration()
max_duration.FromSeconds(30) # Set to 30 seconds
1. Next, use this Duration object in your CreateSIPParticipantRequest like this:
await ctx.api.sip.create_sip_participant(
api.CreateSIPParticipantRequest(
...
max_call_duration=max_duration,
)
)
1. It’s also important to apply max_call_duration in the right place. For outbound calls, it belongs in the CreateSIPParticipantRequest, while for inbound calls, you’ll want to configure it in the trunk settings.
2. Lastly, double-check your settings using the appropriate API methods to confirm everything is applied correctly.
If you’ve tried all these steps and it’s still not working, the issue might be related to server-side configurations or your SIP provider’s settings. Don’t hesitate to reach out if you want to explore those possibilities together—I’m here to help!
Sources: SIP APIs | LiveKit Docs | rpc/io.pb.go | livekit-protocol/livekit/protocol/sip.pylimited-planet-15554
09/22/2025, 1:08 AMtall-airline-16756
09/22/2025, 1:09 AMmax_call_duration field is meant to set the maximum length for a call. I understand it can be a bit unclear since the documentation doesn’t explicitly say if LiveKit will automatically end the call once that time is up.
A good way to find out is by trying it yourself—set a short duration, like 30 seconds, and see if the call ends on its own. If it doesn’t, no worries! It might just mean you’ll need to handle this on the server side or with some manual steps. I’m here to help if you want to explore those options together.
Sources: rpc/io.pb.go | SIP APIs | LiveKit Docslimited-planet-15554
09/22/2025, 1:12 AMtall-airline-16756
09/22/2025, 1:12 AM