Jump to content

Recommended Posts

Posted

Hey,

I want to make a application which calls a User and returns the error / status of the call. I don't think it works, the status stays "routing". Not 100% sure what that means for me.

$oSkype = ObjCreate("Skype4COM.Skype")
$oUser = $oSkype.User("User")
$oSkypeEvent = ObjEvent($oSkype,"Skype_")
$oError = ObjEvent("AutoIt.Error","MyErrFunc")
$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")

If Not $oSkype.Client.IsRunning Then
    $oSkype.Client.Start()
 EndIf

 Func Skype_AttachmentStatus($aStatus)
    MsgBox(0,"","Attachment status " & $oSkype.Convert.AttachmentStatusToText($aStatus))
    If $aStatus = $oSkype.Convert.TextToAttachmentStatus("AVAILABLE") Then
        $oSkype.Attach()
    EndIf
 EndFunc

While 1
    If $oSkype.CurrentUserStatus = $oSkype.Convert.TextToUserStatus("ONLINE") Then
        ExitLoop
    Else
        $oSkype.ChangeUserStatus($oSkype.Convert.TextToUserStatus("ONLINE"))
    EndIf
    Sleep(1000)
 WEnd

 If $cUserStatus_Offline = $oSkype.CurrentUserStatus Then
    $oSkype.ChangeUserStatus($cUserStatus_Online)
 EndIf

   $oCall = $oSkype.PlaceCall($oUser.Handle); Start Call
   $callstatusraw = $oCall.Status;Raw Call Status
   $callstatus = $oSkype.Convert.CallStatusToText($callstatusraw);Call Status converted to Text
   While $callstatusraw <> $cCallStatus_Inprogress
     MsgBox(0, "", ""&$callstatus);Displays the Call Status
  WEnd

The part until the $oCall Variable is from Andy Flesner (Airwolf123). But works fine.

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
×
×
  • Create New...