Skip to main content

Asterisk - Voicemail Password Restrictions

One of the new features in Asterisk 1.6.1 is the ability to launch an external application when someone wants to change their voicemail password.  This is most useful for administrators who want to enforce more strict password requirements.  Adding this option is as simple as:

 externpasscheck=/usr/local/sbin/my-password-app.pl 

The API is very simple.  Asterisk passes the following command line arguments: mailbox context oldpass newpass. Asterisk then expects back one of three things:

  • VALID - The password is good, set it.
  • FAILURE - Our script failed for some reason, so ALLOW the change.
  • Some error message - The documentation says 'INVALID', but the code says anything else here means the check failed.

That doesn't sound too difficult.  We could probably whip something up in Perl pretty quick for a basic application.  Of course, what fun is that?  Lets start small and build to something useful.  Here are some requirements:

  • Minimum length >= 3
  • No consecutive increasing numbers (i.e. 1234, or 8765)
  • Can not be all the same digit (i.e. 1111)
  • Can not be the same as the extension
  • Can not be the old password

Now we are talking.  That should keep the corporate security officer happy, for a while...  Attached is a script that allows you to do all of the above, if you wish.

AttachmentSize
Asterisk check voicemail password Perl script4.2 KB

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <b> <img>
  • Lines and paragraphs break automatically.

More information about formatting options