My question is: I use the "SkypeAPI.Access" to connect. Now, how do I transition to use the other modules e.g. user class, call class etc?
Thanks
QUOTE
<?php
class Skype {
var $terminated = false;
var $attached = false;
public $skype;
function connect() {
$skype = new COM("SkypeAPI.Access");
try {
$skype->Connect();
} catch (Exception $com_exception) {
print "Exception calling skype.connect - <$com_exception>n";
}
sleep(5);
print "called connectn";
}
function APIStatusChanged($status) {
print "inside APIStatusChangedn";
print ">Attachment Status: $skype->Convert->AttachmentStatusToText($status)n";
$attached = true;
}
function CallStatus($call, $status) {
echo ">Call Status: $statusn";
}
function Command($command) {
print "nCommand sent: $commandn";
}
function Quit() {
print "QUIT!";
$terminated = true;
}
}
// Create skype object
$skype = new COM("SkypeAPI.Access");
$sink = new Skype();
com_event_sink($skype, $sink, "Skype");
$sink->connect();
com_message_pump(1000);
if ($skype->APIAttachmentStatus == 0) {
print "attached using APIAttachmentStatusn";
//$user = $skype->SearchForUser("user name");
com_message_pump(1000);
print "onlinestatus = $skype->FullName()";
$userhandle = $user->Handle($user);
} else {
$convert = $skype->convert;
print "cannot connect reason code = <$convert->SkypeAPIAttachmentStatusAsText($skype->APIAttachmentStatus)>";
}
output and error:
C:php>php testskype1.php
called connect
attached using APIAttachmentStatus
PHP Fatal error: Uncaught exception 'com_exception' with message 'Unable to lookup `FullName': Unkn
own name.
' in c:Program FilesApache GroupApache2htdocstestskype1.php:52
Stack trace:
#0 c:Program FilesApache GroupApache2htdocstestskype1.php(52): unknown()
#1 {main}
thrown in c:Program FilesApache GroupApache2htdocstestskype1.php on line 52
C:php>