Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

SKYPE incoming call monitor

by jdtoronto (Prior)
on Mar 12, 2006 at 03:25 UTC ( [id://536019]=perlquestion: print w/replies, xml ) Need Help??

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

Esteemed Monks,

My Win32 Perl/Tk application needs to monitor Skype and when an incoming call is received it needs to get the PSTN_NUMBER or the USERNAME of the caller from the API.

I have the API reference document and the ActiveS COM wrapper which has been suggested as necessary, but beyond the fact that I recognise the name pf the product the rest of it is like magic to me. The onyl sample Perl code I have seen for Skype gives me no clue as to how I could go about getting the info I need.

What am I missing? (apart from a brain that is!) Can anyone help with sample code or even some advice please.

jdtoronto

Replies are listed 'Best First'.
Re: SKYPE incoming call monitor
by spiritway (Vicar) on Mar 12, 2006 at 06:37 UTC

    Could you point us to the API reference, or the sample Perl code for Skype? Someone with more experience (who probably isn't me) might be able to offer some helpful comments, if they could see the actual code.

        You probably already noticed, but I thought I would mention for others' benefit: that article does contain a section with an example written in Perl of accessing the Skype API under Windows. It's unfortunately cluttered with Tk stuff, but that's transparent enough that you can still learn a lot from the code. Examples are given in other languages too, which may be helpful for some people.


        Dave

Re: SKYPE incoming call monitor
by jdtoronto (Prior) on Mar 14, 2006 at 02:26 UTC
    Esteemed colleagues,

    In my usual rush I came here and added a bundle of info, previewed it and forgot to post it! I have done some more work and have the following to report which hopefully may enable some of the more experienced amongst the monastrians to be able to help me some more.

    The link from virtualsue to the SkypeJournal material points to an extremely simplistic application where, as is noted, the Tk shrouds the Perl guts. And the Perl guts is almost inconsequential.

    use strict; use warnings; use Win32::OLE qw(in); . . my objskype - Win32::OLE->new('SKYPEAPI.Access'. 'objSkype_'); $objSkype->SendMessage( $targethandle, $message );
    Which simply sends a chat message to the specified target. The ActiveS COM wrapper ( http://www.khaoslabs.com/actives.php ) offer no more information. An email to the author elicited the response that he knew absolutely nothing about Perl. So I hacked away and finally started to get something back from the API. This rudimentary caode:
    #!/usr/bin/perl -w use strict; use warnings; use Data::Dumper; use Win32::OLE qw(in valof with); my $objskype = Win32::OLE->new('SKYPEAPI.Access'); my $ex = $objskype->GetCallList(); foreach my $key ( keys( %$ex)) { print( $key, "\n"); } foreach my $value (in $ex) { print "$value->{ID} : $value->{STATUS} : $value->{PSTN_NUMBER}\n"; }
    Gets the following:
    skt.pl Count Item 1165 : 11 : +647723xxxx 1216 : 7 : +1416778xxxx
    If I were to run code like this in a polling loop I could get the info I need, but with an overhead! Having got this far, can anyone tell me where to find information on handling EVENTS with Win32::OLE?

    The documenation for the wrapper gives a list of events, but nothing more.

    jdtoronto

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://536019]
Approved by dorko
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-25 08:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found