Jump to content

Skype UDF Library - Skype4COM


Airwolf
 Share

Recommended Posts

I recently posted some Skype example scripts that I had converted from VBS to AutoIt. There was enough interest to encourage the creation of a UDF library, so I have done just that!

IMPORTANT: Skype4Com.dll is automatically included together with Skype Extras Manager during Skype installation. If a user has unchecked Extras Manager during installation, Skype4Com library will be unavailable on that machine and this code will not work.

Currently, the UDF only contains functions related to phone calls; they are as follows:

_SkypeCOM_Attach()

_SkypeCOM_AttachmentStatus()

_SkypeCOM_StartClient()

_SkypeCOM_CurrentUserStatus()

_SkypeCOM_ChangeUserStatus()

_SkypeCOM_PlaceCall()

_SkypeCOM_CallStatus()

_SkypeCOM_ActiveCalls()

_SkypeCOM_MissedCalls()

_SkypeCOM_CallDTMFCodes()

_SkypeCOM_CallAnswer()

_SkypeCOM_CallFinish()

_SkypeCOM_CallHold()

_SkypeCOM_CallResume()

_SkypeCOM_CallJoin()

_SkypeCOM_CallForward()

_SkypeCOM_CallTransfer()

_SkypeCOM_CallRedirectToVoicemail()

_SkypeCOM_CallStartVideo()

_SkypeCOM_CallStopVideo()

Keep the following in mind *IMPORTANT*:

  • There is a custom COM error handler built into the UDF.
  • Before performing any Skype actions, make sure the client is running (and up to date). You can use the _SkypeCOM_StartClient() function to start Skype if you'd like.
  • The AttachmentStatus function must return "Success" before you attempt to perform a Skype action. Run the _SkypeCOM_Attach() function if _SkypeCOM_AttachmentStatus() returns 0; if you do this before performing a Skype action, you will be fine.
  • When a plugin or program tries to connect to Skype, you will have to allow it access within the Skype client (you will receive a prompt in Skype). You can manage this access in Skype -> Tools -> Options -> Advanced -> Advanced Settings -> Manage other programs' access to Skype.
The UDF library is still a work in progress. I am currently adding in the chat functions. If there are any specific functions you would like to see, please send me a PM or post to this thread and I will create them.

**CHM Help File: Coming Soon!

SkypeCOM.au3

Edited by Airwolf
Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt
Link to comment
Share on other sites

  • 2 weeks later...

Thank you for your library.

Before the help file is ready could you please make also a simple example of using for instance

_SkypeCOM_PlaceCall()

Thank you.

You can use a SkypeName, phone number, or speed dial number for PlaceCall(). You can use up to 4 numbers and it will create a conference. To use a standard phone number, you must use the country code (i.e. +1 for the US) or it will error on you. this example starts a conference call with a skype user and a land line number, but you can use anywhere from 1-4 numbers/users/speed dial codes.

#include <SkypeCOM.au3>

_SkypeCOM_StartClient() ; starts Skype if it isn't running
; you may need a sleep() timeout here to allow time for Skype to sign your account in before the script proceeds... I'm working on a way to get around this. You don't even need to use the StartClient() function if you already have Skype open and logged in

If _SkypeCOM_Attach() Then ; attempts to attach to Skype if the attachmentstatus is not Success
    _SkypeCOM_PlaceCall("+18005555555", "echo123") ; you can use a number, skypename or speed dial code
Else
    MsgBox(48,"Error","Unable to attach to Skype.")
EndIf
Edited by Airwolf
Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt
Link to comment
Share on other sites

  • 8 months later...

You can use a SkypeName, phone number, or speed dial number for PlaceCall(). You can use up to 4 numbers and it will create a conference. To use a standard phone number, you must use the country code (i.e. +1 for the US) or it will error on you. this example starts a conference call with a skype user and a land line number, but you can use anywhere from 1-4 numbers/users/speed dial codes.

#include <SkypeCOM.au3>

_SkypeCOM_StartClient() ; starts Skype if it isn't running
; you may need a sleep() timeout here to allow time for Skype to sign your account in before the script proceeds... I'm working on a way to get around this. You don't even need to use the StartClient() function if you already have Skype open and logged in

If _SkypeCOM_Attach() Then ; attempts to attach to Skype if the attachmentstatus is not Success
    _SkypeCOM_PlaceCall("+18005555555", "echo123") ; you can use a number, skypename or speed dial code
Else
    MsgBox(48,"Error","Unable to attach to Skype.")
