php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40478 skype dll problem Skype4COM.dll
Submitted: 2007-02-14 10:58 UTC Modified: 2007-03-26 10:04 UTC
Votes:17
Avg. Score:4.9 ± 0.5
Reproduced:16 of 16 (100.0%)
Same Version:16 (100.0%)
Same OS:16 (100.0%)
From: virals at meditab dot in Assigned:
Status: Not a bug Package: COM related
PHP Version: 5.2.1 OS: windows xp
Private report: No CVE-ID: None
 [2007-02-14 10:58 UTC] virals at meditab dot in
Description:
------------
i have downloaded the skype free Skype4COM.dll and using it through the com object the code is also available on skype developer zone. 

Reproduce code:
---------------
<?php
set_time_limit(0);
// 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 the Skype client, minimized and with no splash screen:
 if (!$skype->client()->isRunning()) {
   $skype->client()->start(true, true);
 }
 
 // If the user status is not "online", change user status to "online":
 if ($skype->currentUserStatus() == $convert->textToUserStatus("OFFLINE")) {  
   $skype->changeUserStatus($convert->textToUserStatus("ONLINE"));
 }
 
 // Create a user object
 $user = $skype->user("viral2583");
 echo "User " . $user->handle . " online status is " . $convert->onlineStatusToText($user->onlineStatus) . "\n";
 
 // Place a call
 $call = $skype->PlaceCall($user->handle);
 
 // Wait for the call to be "in progress" and report an error if:
 while ($call->status <> $convert->textToCallStatus("INPROGRESS")) {
   if ($call->status == $convert->textToCallStatus("FAILED") || 
     $call->status == $convert->textToCallStatus("REFUSED") || 
     $call->status == $convert->textToCallStatus("CANCELLED") || 
     $call->status == $convert->textToCallStatus("FINISHED") || 
     $call->status == $convert->textToCallStatus("BUSY"))
     die ("Call status " . $convert->callStatusToText($call->status));
   else
     com_message_pump (500);       
 }
 
 // Send dtmf tones:
 com_message_pump (10000);
 if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "0";
 com_message_pump (500);
 if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "1";
 com_message_pump (500);
 if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "2";
 com_message_pump (500);
 if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "3";
 com_message_pump (500);
 if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "4";
 com_message_pump (500);
 if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "5";
 com_message_pump (500);
 if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "6";
 com_message_pump (500);
 if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "7";
 com_message_pump (500);
 if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "8";
 com_message_pump (500);
 if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "9";
 com_message_pump (500);
 if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "#";
 com_message_pump (500);
 if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "*";
 
 // Finish the call: 
 if ($call->status <> $convert->textToCallStatus("FINISHED")) $call->finish();
 
 //Sleep:
 com_message_pump (1000);
   
?>


Expected result:
----------------
it should call the phone if skype is running on system.

Actual result:
--------------
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Skype4COM.Skype.1<br/><b>Description:</b> Wait timeout.' in D:\www\call1.php:41 Stack trace: #0 D:\www\call1.php(41): unknown() #1 {main} thrown in D:\www\call1.php on line 41

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-14 11:04 UTC] tony2001@php.net
You forgot to explain why this is PHP problem and not a problem of Skype4COM.dll.
 [2007-02-14 11:12 UTC] virals at meditab dot in
Thanks for your quick reply 
but the same code and dll is working with javascript. 
but i don't know y it is not working with PHP. Cant we find whether it is PHP or skype problem. Is i missed something at php configuration.  I dont want to use javascript because it is only working with IE for other browser they are working.
 [2007-02-14 12:01 UTC] tony2001@php.net
>Thanks for your quick reply but the same code and dll is
>working with javascript
It doesn't mean you should be able to connect from PHP, since it's completely different thing (and web-servers usually run with different privileges etc.).
The error message and the exception look quite safe to me and I'm still not sure it's PHP problem.
 [2007-02-14 14:25 UTC] virals at meditab dot in
as i guess it is php problem only because this file is supported for Visual Studio or Delphi, using preferred scripting languages such as VBScript, PHP, or Javascript.

.vbs 
.php 
.js 
.cs 

And there are plenty of function available and if i used any of it, it is giving the same error.
 [2007-02-14 14:34 UTC] tony2001@php.net
I'm sorry, I don't understand your last comment.
 [2007-02-15 04:57 UTC] virals at meditab dot in
ok. Actually i was giving the descriptio Skype4Com.dll
:
Skype4COM represents the Skype API as objects, with: 
methods 
properties 
events 
collections 
caching 

Skype4COM provides an ActiveX interface to the Skype API. Develop for Skype in a familiar programming environment, such as Visual Studio or Delphi, using preferred scripting languages such as VBScript, PHP, or Javascript.

Requirements: 
Skype 3.0 must be installed 
Windows 2000 or Windows XP 

And this .dll provide so many methods and classes bt i am not able to call any of it. Whichever function of api i am calling it is giving me the same error. 

So there must be something missing from PHP side.

hey how i can send you the .chm help file of Skype4Com?
 [2007-02-17 07:13 UTC] virals at meditab dot in
Tony..........r u busy with some other work i m waiting for the answer.
 [2007-03-25 20:47 UTC] johannes at jroith dot de
The problem is, I guess, that Skype wants to show an authorization dialog, but can't, because php is running on a server that is running as a service.
 [2007-03-25 20:53 UTC] johannes at jroith dot de
The problem can be solved by allowing Apache "to interact with the desktop". This setting can be set in the "Services" management console. Right click "Apache...", go to "Prperties". Make sure the box "Allow this service to interact with desktop" in the "Log on"-Tab is checked.
 [2007-03-26 10:04 UTC] tony2001@php.net
Not PHP problem.
 [2012-02-28 08:26 UTC] 077cha at gmail dot com
Thanx "johannes at jroith dot de".working and just set the properties of "wampapachi" if you using wampserver.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 09:01:33 2024 UTC