Massyn has asked for the wisdom of the Perl Monks concerning the following question:

#!/fellow/monks.pl

I don't really want to query the voice modem directly through the serial port.. That would mean studying many AT commands that I don't have the time for developing and testing. Instead, I'm looking for some TAPI interface that will allow my trusted Perl script to utilise a voice modem.

Alas, CPAN doesn't have anything. The closest we get is to the IVR module, but sadly, this is just a VGetty frontend for Linux. Sorry - I need this on Windows (corporate policy, etc).

Fearless monks - have any of you managed to get TAPI working through Perl in particularly controlling a voice modem, sending wav files across, reading DTMF, etc. on the Windows platform?

Many blessings...

#!/massyn.pl

Don't -- me without telling me why. If you asked a stupid question, I wouldn't down vote you.

Replies are listed 'Best First'.
Re: TAPI from Perl??
by tachyon (Chancellor) on Nov 30, 2003 at 12:47 UTC

    Win32::SerialPort is OO and not that bad to use. Have a look at the examples here. Of course you could always just write the required XS wrapper for the TAPI32.DLL. Win32::Internet is the wrapper for the WININET.DLL and should work as a template for what you need (it is part of libwin).

    cheers

    tachyon

      If you don't like writing XS, you might be able to get away with writing some wrappers with Win32::API module. It works like this:
      use Win32::API; my $function = Win32::API->new( 'mydll, 'int sum_integers(int a, int b)', ); my $return = $function->Call(3, 2); # or, if you don't like the ->Call() syntax: Win32::API->Import( 'mydll', 'int sum_integers(int a, int b)', ); $return = sum_integers(3, 2); # Works great for system DLLs, too: Win32::API->Import("kernel32", "int GetCurrentProcessId()"); my $PID = GetCurrentProcessId();
      There's even support for defining structures within your perl script, for use with the DLL's interface.

      If you only have a handful of functions to call, this may be the way to go for you. Assuming, of course, that you have access to the documentation for that particular DLL...

      :)