EndIf

This one is amazing....

What should i be doing if i got to place a call and have predefined numbers to respond to the IVR?

Your help much appreciated

Link to comment
Share on other sites

  • 3 months later...

Has any progress been made since the original post, ie. help file?

Also, I was wondering if a function could be added to play or record WAV files as per this example here?

Cheers,

Kaj

There is no helpfile, you have to translate vbs examples to autoit. in fact there is a chm file

https://developer.skype.com/

Cheers, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Thanks FireFox, have been trying to do just that.

I'm trying to add a new function to the UDF lib as per this snippet from this example

call.OutputDevice(SKYPE4COMLib.TCallIoDeviceType.callIoDeviceTypeFile) = "C:\\DistantEnd.wav";

So I added this function to the Skype UDF Library:

Func _SkypeCOM_CallPlayWav($id, $wav)
    $oCall = $oSkype.Call($id)
    If $oCall.Status = $CallStatus_InProgress Then
        $oCall.InputDevice.TCallIoDeviceType.callIoDeviceTypeFile=$wav
        Return 1
    Else
        Return 0
        SetError(1)
    EndIf
EndFunc

Which gives me a COM error when I call _SkypeCOM_CallPlayWav(9453,"c:\testme.wav") (9453 is the call ID from the current Skype call).

Any ideas anyone?

Link to comment
Share on other sites

  • 2 months later...

sometime ago I posted a way to overcome one of th biggest skype problems: both users must be online in order to a msg to get destinee.

http://www.autoitscript.com/forum/index.php?showtopic=88746& "skype repeater when offline -> how to send messages even when we are offline"

while at the end it didn't use Au3 for the solution, the original goal was to use. We are using it for a while and it is complete success. Now, messages sent when the destinee is ofline will be received by him as soon as he logs on and not just when both are logged!

But there is a drawback. Sent files are not "repeated". These only will be received if both parties are online.

I'm gessing if with this Skype UDF it would be possible to "repeat" the sent files... probably some au3 script at the "repeater" machine... getting and resending the attached files to people that become online? I'm not sure....

Thanks

Jose

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...

sometime ago I posted a way to overcome one of th biggest skype problems: both users must be online in order to a msg to get destinee.

http://www.autoitscript.com/forum/index.php?showtopic=88746& "skype repeater when offline -> how to send messages even when we are offline"

while at the end it didn't use Au3 for the solution, the original goal was to use. We are using it for a while and it is complete success. Now, messages sent when the destinee is ofline will be received by him as soon as he logs on and not just when both are logged!

But there is a drawback. Sent files are not "repeated". These only will be received if both parties are online.

I'm gessing if with this Skype UDF it would be possible to "repeat" the sent files... probably some au3 script at the "repeater" machine... getting and resending the attached files to people that become online? I'm not sure....

Thanks

Jose

Hi All,

Can anybody help me how to signin to skype after lunching the client _SkypeCOM_StartClient() ; starts Skype if it isn't running

Thanks & advanced

Tapan Kumar

Link to comment
Share on other sites

Hi All,

Can anybody help me how to signin to skype after lunching the client _SkypeCOM_StartClient() ; starts Skype if it isn't running

Thanks & advanced

Tapan Kumar

It's not possible :/

Check my Skype UDF, it may be usefull for you :)

Br, FireFox.

Link to comment
Share on other sites

  • 4 months later...

Hello

I'm a total novice of Autoit and I come from a PHP environment.

I am currently working on a solution that allows me to queue Skype calls by getting numbers in an array and do a call for each number. Later on I will be adding controls to call specific numbers but I am willing to work on the "call the whole list" function.

The problem is that, in this presented way, the numbers "for" function loops too many times, the numbers are over and still, I get an error. Also I would like to say that the doCall() function is called upon call failed status else the script will break, I mean it won't continue the calling of the list. I am just beginning to understand the ways with AutoIt and would require some enlightening if anyone will be kind enough.

This is my code :

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include "GUIListViewEx.au3"
#include "GUIListView.au3"
#include "onEventFunc.au3"

;// Create a Skype4COM object:
$oSkype = ObjCreate("Skype4COM.Skype")
$oSkypeEvent = ObjEvent($oSkype,"Skype_")
$oError = ObjEvent("AutoIt.Error","MyErrFunc")
;// 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")
;// Start the Skype client:
If Not $oSkype.Client.IsRunning Then
$oSkype.Client.Start()
EndIf
;// Verify that a user is signed in and online before continuing
While 1
If $oSkype.CurrentUserStatus = $oSkype.Convert.TextToUserStatus("ONLINE") Then
  ExitLoop
