Limit the number of extensions

Would it be possible to set an extension limit so that users cannot create, for example, more than 10 extensions? Basically I would like to set the maximum number of extensions a user can configure.

May I ask why you want to do this? There may be a better solution.

I would like to offer a pbx service for some companies here in the building and they agreed on using a max of 10 to 20 extensions each (depending on their size). So to be sure I would like an option to set a limit for each freepbx server I will be setting up.

WARNING: UGLY HACK

Put a trigger on the users table:

use asterisk drop trigger if exists userlimit; delimiter // create trigger userlimit before insert on users for each row begin if (select count(*) from users) >= 10 then # set your limit here call Maximum_user_limit_exceeded; # Crude error message end if; end // delimiter ;

Great idea! I am going to give that a try, thank you very much.

In case someone else has another idea, feel free to share it with me/us.

Hi,

Saw your post on how to limit the number of extensions.

Can you please help me to remove this limit the number of extensions.

Currently i am unable to go beyond 10 extn.

Can you please let me know where exactly i need to make to change to allow more extensions.

Thanks in Advanceā€¦

Ganesh