How to set max call duration for inbound calls

This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.

Is there a way to set the max call duration for inbound calls?

There’s no built-in parameter for this. The agent can keep track of time and end the call when it reaches the limit.

You can use Python’s asyncio for this:

Create a background task that monitors call duration and hangs up the call when the limit is reached.