Help - Search - Members - Calendar
Full Version: PHP Script error
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
lobsterninja
I'm really sorry if this has been posted before, but I searched the forums as best I could and nothing came up. So I'm really new to this who skype api deal, but not really all that new to PHP. So, tonight I was messing around with some sample PHP code I found on the forums (the one also posted in the examples on the documentation) and I wound up with this error. I'm pretty sure I set up the api library correctly, and everything should be working fine, but apparently not:

QUOTE

>Attachment status 3
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Skype4COM.Skype.1<br/><b>Description:</b> Not attached.' in C:\wamp\www\skype.php:33 Stack trace: #0 C:\wamp\www\skype.php(33): com->currentUserStatus() #1 {main} thrown in C:\wamp\www\skype.php on line 33


Line 33 is:
CODE
if ($skype->currentUserStatus() == $convert->textToUserStatus("OFFLINE")) {



Thanks in advance for the help, and again, I'm sorry if this is a really dumb question/is in the wrong section/has been asked before.
Avo Nappo
CODE
if ($skype->currentUserStatus() == $convert->textToUserStatus("OFFLINE")) {


The problem is that when you log user out from Skype, attachment between your application and Skype is broken. You are testing this with logging out from Skype, yes? Try the same code by setting user status to 'OFFLINE' manually from the UI and see if you still get that error.

That will not solve your main problem tho - you cannot actually do much anything with Skype if you are not logged in.
lobsterninja
Ok, so since I'm particularly dense, I'm having a few more problems. So now I decided just to try and get Skype running with a PHP script. Maybe this isn't possible, but I figured it couldn't hurt to try. I guess I should first ask: is it conceivable to write a PHP script that runs the skype client on the client's computer allowing them to talk to a predetermined number? I tried more of the code off the example:
CODE
<?php
// Event sink:
class _ISkypeEvents {
  
  function AttachmentStatus($status) {
   echo ">Attachment status $status\n";
  }
  function CallStatus($call, $status) {
   echo ">Call $call->id status $status\n";
  }
}

// Create a Skype4COM object:
$skype = new COM("Skype4COM.Skype");

// Create a sink object:
$sink =& new _ISkypeEvents ();
$sink->convert = $skype->convert();

// Connect to the sink:
com_event_sink($skype, $sink, "_ISkypeEvents");

// Create a conversion object:
$convert = $skype->convert;
$convert->language = "en";

//start skype
if (!$skype->client()->isRunning()) {
  $skype->client()->start(true, true);
}
?>


Again, sorry if this is a stupid question.
owntheweb
I'm having the same issue as well, posted here: http://forum.skype.com/index.php?showtopic=87578

Any progress on this? sadsmile.png
4e4en
in my opinion it should be

CODE

$convert = &$skype->convert;
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.