Else
  $oSkype.ChangeUserStatus($oSkype.Convert.TextToUserStatus("ONLINE"))
EndIf
Sleep(1000)
WEnd
;// 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 Then
$oSkype.ChangeUserStatus($cUserStatus_Online)
EndIf
#Region ### START Koda GUI section ### Form=
Opt("GUIOnEventMode", 1)        ; set to On event mode
;Opt("GUICoordMode", 2)
$Form1 = GUICreate("Cpoint - Skype Dialer v1.0", 615, 438, -1, -1, -1, 0x2000000)
;----- Make sure GUI exists BEFORE creating Tables -----
GUISetState()
$Label1 = GUICtrlCreateLabel("Introduceti numerele de telefon", 64, 24, 300, 28)
GUICtrlSetFont(-1, 15, 400, 0, "Trebouchet")
$Edit1 = GUICtrlCreateEdit("", 24, 64, 417, 297)
$Button1 = GUICtrlCreateButton("Call", 472, 160, 129, 81)
SetOnEventA(-1, "doCall", $paramByVal, 1)
 
$Label2 = GUICtrlCreateLabel("No operation started", 24, 392, 300, 24)
;GUICtrlSetOnEvent($Button1,"doCall")           ;  run NextClk if button is clicked
GUISetOnEvent($GUI_EVENT_CLOSE, "CloseClk")     ;  run CloseClk if form is closed
;GUISetState(@SW_LOCK)
#EndRegion ### END Koda GUI section ###
While 1
WEnd
Func CloseClk()
$answer = MsgBox(4, "Close software", "Do you really want to close the program ?")

; Check the user's answer to the prompt (see the help file for MsgBox return values)
; If "No" was clicked (7) then exit the script
If $answer = 6 Then
    Exit
EndIf
EndFunc
;// The AttachmentStatus event handler monitors attachment status and automatically attempts to reattach to the API following loss of connection:
Func Skype_AttachmentStatus($aStatus)
;MsgBox(0,"","Attachment status " & $oSkype.Convert.AttachmentStatusToText($aStatus))
If $aStatus = $cAttachmentStatus_Available Then
  $oSkype.Attach()
EndIf
EndFunc
;// If the call status is "failed", the CallStatus event handler returns the relevant failure reason as text:

Func MyErrFunc()
;Do Nothing
EndFunc

Func test()
;----- Table Example 4 -----
GUICtrlCreateLabel(" Example 4 ", 64, 24, 300, 28);, 24, 64, 417, 297
GUICtrlSetFont(-1, 15, 400, 0, "Trebouchet")
Global $iCount_Left = 1, $iCount_Right = 1, $vData
;If $hListView_Left > 0 Then
; Create Left ListView
$hListView_Left = GUICtrlCreateListView("Tom|Dick|Harry", 10, 60, 300, 300, $LVS_SHOWSELALWAYS)
_GUICtrlListView_SetExtendedListViewStyle($hListView_Left, $LVS_EX_FULLROWSELECT)
_GUICtrlListView_SetColumnWidth($hListView_Left, 0, 93)
_GUICtrlListView_SetColumnWidth($hListView_Left, 1, 93)
_GUICtrlListView_SetColumnWidth($hListView_Left, 2, 93)
; Create array and fill Left listview
Global $aLV_List_Left[$iCount_Left]
_GUICtrlListView_BeginUpdate($hListView_Left)
For $i = 0 To UBound($aLV_List_Left) - 1
    $aLV_List_Left[$i] = "Tom " & $i & "|Dick " & $i & "|Harry " & $i
    GUICtrlCreateListViewItem($aLV_List_Left[$i], $hListView_Left)
Next
; Initiate LVEx - no count parameter - default insert mark colour (black)
$iLV_Left_Index = _GUIListViewEx_Init($hListView_Left, $aLV_List_Left)
GUISetState()
; Set neither ListView as active
_GUIListViewEx_SetActive(1)
_GuiCtrlListView_EndUpdate($hListView_Left)
;EndIf
EndFunc
Func doCall($indexNumber)
;If IsDeclared($indexNumber) Then
; Else
; $indexNumber = "1"
; EndIf
MsgBox(0,"Number",$indexNumber)
$numbers = ControlGetText ($Form1,$Button1,$Edit1);
  If StringLen($numbers) < 1 Then
  ;MsgBox(0,"Eroare","Va rugam sa introduceti un numar de telefon")
  GUICtrlSetData ($Label2, "Va rugam sa introduceti un numar de telefon")
  Else
