Reputation: 63
I have been browsing Skype dev API's for sometime and want to know if there is a way via which I can know if skype is having a active call running via some API.
Skype.Client.IsRunning tells if the Skype app itself is running or not and there are several other apis to know different things like, call history etc etc but I couldn't find a way to know if there is skype call active currently.
any help would be greatly appreciated.
Upvotes: 5
Views: 2284
Reputation:
Another option is to use skype commands: http://dev.skype.com/desktop-api-reference#OBJECT_CALL
Upvotes: 1
Reputation: 4215
since you have not specified in which language you are trying to acomplish that I'm posting a sample in C#:
using System;
using System.Windows.Forms;
using SKYPE4COMLib;
namespace SkypeTest
{
public partial class Form1 : Form
{
private ISkype _skype;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
_skype = new SkypeClass();
var events = (_ISkypeEvents_Event) _skype;
events.CallStatus += (call, status) =>
{
System.Diagnostics.Debug.WriteLine(call.PartnerHandle);
Action<object, object> a = (partner, sta) =>
{
textBox1.Text = partner.ToString() + " " + sta.ToString();
};
textBox1.Invoke(a, call.PartnerDisplayName, status.ToString());
};
_skype.Attach();
}
}
}
Note that this code did not include any clean up / error handling.
Hope this helps.
Upvotes: 1
Reputation: 83758
Here is an example how to check the active call in Sevabot which uses Skype4Py
Basically you listen to call events and capture start and end call events and do your own book keeping if the call is active.
Upvotes: 0