Register incomming Skype calls with ActiveS in C# .NET

Description of the problem – register incomming Skype calls

Skype allows you to register for incomming calls – you can decide if you wanna take the call or not. ActiveS is a wrapper that allows you to control Skype through an easy API.

Solution: register incomming Skype calls ( C# and .NET )

The solution for Visual Basic is similar.

try {
// initialize Skype / ActiveS
ConversionClass m_objConversion = new ConversionClass();
AccessClass m_objAccess = new AccessClass();
// register event handler that listens on status changes of calls
m_objAccess.CallStatusChanged += new _IAccessEvents_CallStatusChangedEventHandler(Skype_CallStatusChanged);
// connect to Skype
m_objAccess.Connect();
} catch (Exception e) {
Console.WriteLine(e.Message);
}

// our event handler
void Skype_CallStatusChanged(SKYPEAPILib.Call call, SKYPEAPILib.SkypeCallProgress callProgress)
{
if (callProgress.Equals(SKYPEAPILib.SkypeCallProgress.prgRinging) && call.Type.Equals(SkypeCallType.ctypIncomingP2P))
{
// display message box to ask user
MessageBox.Show("Do you wanna take that call from " + call.PartnerDisplayName + "?",
"Incomming Skype-call from " + call.PartnerDisplayName,
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);

// if user answered no, hang up call
if(res.Equals(DialogResult.No))
{
call.Status = SKYPEAPILib.SkypeCallProgress.prgFinished;
}
else
{
call.Status = SKYPEAPILib.SkypeCallProgress.prgInProgress;
}
}
}

Hang up a Skype call with C#

Description of the problem: hang up a call with Skype

If you’re using ActiveS to control Skype, it’s easy. If not, you should check if you can migrate to ActiveS – which is really recommended!

Solution – hang up the call

Assuming that the current Call object is called call, you can hang up a call with just changing the status to prgFinished.

call.Status = SKYPEAPILib.SkypeCallProgress.prgFinished;

You can get this Call object with placing an outgoing call (AccessClass.PlaceCall(string username)), taking a call for a call id (AccessClass.GetCall(int callId)) or walking through the list of calls (AccessClass.GetCallList(), returns a list of Call objects).

See also register incomming Skype calls with ActiveS in C#

Skype & C# / .Net

Controlling Skype with a .NET language is easy:

Please note: the following content is partially outdated and only available for historic reasons.

  • Download the ActiveS library here and install it

Using Skype API wrapper ActiveS [outdated]

More Skype knowledge – html based

Add Skype functionality to a html page

More ressources