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

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sat Mar 10 09:51:14 MST 2007


On Sat, Mar 10, 2007 at 05:04:01PM +0100, Philipp Kempgen wrote:
> 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 what if the mailbox is separated with a mere '=', rather than a
'=>'?

What if #include is used in voicemail.conf ?

Why write Yet Another voicemail.conf parser?

-- 
               Tzafrir Cohen       
icq#16849755                    jabber:tzafrir at jabber.org
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com       
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir


More information about the asterisk-users mailing list