$numbersArray = StringSplit($numbers, ";");
For $i = $indexNumber to UBound($numbersArray)
    ;// Create a user object:
$oUser = $oSkype.User($numbersArray[$i])
;MsgBox(0,"","User " & $oUser.Handle & " online status is " & $oSkype.Convert.OnlineStatusToText($oUser.OnlineStatus))
;MsgBox(0,"",$oSkype.Convert.TextToCallStatus("INPROGRESS"))
;// Place a call:
$oCall = $oSkype.PlaceCall($oUser.Handle)
;// Wait until the call is in progress and return the relevant error if any other status occurs:
While $oCall.Status <> $cCallStatus_Finished
If $oCall.Status = $cCallStatus_Failed Or _
    $oCall.Status = $cCallStatus_Refused Or _
    $oCall.Status = $cCallStatus_Cancelled Or _
$oCall.Status = $cCallStatus_Ringing Or _
    $oCall.Status = $cCallStatus_Busy Then
  GUICtrlSetData ($Label2, "Call status: " & $oSkype.Convert.CallStatusToText($oCall.Status))
EndIf
If $oCall.Status = $cCallStatus_Failed Then
  GUICtrlSetData ($Label2, "Call status: " & $oSkype.Convert.CallStatusToText($oCall.Status))
  If $i >= UBound($numbersArray) Then
   ExitLoop
  Else
   doCall($i+1)
   EndIf
EndIf
If $oCall.Status = $cCallStatus_Finished Then
  GUICtrlSetData ($Label2, "Call status: " & $oSkype.Convert.CallStatusToText($oCall.Status))
  If $i >= UBound($numbersArray) Then
   ExitLoop
   EndIf
EndIf
Sleep(500)
WEnd
If $oCall.Status = $cCallStatus_Finished Then
  GUICtrlSetData ($Label2, "Call status: " & $oSkype.Convert.CallStatusToText($oCall.Status))
  If $i >= UBound($numbersArray) Then
   Exit
   EndIf
EndIf
;// Finish the call:
Sleep(3000)
Next
EndIf
EndFunc
Edited by prema
Link to comment
Share on other sites

  • 1 year later...

Hi all,

I have gone through the web, but haven't found any utilty using Skipe4COm or whateverCOm ,DLL, APP possible to

help for this issue.

I often use multiple calls (conference) , and pretty often the effort of a speaker is vanished by the environmental noise

produced by the others attendant to the call. I need to have a way to MUTE one or ALL the attendants.

I mean NOT to mute on their client side (I understand that is not possible and out of Skipe scope ...), but on MY side, on my client side, does exist a solution to MUTE one or more attendant and at the same time let them listen to the conference ?

I know I could HOLD the call, but that stops completly the conference with them ... rather then stopping their incoming audio ...

I would like something NOT intrusive, a sort of sw filter on my Skipe Client side...

None can help ??

ciao

angelo55

Link to comment
Share on other sites

The Skype software doesn't have the capability to allow you to mute one participant on your machine, so there's no way you can do it in software that I'm aware of.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

@Angelo55

Unfortunately, this is NOT possible. Tell them to buy a new microphone, or to mute themselves when it's needed.

Edit : oh wait, maybe by blocking their packets this would work... who knows?

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Hi ,

... yes, the easyest solution should be 'use carefully' your Mike ! ... but most of them are old people and do not use a PC !.. just a standard

Phone ! So my request was intended to block their incoming packets selectivly, in order to avoid useless noise on my side.

Actually I act as a Manager of a conference call, without actually muting their side : simply I do not want to get their noise into my input line ..

I guess this is a mjor issue for many skipe users, and I bet somebody should have found a solution for this ...

No idea guys ??

ciao !

angelo55

Link to comment
Share on other sites

  • 5 months later...

Hallo Firefox,

thanks for your mighty Skype UDF. I am playing an online game and want to send automatically a message for example "Alarm! X has 9999 points" to an already existing conversationgroup "conversationgroupABC", if this certain event will happen. Skype is already running all the time. So the script doesn't need a login. I need an example script for sending a message to certain conversationgroup and using a skype, which is already running. The other part (listening for an event) is no problem for me. Please answer me soon. Thanks in advance .... Johannes from Germany

P.s.Does already a helpfile exists?

Edited by jlorenz1

Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...