Script Library: 1215 scripts


REBOL [ Title: "Skype Wrapper" Author: "Graham Chiu" Company: "" Date: 23-May-2006 File: %skype.r Purpose: "make a cheap phone call!" Library: [ level: 'intermediate platform: 'windows type: [demo module] domain: [external-library ] tested-under: license: 'MIT support: none see-also: none needs: { Rebol/Pro or /Command Benjamin's comlib.r Skype Com documentation is here } ] ] do %comlib.r initDipsHelper 1 ; Create a Skype4COM object oSkype: createObject "Skype4COM.Skype" ; Start the Skype client if zero? getNumber oSkype "Client.IsRunning" make string! copy "" [ objectMethod oSkype "Client.Start()" ] ; Declare the following Skype constants cUserStatus_Offline: getNumber oSkype ".Convert.TextToUserStatus(%s)" "Offline" cUserStatus_Online: getNumber oSkype ".Convert.TextToUserStatus(%s)" "ONLINE" cCallStatus_Ringing: getNumber oSkype ".Convert.TextToCallStatus(%s)" "RINGING" cCallStatus_Inprogress: getNumber oSkype ".Convert.TextToCallStatus(%s)" "INPROGRESS" cCallStatus_Failed: getNumber oSkype ".Convert.TextToCallStatus(%s)" "FAILED" cCallStatus_Refused: getNumber oSkype ".Convert.TextToCallStatus(%s)" "REFUSED" cCallStatus_Cancelled: getNumber oSkype ".Convert.TextToCallStatus(%s)" "CANCELLED" cCallStatus_Finished: getNumber oSkype ".Convert.TextToCallStatus(%s)" "FINISHED" cCallStatus_Busy: getNumber oSkype ".Convert.TextToCallStatus(%s)" "BUSY" cAttachmentStatus_Available: getNumber oSkype ".Convert.TextToAttachmentStatus(%s)" "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 = getNumber oSkype "CurrentUserStatus" make string! copy "" [ ObjectMethod oSkype "ChangeUserStatus(%d)" cUserStatus_Online ] ; Create a user object: oUser: retrieveObject oSkype ".User(%s)" "echo123" ; << user you want to call! Handle: getText oUser ".Handle" "" ; dial away oCall: retrieveObject oSkype ".PlaceCall(%s)" Handle
halt ;; to terminate script if DO'ne from webpage
<< skimp.r · slice.r >>