#!/usr/bin/perl # $Id: vmail-pin-update.pl 206 2005-12-21 02:57:01Z bklang $ use warnings; use strict; use Asterisk::LDAP; # This script relies on a working /etc/ldap.conf and assumes that credentials # for write access are available either there or in /etc/ldap.secret # This script may need local customizations to work reliably in your environment my $AstLDAP = new Asterisk::LDAP; if (!$ARGV[0] || !$ARGV[1] || !$ARGV[2]) { die("Must pass in the context as arg 1,\nvoicemail box as arg 2, and new PIN as arg 3."); } $AstLDAP->context($ARGV[0]); $AstLDAP->voicemailbox($ARGV[1]); $AstLDAP->newpin($ARGV[2]); # Read in as much about the local configuration as possible $AstLDAP->getLDAPconf(); $AstLDAP->getAsteriskconf(); # Commit the updated PIN $AstLDAP->updateVmailPIN();