Graceful shutdown blocks outbound channel creation

I’ve got a cluster of asterisks that i’d like to scale in and out based on load. To drain these i was planning on performing a graceful shutdown, have kamailio detect that it’s down and then just wait until there are no more active calls. This mostly works.

Our normal call flow is that an inbound caller hits our ARI application, it looks up a destination, calls that destination and bridges the two calls. But if the shutdown is initiated after the inbound call but before the outbound call that fails with “Channel allocation failed: Refusing due to active shutdown”

Is there a way to be in graceful shutdown but still allow outbound calls from asterisk?

No. It is explicitly written to disallow all channel creation.

Thanks for the quick clarification.

Is there any way to change a sip option response from asterisk on the fly, so that i can still get a 5xx response back to kamailio but not do the graceful shutdown?

I could disable the ast on the kamailio side but i’d prefer if the asterisk could take the decision to ‘die’ independently.

You can’t explicitly control OPTIONS like that. This was merged last week, though:

Would you look at that. At a glance it’s what i need. Thanks!