Hi there has anyone done this?
I've incorporated part of a skype4com vbscript example into a VB.NET class.
When calling from a windows vb.net form everything works ok. However if calling from an ASP.NET page I get the following error:
(0x80040207)
The owner SID on a per-user subscription doesn't exist
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The owner SID on a per-user subscription doesn't exist
Source Error:
Line 32: 'status = oSkype.Convert.ConnectionStatusToText(oSkype.ConnectionStatus)
Line 33: 'oSkype.Client.Focus()
Line 34: If Not oSkype.Client.IsRunning Then oSkype.Client.Start()
Line 35:
Line 36: cUserStatus_Offline = oSkype.Convert.TextToUserStatus("OFFLINE")
I realised that the error must have been occuring because the ASP.NET page is running under a different user context to SKYPE and therefore Client.IsRunning returns false.
However, The code now includes some impersonation so that the user account that Skype is running under is logged into.
Any help would be greatly appreciated.
flipperweb :?
code below:
Sub New()
Dim status As String
'Need to impersonate the Skype user.
Dim theImpersonationTool As WindowsIdentImpers.WinIdentImpers = New WindowsIdentImpers.WinIdentImpers
status = System.Security.Principal.WindowsIdentity.GetCurrent().Name
If Not InStr("axuser", status) Then
status = theImpersonationTool.LogonUser("axuser", "PA55word")
status = System.Security.Principal.WindowsIdentity.GetCurrent().Name
End If
oSkype = New SKYPE4COMLib.Skype
'status = oSkype.Convert.ConnectionStatusToText(oSkype.ConnectionStatus)
'oSkype.Client.Focus()
If Not oSkype.Client.IsRunning Then oSkype.Client.Start()
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")
cAttachmentStatus_Available = oSkype.Convert.TextToAttachmentStatus("AVAILABLE")
cCallStatus_Busy = oSkype.Convert.TextToCallStatus("BUSY")
If cUserStatus_Offline = oSkype.CurrentUserStatus Then
oSkype.ChangeUserStatus(cUserStatus_Online)
End If
End Sub