Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connection refused... with Skype
Message
De
23/07/2009 19:09:20
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01413871
Message ID:
01414113
Vues:
40
>>>>The error is "OLE lDispatch exception code 0 from Skype4COM.Skype.1: Connection refused..."
>>>>
>>>>Here is some code that I found and it doesn't work for me
>>>>
>>>>
>>>>** Create a Skype4COM object:
>>>>oSkype = CreateObject("Skype4COM.Skype", "Skype_")
>>>> 
>>>>** Start the Skype client:
>>>>If !oSkype.Client.IsRunning 
>>>>	oSkype.Client.Start()
>>>>ENDIF 
>>>> 
>>>>** Declare the following Skype constants:
>>>>cUserStatus_Offline = oSkype.Convert.TextToUserStatus("OFFLINE")
>>>>cUserStatus_Online = oSkype.Convert.TextToUserStatus("ONLINE")
>>>>cCallStatus_Ringing = oSkype.Convert.TextToCallStatus("RINGING")
>>>>cCallStatus_Inprogress = oSkype.Convert.TextToCallStatus("INPROGRESS")
>>>>cCallStatus_Failed = oSkype.Convert.TextToCallStatus("FAILED")
>>>>cCallStatus_Refused = oSkype.Convert.TextToCallStatus("REFUSED")
>>>>cCallStatus_Cancelled = oSkype.Convert.TextToCallStatus("CANCELLED")
>>>>cCallStatus_Finished = oSkype.Convert.TextToCallStatus("FINISHED")
>>>>cCallStatus_Busy = oSkype.Convert.TextToCallStatus("BUSY")
>>>>cAttachmentStatus_Available = oSkype.Convert.TextToAttachmentStatus("AVAILABLE")
>>>>	 
>>>>** The PlaceCall command will fail if the user is offline. To avoid failure, check user status and change to online if necessary:
>>>>*!*	If cUserStatus_Offline = oSkype.CurrentUserStatus 
>>>>*!*		oSkype.ChangeUserStatus(cUserStatus_Online)
>>>>*!*	ENDIF 
>>>>
>>>>** Create a user object:
>>>>oUser = oSkype.User("Chasse Denis")
>>>>
>>>>
>>>>*!*	MESSAGEBOX( "User " + oUser.Handle + " online status is " + oSkype.Convert.OnlineStatusToText(oUser.OnlineStatus))
>>>>*!*	WScript.Echo "User " & oUser.Handle & " online status is " & oSkype.Convert.OnlineStatusToText(oUser.OnlineStatus)
>>>>
>>>>SET STEP ON 
>>>>
>>>>** Place a call:
>>>>
>>>>
>>>>Up to this point everything is ok. It's what follows that is not right.
>>>>
>>>>I tried the next three ways to place a call. They all give errors.
>>>>
>>>>
>>>>oCall = oSkype.PlaceCall(oUser)
>>>>oCall = oSkype.PlaceCall(oUser.Handle)
>>>>oSkype.PlaceCall(oUser.Handle)
>>>>
>>>>
>>>>If even if one of the previous worked it wouldn't really do what I want.
>>>>
>>>>From my VFP app. I want to be able to call a phone number (SkypeOut)
>>>>
>>>>Anybody knows how to fix this?
>>>
>>>I have started to reply in the private area but you never came back,
>>>
>>>The correct syntax to place a call is you call the handle.
>>>
>>>
oskype.PlaceCall(ouser.Handle)
>>>
>>>This one bring up the interface and starts dialing. Two things:
>>>1. You may want to add this line to your code, after you created the oSkype object:
>>>
oSkype.Attach()
>>>2. Skype has to already be running, minimized in the tray for this to work.
>>
>>
>>Here's the last version that I have
>>
>>
>>DECLARE Sleep IN kernel32 INTEGER dwMilliseconds
>> 
>>oskype = CREATEOBJECT("Skype4COM.Skype", "Skype")
>>oskype.timeout = 5000
>>sleep(1000)
>>setskypesilent()
>>
>>&& I tried many variations here but non came through
>>&& I tried "+15146441809"
>>&& I tried "+5146441809"
>>
>>oSkype.PlaceCall("5146441809")
>>
>>PROCEDURE setSkypeSilent
>>LOCAL lcerror
>>TRY
>>    IF EMPTY(oskype.silentmode)
>>     oskype.silentmode = .T.
>>     DOEVENTS
>>    ENDIF
>>CATCH TO lcerror
>>FINALLY
>>ENDTRY
>>ENDPROC
>>
>>
>>Still the same error comes out. Connection refused
>
>As I said in an other post, you original code works for me. It is hard to determine why your connection is refuse. Can you make a call with Skype without VFP?

Yes I'm able to do it. I know that from this point we're in the "Weird zone" ;-)

I will try do this on my portable computer. If I'm able to do it then there's something wrong with my installation on my desktop.

I will let you know how it turns out.

Thanks for your help.
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform