Re: [asterisk-users] [*Win32 0.60] Sending call notification by e-mail/web?

2007-05-15 Thread Nick Seraphin

On Tue, 15 May 2007, Vincent Delporte wrote:

 Hello,
 
 In case there are other users of the AsteriskWin32 port...
 
 I haven't really used the AGI feature of Asterisk to run an application 
 from extensions.conf. *Win32 supports Perl, which I don't know. Apparently, 
 it's also possible to write AGI applications as EXE's (there's a 
 eagi-test.exe file installed by default).
 
 = When a call comes in, I'd like an AGI application to send an e-mail and 
 send CID name/number to a script on a web server.
 
 Is this the correct way to do it in Perl, with the modules available in 
 AsteriskWin32? Could I rewrite this in Delphi instead?


ALL AGI scripts are basically just programs that read from stdin and write
to stdout.  They can therefore be written in almost any language.  So yes,
Delphi should work fine.

(I have very fond memories of Delphi, and before that, Borland Pascal w/
Objects for DOS, and before that, Turbo Pascal...  one of these days I'll
have to get the latest version of Delphi and take a walk down memory lane.
These days everything is C this or Perl that.  I loved Pascal. :-)) 

-- Nick


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

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


Re: [asterisk-users] [*Win32 0.60] Sending call notification by e-mail/web?

2007-05-15 Thread Time Bandit

Could I rewrite this in Delphi instead?


I never used Delphi to write an AGI but I've seen a class in
FreePascal that you could probably use as a base :
http://www.automated.it/asterisk/fpc-agi.html

hth
___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [asterisk-users] [*Win32 0.60] Sending call notification by e-mail/web?

2007-05-15 Thread Lee Jenkins

Vincent Delporte wrote:

Hello,

In case there are other users of the AsteriskWin32 port...

I haven't really used the AGI feature of Asterisk to run an application 
from extensions.conf. *Win32 supports Perl, which I don't know. 
Apparently, it's also possible to write AGI applications as EXE's 
(there's a eagi-test.exe file installed by default).


= When a call comes in, I'd like an AGI application to send an e-mail 
and send CID name/number to a script on a web server.


Is this the correct way to do it in Perl, with the modules available in 
AsteriskWin32? Could I rewrite this in Delphi instead?




Vincent,

Freepascal seems to work very nicely.  However, I'm not sure how delphi 
behaves with stdin/stdout since I've not written many console apps in 
delphi, mostly GUI rich software.  The best bet would be as another 
poster suggested and to write a FastAGI server.


If you don't feel like writing a FastAGI server, you can also take a 
look at AsterPas which is a pascal based FastAGI server for both Windows 
and Linux (written in freepascal):


http://www.datatrakpos.com/pos/datatalk/asterpas.aspx

It's still in beta, but works very well.  You can check out some scripts 
that I've written so far:


http://www.leebo.dreamhosters.com/apscripts/



--

Warm Regards,

Lee



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

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


Re: [asterisk-users] [*Win32 0.60] Sending call notification by e-mail/web?

2007-05-15 Thread Lee Jenkins

Vincent Delporte wrote:

Hello,

In case there are other users of the AsteriskWin32 port...

I haven't really used the AGI feature of Asterisk to run an application 
from extensions.conf. *Win32 supports Perl, which I don't know. 
Apparently, it's also possible to write AGI applications as EXE's 
(there's a eagi-test.exe file installed by default).


= When a call comes in, I'd like an AGI application to send an e-mail 
and send CID name/number to a script on a web server.


Is this the correct way to do it in Perl, with the modules available in 
AsteriskWin32? Could I rewrite this in Delphi instead?





Vincent,

Freepascal seems to work very nicely.  However, I'm not sure how delphi 
behaves with stdin/stdout since I've not written many console apps in 
delphi, mostly GUI rich software.  The best bet would be as another 
poster suggested and to write a FastAGI server.


If you don't feel like writing a FastAGI server, you can also take a 
look at AsterPas which is a pascal based FastAGI server for both Windows 
and Linux (written in freepascal):


http://www.datatrakpos.com/pos/datatalk/asterpas.aspx

It's still in beta, but works very well.  You can check out some scripts 
that I've written so far:


http://www.leebo.dreamhosters.com/apscripts/


We're planning on adding a mail client class to the scripting engine soon.


--

Warm Regards,

Lee



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

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


[asterisk-users] [*Win32 0.60] Sending call notification by e-mail/web?

2007-05-14 Thread Vincent Delporte

Hello,

In case there are other users of the AsteriskWin32 port...

I haven't really used the AGI feature of Asterisk to run an application 
from extensions.conf. *Win32 supports Perl, which I don't know. Apparently, 
it's also possible to write AGI applications as EXE's (there's a 
eagi-test.exe file installed by default).


= When a call comes in, I'd like an AGI application to send an e-mail and 
send CID name/number to a script on a web server.


Is this the correct way to do it in Perl, with the modules available in 
AsteriskWin32? Could I rewrite this in Delphi instead?


---
#!/usr/bin/perl

;---
;Note: Not sure if *Win32 supports LWP::Simple and Net::SMTP!

;Called from extensions.conf
;exten = group,n,AGI(notify.agi|${CALLERID(num)}|${CALLERID(name)})

;---

use strict;

open STDOUT, '/dev/null';
fork and exit;

;---
use LWP::Simple;

my $cidnum = $ARGV[0];
my $cidname = $ARGV[1];

my $url = 'http://www.acme.com/input.php?name=$cidnamenumber=$cidnum';
my $content = get $url;
die Couldn't get $url unless defined $content;
print STDERR Notified web server

;---
use Net::SMTP;

$smtp = Net::SMTP-new('smtp.acme.com'); # connect to an SMTP server
$smtp-mail( '[EMAIL PROTECTED]' ); # use the sender's address here
$smtp-to('[EMAIL PROTECTED]');# recipient's address
$smtp-data();  # Start the mail

# Send the header.
$smtp-datasend(To: [EMAIL PROTECTED]);
$smtp-datasend(From: [EMAIL PROTECTED]);
$smtp-datasend(\n);

# Send the body.
$smtp-datasend(Call received from $cidname/$cidnum\n);
$smtp-dataend();   # Finish sending the mail
$smtp-quit;
print STDERR Send e-mail
---

Thanks for any tip 


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

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