Hi Kristiam,
We've looked into these scenarios and offer the following advice;
1. One option to consider is using the toll_allow feature in conjunction with an outbound route that triggers a lua script to check the pin; if pin matches action = let call pass otherwise anti-action = play a recording re: not authorised and hang-up. You could use the Voicemail pin as the callers pin for making calls too.
If you're up for creating a lua script, I suspect the DISA code (see fpbx features:
http://fusionpbx-docs.readthedocs.io/en/latest/additional_information/feature_codes.html ) would give you a starting point to hack up something.
There have been some requests to the project via github for this functionality;
-
https://github.com/fusionpbx/fusionpbx/issues/1693 (suggests a module is available? I couldn't find one)
-
https://github.com/fusionpbx/fusionpbx/issues/1946 (suggests that the functions exist, but would need to be activated - something you learn in the admin course)
But it looks like what ever solution you use, you have some lua coding ahead of you.
2. I would also use toll_allow for this one; there is no 'status' of an extension so to speak. By using toll_allow with an outbound script that like above plays a recording then hangs up is not too difficult. The user still stays active, and you could still allow them to call emergency services and even you customer service number if you want, but all other calls types would result in the recording & hangup.
We've not implemented either, so we don't have any steps or code to offer you - these are just our thoughts around what was possible.
We're finding very quickly that lua, along with creating an application or 'app' are the two great ways of extending fpbx; editing the core code is a no-no as it will break as soon as there is an update. The app idea needs a bit more thought, but could solve the lack of an extension status option (re: ability to suspend etc users).
regards,
A