How to limit incoming calls to 1 and send to caller busy tone if at least one trunk busy?

I wish to reject all incoming calls with a busy tone if at least one trunk is in a call, this because the office is small and if a people is making a call, it is annoying that the other two extensions ring.
I placed call-limit=1 in incoming trunk but there is an hangup without caller receive a busy tone.
I have not modified nothing and it worked in the desired way… I don’t understand at all!
Log says:
chan_sip.c: Call from peer ‘SIP-XXXXX’ rejected due to usage limit of 1
chan_sip.c Failed to place call for device (phonenumber), too many calls
executing [h@ext-group:1] Macro (" SIP/SIP-XXXXXX-000008d9",“hangupcall,”) in new stack

I tried also to make a custom context and place a code for busy tone… but I don’t know if this code has been executed…
The context that I created is context=XXXXXX that I placed on Trunk web page

Thanks for your support

“Custom context” sounds like you are using FreePBX. You get peer support for that from as we don’t have the extensive knowledge of how its dialplans work and the limitations on the ability to configure them.

If not, you will need to provide your dialplan, as it is clearly non-trivial.

Note that the preferred way of implementing limits is with CALLCOUNT.

1 Like

Yes I use feeepbx. But how can l provide you the dial plan ?

If you use FreePBX, you don’t provide the dialplan as this is the wrong forum to use. You are probably encountering a limitation due to FreePBX, not Asterisk, and only the FreePBX people will be able to advise.

custom context on freepbx are written on /etc/asterisk/extensions_custom.conf if you want to override existing freepbx dial plan you need to use the file extensions_override_freepbx.conf