[asterisk-users] How to access Voicemail Password in Asteriskwithout using V

Philipp Kempgen philipp.kempgen at amooma.de
Sat Mar 10 09:04:01 MST 2007


jamshed zaidi wrote:

> sir, i have configured voicemail already but the problem is i want a 
> variable which holds a value of password just like ${VM_CALLERID} variable 
> holds Voicemail Caller ID (Person leaving vm). i want to process password 
> set by the user through comedian mail. my snerio does not allow me to pick 
> password value from voicemail.cof file???? How do i come up with this 
> situation????

If all else fails you might use an AGI script like this (put it
in /var/lib/asterisk/agi-bin/):


#!/usr/bin/php -q
<?php
$mailbox = @$argv[1];
$pass = '';
if (preg_match( '/^\d*$/', $mailbox )) {
  $vmConf = file_get_contents( '/etc/asterisk/voicemail.conf' );
  if (preg_match( '/^'.$mailbox.'\s*=>\s*(\d*)/m', $vmConf, $m )) {
    $pass = $m[1];
  }
}
echo 'SET VARIABLE vm_pass ', $pass, "\n";
fFlush(STDOUT);
?>


and call the script from within the dial plan:

exten => 123,1,Set(my_mailbox=555)
exten => 123,n,AGI(get-vm-password.php|${my_mailbox})
exten => 123,n,SayDigits(${vm_pass})


But maybe there is a better solution to this.

Regards,
  Philipp

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
     Let's use IT to solve problems and not to create new ones.
           Asterisk? -> http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998


More information about the asterisk-users mailing list