[AsteriskBrasil] Asterisk - Fax

jefaokpta jefaokpta em hotmail.com
Quinta Novembro 7 08:55:21 BRST 2013


Mike, vlw pelo script.

Flws

Em 06-11-2013 16:29, Mike Tesliuk escreveu:
> #!/usr/bin/perl
>
>
> use MIME::Lite;;
> use Net::SMTP;
>
> @ARGV;
>
> my $faxfile = $ARGV['0'];
> my $faxname = $ARGV['1'];
> my $destination = $ARGV['2'];
> my $faxname2 = "/var/spool/asterisk/fax/" . $faxname;
>
> system("tiff2pdf -o $faxname2 $faxfile");
>
> my ($sec,$min,$hour,$mday,$mon,$year,
>           $wday,$yday,$isdst) = localtime time;
>
> if(!$destination){
>     $destination = "EU\@MEUDOMINIO";
> }
>
> $msg = MIME::Lite->new(
>     From => 'pabx_COMPANIA em DOMINIO',
>     To => '$destination',
>     Subject => "Fax recebido em $mday/" . ($mon + 1) . "/" . ($year + 
> 1900) . " as $hour:$min:$sec ",
>     Type => 'multipart/mixed'
> );
>
> $msg->attach(
>     Type => 'TEXT',
>     Data => "Ola!, \n\nVoce recebeu um novo fax, o arquivo esta em 
> anexo.\n\nAtt. Equipe de Tecnologia COMPANIA\n"
> );
>
> $msg->attach(
>     Type => 'application/x-pdf',
>     Path => "$faxname2",
>     Filename => "$faxname",
>     Disposition => 'attachment'
> );
>
> $smtp = Net::SMTP->new(Host => "SERVIDOR_SMTP",
>     Debug => 1,
> );
> $smtp->auth("USUARIO\@DOMINIO", "SENHA");
> $smtp->mail("USUARIO\@DOMINIO");
> $smtp->to("$destination");
> $smtp->data();
> $smtp->datasend( $msg->as_string );
> $smtp->dataend();
> $smtp->quit();



Mais detalhes sobre a lista de discussão AsteriskBrasil