Re: [Asterisk-Users] Voicemail Passwords and RealTime

2005-10-11 Thread Tzafrir Cohen
On Tue, Oct 11, 2005 at 05:37:12PM -0600, Ryan Hulsker wrote:

> 
> mine looks like this
> 
> #!/usr/bin/perl
> # Takes 3 command line args, context, mailbox, password
> # updates the mailbox password in mysql
> 
> use strict;
> use DBI;
> 
> my ($Context, $MailBox, $Password) = @ARGV;
> 
> my $dbh =
> DBI->connect("dbi:mysql:hostname=localhost;database=asterisk","username", 
> "password");
> 
> $dbh->do("update voicemail_users set password = '$Password' where
> context = '$Context' and mailbox = '$MailBox'");
> 
> $dbh->disconnect();

OT:

Why do people resort to perl just for such a simple script?

#!/bin/sh
mysql asterisk -e "update voicemail_users set password = '$3' where context = 
'$1' and MailBox = '$2'"

Password/hostname, etc. can wither be hard-wired at the command-line or 
using my.cnf (or an alternative my.cnf in the command-line parameters).

-- 
Tzafrir Cohen | [EMAIL PROTECTED] | VIM is
http://tzafrir.org.il |   | a Mutt's  
[EMAIL PROTECTED] |   |  best
ICQ# 16849755 |   | friend
___
--Bandwidth and Colocation sponsored by Easynews.com --

Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Voicemail Passwords and RealTime

2005-10-11 Thread Ryan Hulsker




Juan,

I just went through the same thing here.  I never did get it to work, i suspect it is a bug but have not had time to look into it.

What I did was use the externpass configuration directive in voicemail.conf to run an external perl script which updates my database.

externpass will run your perl script with 3 arguments, context, mailbox, and password once the user has entered the password 2 times and they match.

mine looks like this

#!/usr/bin/perl
# Takes 3 command line args, context, mailbox, password
# updates the mailbox password in mysql

use strict;
use DBI;

my ($Context, $MailBox, $Password) = @ARGV;

my $dbh = DBI->connect("dbi:mysql:hostname=localhost;database=asterisk","username", "password");

$dbh->do("update voicemail_users set password = '$Password' where context = '$Context' and mailbox = '$MailBox'");

$dbh->disconnect();



Hope this helps!

Ryan Hulsker


On Tue, 2005-10-11 at 15:45, Juan Salas wrote:

Hello.

One question...
When we use voicemail with flat file configuration (voicemail.conf) 
the vaicemail user can change his password by voicemailmain (voice menu)
this change the value in voicemail.conf.
When we use Realtime the password is stored in the database. What the 
voicemailmain (voice menu) application do? change the database value? 
As I see it doesn't work.

Regard.

Jsalas.









Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
___
--Bandwidth and Colocation sponsored by Easynews.com --

Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




___
--Bandwidth and Colocation sponsored by Easynews.com --

Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

RE: [Asterisk-Users] Voicemail Passwords and RealTime

2005-10-11 Thread Juan Salas
Hello.

One question...
When we use voicemail with flat file configuration (voicemail.conf) 
the vaicemail user can change his password by voicemailmain (voice menu)
this change the value in voicemail.conf.
When we use Realtime the password is stored in the database. What the 
voicemailmain (voice menu) application do? change the database value? 
As I see it doesn't work.

Regard.

Jsalas.









Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
___
--Bandwidth and Colocation sponsored by Easynews.com --

Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users