[25940] in Perl-Users-Digest
Perl-Users Digest, Issue: 8159 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 9 14:05:37 2005
Date: Thu, 9 Jun 2005 11:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 9 Jun 2005 Volume: 10 Number: 8159
Today's topics:
Answering Machine/callerID & perl email script <billb@buchnaland.net>
Re: Answering Machine/callerID & perl email script <no@email.com>
Re: Answering Machine/callerID & perl email script <billb@buchnaland.net>
Re: Answering Machine/callerID & perl email script <no@email.com>
Re: increase performance <darkon.tdo@gmail.com>
Re: increase performance <1usa@llenroc.ude.invalid>
LWP::Useragent problem with https usenet@isbd.co.uk
Re: LWP::Useragent problem with https <xyz@tnecul.moc.invalid>
Re: LWP::Useragent problem with https <mothra@nowhereatall.com>
Re: Masking by columns for grep <jgibson@mail.arc.nasa.gov>
Re: Masking by columns for grep <john@castleamber.com>
Re: report generator <no@email.com>
Re: report generator <john@castleamber.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 09 Jun 2005 16:24:41 GMT
From: Mr Bill <billb@buchnaland.net>
Subject: Answering Machine/callerID & perl email script
Message-Id: <c3_pe.3008$jS1.1351@newssvr17.news.prodigy.com>
Hello,
I'm running Linux MDK 10.1 and using the system as an answering machine
amongst other things. I don't even begin to understand perl scripting so I
could use some assistance please. The machine is set up to answer incoming
voice calls using vgetty. The voice message is then emailed to me in .wav
format using the voice module on webmin. I'd like to be able to pass the
caller ID and caller name information as text to the email. The logfile
contains this information (at least I figured out how to capture that
info). Revelent perl script (/usr/libexec/webmin/vgetty/email.pl) and a
snip of the vgetty.ttySx logfile are below. I think this might also be
useful of others. Thanks.
Bill
#!/usr/bin/perl
# email.pl
# Email a received message in WAV format to some address
$no_acl_check++;
require './vgetty-lib.pl';
&foreign_check("mailboxes") || die "Read User Mail module not installed";
&foreign_require("mailboxes", "mailboxes-lib.pl");
# Get the WAV format message and construct the email
open(OUT, "rmdtopvf $ARGV[0] 2>/dev/null | pvftowav 2>/dev/null |");
while(read(OUT, $buf, 1024)) {
$wav .= $buf;
}
close(OUT);
$now = localtime(time());
$host = &get_system_hostname();
$body = "Voicemail message received at $now by $host";
$mail = { 'headers' => [ [ 'From', &mailboxes::get_from_address() ],
[ 'To', $config{'email_to'} ],
[ 'Subject', 'Voicemail message' ] ],
'attach' => [ { 'headers' => [ [ 'Content-Type', 'text/plain' ] ],
'data' => $body },
{ 'headers' => [ [ 'Content-Transfer-Encoding',
'base64' ],
[ 'Content-Type',
'audio/wav;
name="voicemail.wav"' ]],
'data' => $wav } ]
};
# Send the email
&mailboxes::send_mail($mail);
############
Logfile info
############
06/09 10:48:14 yS0 vgetty: experimental test release 0.9.33 / 26Dec02
06/09 10:48:14 yS0 mgetty: experimental test release 1.1.30-Dec16
06/09 10:48:14 yS0 reading generic configuration from config
file /etc/mgetty+sendfax/voice.conf
06/09 10:48:14 yS0 reading program vgetty configuration from config
file /etc/mgetty+sendfax/voice.conf
06/09 10:48:14 yS0 reading port ttyS0 configuration from config
file /etc/mgetty+sendfax/voice.conf
06/09 10:48:14 yS0 check for lockfiles
06/09 10:48:14 yS0 locking the line
06/09 10:48:14 yS0 lowering DTR to reset Modem
06/09 10:48:15 yS0 send: \d\d\d+++\d\d\dAT&FE1V1&D2&C1S0=0S41=1#CID=1[0d]
06/09 10:48:18 yS0 waiting for ``OK'' ** found **
06/09 10:48:18 yS0 mdm_send: 'ATI'
06/09 10:48:18 yS0 Generic Rockwell modem (56000)
06/09 10:48:18 yS0 mdm_send: 'ATI3'
06/09 10:48:18 yS0 mdm_send: 'ATI4'
06/09 10:48:18 yS0 additional info: 'a007840284C6002F'
06/09 10:29:02 yS0 modem quirks: 0004
06/09 10:29:02 yS0 mdm_send: 'AT+FCLASS=2' -> OK
06/09 10:29:02 yS0 mdm_send: 'AT+FCLASS=0' -> OK
06/09 10:29:02 yS0 mdm_send: 'AT+FAA=1;+FCR=1' -> OK
06/09 10:29:02 yS0 mdm_send: 'AT+FBOR=0' -> OK
06/09 10:29:02 yS0 mdm_send: 'AT+FLID="49 115 xxxxxxxx"' -> OK
06/09 10:29:03 yS0 mdm_send: 'AT+FDCC=1,5,0,2,0,0,0,0' -> OK
06/09 10:29:03 yS0 detecting voice modem type
06/09 10:29:03 yS0 Rockwell detected
06/09 10:29:04 yS0 initializing ROCKWELL voice modem
06/09 10:29:05 yS0 waiting...
06/09 10:47:22 yS0 wfr: waiting for ``RING''
06/09 10:47:22 yS0 wfr: waiting for ``RING''
06/09 10:47:22 yS0 wfr: waiting for ``RING''
06/09 10:47:28 yS0 wfr: waiting for ``RING''
06/09 10:47:34 yS0 reading ring_type ring configuration from config
file /etc/mgetty+sendfax/voice.conf
06/09 10:47:36 yS0 playing voice
file /var/spool/voice/messages/v-25820-1108931595.rmd
06/09 10:47:57 yS0 recording voice
file /var/spool/voice/incoming/v-3240-1118332056-6306689453.rmd
06/09 10:48:09 yS0 vgetty: <DLE> <ETX> received
06/09 10:48:13 yS0 closing voice modem device
06/09 10:48:13 ##### message keep, length=00:00:13, name='LastName,
FirstName', caller=1234567890, dev=ttyS0, pid=3240
06/09 10:48:13 yS0 vgetty: Executing shell
script /etc/webmin/vgetty/email.pl with shell /bin/sh
--
------------------------------
Date: Thu, 09 Jun 2005 18:10:58 +0100
From: Brian Wakem <no@email.com>
Subject: Re: Answering Machine/callerID & perl email script
Message-Id: <3grbh2Fdmb6tU1@individual.net>
Mr Bill wrote:
> Hello,
> I'm running Linux MDK 10.1 and using the system as an answering machine
> amongst other things. I don't even begin to understand perl scripting so I
> could use some assistance please. The machine is set up to answer
> incoming
> voice calls using vgetty. The voice message is then emailed to me in .wav
> format using the voice module on webmin. I'd like to be able to pass the
> caller ID and caller name information as text to the email. The logfile
> contains this information (at least I figured out how to capture that
> info). Revelent perl script (/usr/libexec/webmin/vgetty/email.pl) and a
> snip of the vgetty.ttySx logfile are below. I think this might also be
> useful of others. Thanks.
> Bill
>
<snip>
I would rewrite email.pl to scan the log file and extract the data you need.
Sending a wav by email is a bit cumbersome. I'd convert it to mp3 first.
--
Brian Wakem
------------------------------
Date: Thu, 09 Jun 2005 17:26:45 GMT
From: Mr Bill <billb@buchnaland.net>
Subject: Re: Answering Machine/callerID & perl email script
Message-Id: <pZ_pe.3030$jS1.27@newssvr17.news.prodigy.com>
Brian Wakem wrote:
> Mr Bill wrote:
>
>> Hello,
>> I'm running Linux MDK 10.1 and using the system as an answering machine
>> amongst other things. I don't even begin to understand perl scripting so
>> I
>> could use some assistance please. The machine is set up to answer
>> incoming
>> voice calls using vgetty. The voice message is then emailed to me in
>> .wav
>> format using the voice module on webmin. I'd like to be able to pass the
>> caller ID and caller name information as text to the email. The logfile
>> contains this information (at least I figured out how to capture that
>> info). Revelent perl script (/usr/libexec/webmin/vgetty/email.pl) and a
>> snip of the vgetty.ttySx logfile are below. I think this might also be
>> useful of others. Thanks.
>> Bill
>>
> <snip>
>
>
> I would rewrite email.pl to scan the log file and extract the data you
> need.
>
> Sending a wav by email is a bit cumbersome. I'd convert it to mp3 first.
>
>
That would be very helpful...mp3 works too if that's more convenient.
Logfile location is /var/log/vgetty.ttyS0. I assume the extract of the
logfile would look for the last appropriate entry for name= and caller= ?
I greatly appreciate your willingness to assist. Thanks.
Bill
------------------------------
Date: Thu, 09 Jun 2005 18:30:37 +0100
From: Brian Wakem <no@email.com>
Subject: Re: Answering Machine/callerID & perl email script
Message-Id: <3grcltFdt7jmU1@individual.net>
Mr Bill wrote:
> Brian Wakem wrote:
>
>> Mr Bill wrote:
>>
>>> Hello,
>>> I'm running Linux MDK 10.1 and using the system as an answering machine
>>> amongst other things. I don't even begin to understand perl scripting so
>>> I
>>> could use some assistance please. The machine is set up to answer
>>> incoming
>>> voice calls using vgetty. The voice message is then emailed to me in
>>> .wav
>>> format using the voice module on webmin. I'd like to be able to pass
>>> the caller ID and caller name information as text to the email. The
>>> logfile contains this information (at least I figured out how to capture
>>> that
>>> info). Revelent perl script (/usr/libexec/webmin/vgetty/email.pl) and a
>>> snip of the vgetty.ttySx logfile are below. I think this might also be
>>> useful of others. Thanks.
>>> Bill
>>>
>> <snip>
>>
>>
>> I would rewrite email.pl to scan the log file and extract the data you
>> need.
>>
>> Sending a wav by email is a bit cumbersome. I'd convert it to mp3 first.
>>
>>
> That would be very helpful...mp3 works too if that's more convenient.
> Logfile location is /var/log/vgetty.ttyS0. I assume the extract of the
> logfile would look for the last appropriate entry for name= and caller= ?
> I greatly appreciate your willingness to assist. Thanks.
>
> Bill
I'm not going to write it for you. If you need help with anything specific
I may be able to oblige.
--
Brian Wakem
------------------------------
Date: Thu, 09 Jun 2005 14:01:05 -0000
From: "David K. Wall" <darkon.tdo@gmail.com>
Subject: Re: increase performance
Message-Id: <Xns967065E8CD199dkwwashere@216.168.3.30>
A. Sinan Unur <1usa@llenroc.ude.invalid> wrote:
> However, the easiest way to speed this task up by an order of
> magnitude is to avoid printing. As (I think) Anno says: Print
> rarely, print late.
Not that it matters, but I think it's Uri Guttman who says that.
Anyone know what's up with Uri? I haven't seen any posts from him here
for at least a month or two.
------------------------------
Date: Thu, 09 Jun 2005 15:00:55 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: increase performance
Message-Id: <Xns96706FCF1C7B0asu1cornelledu@127.0.0.1>
"David K. Wall" <darkon.tdo@gmail.com> wrote in
news:Xns967065E8CD199dkwwashere@216.168.3.30:
> A. Sinan Unur <1usa@llenroc.ude.invalid> wrote:
>
>> However, the easiest way to speed this task up by an order of
>> magnitude is to avoid printing. As (I think) Anno says: Print
>> rarely, print late.
>
> Not that it matters, but I think it's Uri Guttman who says that.
You are right. I should have just searched Google for the phrase. Thank
you for the correction.
> Anyone know what's up with Uri? I haven't seen any posts from him
> here for at least a month or two.
I had hoped he was enjoying a well deserved vacation, but he seems to be
active elsewhere.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: 9 Jun 2005 10:36:38 GMT
From: usenet@isbd.co.uk
Subject: LWP::Useragent problem with https
Message-Id: <3gqkdmFdfiq4U1@individual.net>
I'm running a perl script that I downloaded, it requires various perl
HTTP and LWP modules that I have installed using CPAN.
However the script produces and error that says "Your LWP::UserAgent
doesn't support the HTTPS protocol", but the CPAN install says:-
...
...
Installing /usr/lib/perl5/site_perl/5.8.4/LWP/Protocol/GHTTP.pm
Installing /usr/lib/perl5/site_perl/5.8.4/LWP/Protocol/data.pm
Installing /usr/lib/perl5/site_perl/5.8.4/LWP/Protocol/nogo.pm
Installing /usr/lib/perl5/site_perl/5.8.4/LWP/Protocol/https.pm
Installing /usr/lib/perl5/site_perl/5.8.4/HTTP/Message.pm
Installing /usr/lib/perl5/site_perl/5.8.4/HTTP/Status.pm
...
...
So is there anything else I have to do to get LWP::UserAgent to
support HTTPS or is it something wrong with the perl script I've
downloaded?
--
Chris Green
------------------------------
Date: Thu, 9 Jun 2005 07:10:26 -0400
From: "T W Hu" <xyz@tnecul.moc.invalid>
Subject: Re: LWP::Useragent problem with https
Message-Id: <d89834$geg@netnews.proxy.lucent.com>
<usenet@isbd.co.uk> wrote ...
[snap]
> So is there anything else I have to do to get LWP::UserAgent to
> support HTTPS or is it something wrong with the perl script I've
> downloaded?
I only installed openssl and Crypt-SSLeay for https.
------------------------------
Date: Thu, 9 Jun 2005 07:34:06 -0700
From: "mothra" <mothra@nowhereatall.com>
Subject: Re: LWP::Useragent problem with https
Message-Id: <42a851d7@usenet.ugs.com>
usenet@isbd.co.uk wrote:
> So is there anything else I have to do to get LWP::UserAgent to
> support HTTPS or is it something wrong with the perl script I've
> downloaded?
perldoc LWPcook should give you what you need.
Hope this helps
Mothra
------------------------------
Date: Thu, 09 Jun 2005 08:56:38 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Masking by columns for grep
Message-Id: <090620050856381570%jgibson@mail.arc.nasa.gov>
In article <42a7cd2b_2@news1.prserv.net>, Shannon Jacobs
<shanen@cashette.com> wrote:
> Shannon Jacobs wrote:
> <snip>
> > @foo = grep(/.{50}$theString.{6},@foo);
>
> Should be:
>
> @foo = grep(/.{50}$theString.{6}/,@foo);
>
If you really want to ignore the first 50 columns and ignore the last
6, you should anchor your pattern:
@foo = grep(/^.{50}$theString.{6}$/,@foo);
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: 9 Jun 2005 15:57:08 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Masking by columns for grep
Message-Id: <Xns96706F40AEFD5castleamber@130.133.1.4>
Shannon Jacobs wrote:
> John Bokma wrote:
>> Shannon Jacobs wrote:
>>
>>> For the sake of
>>
>> our sanity, first many tips:
>
> Well, thanks, and you show some of the third virtue, hubris,
:-D. Yeah, while on the other news people say I have a low self esteem,
so yup.
> but I'm
> not sure how many of these tips apply to the environment of Tripod.
Me neither, but lets see:
> To
> call Tripod's CGI/Perl interface "twisted" is a charitable
> description, but "lobotomized" is probably more accurate.
You can try a mini-script, and see what it does:
#!/usr/bin/perl -T
use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser);
use CGI;
my $cgi = new CGI;
print $cgi->header( 'text/plain' ),
<<"HELLO";
Hello, World!
HELLO
If they don't have CGI.pm installed, which I doubt, their interface is
not that twisted, just incomplete.
> I'm pretty
> sure I tried a number of these things, especially in your early
> recommendations. I'm not even sure the here docs worked properly in
> that environment,
I think here docs are in Perl4, no idea about 3, but have *nothing* to
do with CGI.
> though it has also been a long time since I tried
> those experiments. (That was probably during the time when I was
> running the same code on two or three servers, and Tripod was
> definitely the LCD. The Tripod version only survived because it's a
> reasonably stable system, and because it's hard to argue with the
> price.)
I have no idea about the price, but I have webspace which doesn't criple
me, Perl, or CGI at 1 USD a month (excluding domain registration, all in
it comes down to 19.95 USD a year!)
> It would be nice if you would have included a bit of
> explanation for some of the less obvious parts.
That would come down to a Perl course for beginners :-)
> For example, I think
> there's something non-obvious about the "or die", since I already knew
> about it, and I'm reasonably sure it was used in the original code.
> There must have been some reason I took it out here...
Your script died? Which means that the open ( or close, etc ) failed.
If you output the value of $! you would know the reason.
Programming is not cooking, even though there are cookbooks. It's not:
ah, it tastes not nice, lets add some salt, and remove some of the
vegetables.
Programming is planning ahead what you want, then shop for the
ingredients, and the result *will* taste good, since you planned and
bought the right ingredients, and used the right amounts.
And not blaming the color of the egg plant, because the result tastes
too salty :-)
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Thu, 09 Jun 2005 16:57:18 +0100
From: Brian Wakem <no@email.com>
Subject: Re: report generator
Message-Id: <3gr76vFdlkqjU1@individual.net>
stig wrote:
> hi.
> are there any "good ways" or any modules that can be used to create report
> forms in a simple manner.
>
> from time to time users demand new reports to be created from data in a
> database, the reports are presented in a web interface.
>
> the problem is that every time the users need a new report, the developers
> need to write a few lines of code and change a few templates.
> if possible it would be good if the users could specify new reports
> themselfs or at least if the developers could use some report genarator to
> speed up the process.
>
> any ideas?
>
> /stig
You could teach them basic SQL and give them read-only access to the
database.
or
Build an SQL query generating form like phpMyAdmin's 'select' function.
Without knowing what kind of data and what a 'report' is, it is difficult to
suggest anything specific.
--
Brian Wakem
------------------------------
Date: 9 Jun 2005 15:59:57 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: report generator
Message-Id: <Xns96706FBB0BEA1castleamber@130.133.1.4>
stig wrote:
> hi.
> are there any "good ways" or any modules that can be used to create
> report forms in a simple manner.
>
> from time to time users demand new reports to be created from data in
> a database, the reports are presented in a web interface.
>
> the problem is that every time the users need a new report, the
> developers need to write a few lines of code and change a few
> templates. if possible it would be good if the users could specify new
> reports themselfs or at least if the developers could use some report
> genarator to speed up the process.
So to boil it down, you look for a module that renders an SQL query as an
HTML table?
http://search.cpan.org/~aaronjj/Class-DBI-Plugin-HTML-0.9/HTML.pm
( http://search.cpan.org/search?query=DBI+HTML&mode=all )
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 8159
***************************************