Φεβρουάριος 2010 - Δημοσιεύσεις

Creating a Skype add-on using .NET - Part 1

Skype provides pretty rich API for us developers to create add-ons that can customize it's behaviour. There are a number of ways to use this API and access Skype functionality programmatically. Skype4COM is one of these ways and is the recommended one if you want to create your add-on using .NET. Skype4COM is a wrapper dll that provides Skype functionality into the COM world, therefore also to the .NET world, since .NET can use COM dll libraries.

Skype4COM.dll is located into the Program Files\Common\Skype folder (or Program Files (x86)\Common\Skype in case of x64 version of Windows). It is installed (and registered) there if you install Skype with Extras enabled (this is an option of one of the steps of Skype installation). Once done, you can add a reference to it from your .NET project. Simply right click on your project in the Visual Studio solution explorer, select Add Reference and then click on the COM tab. Skype4COM should be in the list populated there.

Example
Here is a simple (self descriptive) example of accessing Skype functionality from your C# code:

SkypeClass skype = new SkypeClass();
Debug.WriteLine(skype.Friends.Count);

Note that once new SkypeClass() is executed, Skype will warn the end-user that some process is trying to access it. End-user must allow your process to access Skype, else you will get an exception.

x64 operating systems!
Here is something you should take care of! I missed this step and in the beginning and spend quite some time figuring out why SkypeClass fails to be initialized! Since Skype4COM is a x86 (a.k.a. 32 bit) library, your add-in should also be x86 in order to be able to use it. In order to configure your project to produce a x86 executable you need to use the configuration manager of Visual Studio. Click on Build menu and then Configuration Manager. In Active solution platform drop down list, select <New>... and on the dialog that opens select x86 as platform. If you miss performing this steps you will notice the problem only on machines with x64 operating system. If operating system is x86, your .NET executable will run as x86 process anyway so it will succeed in instantiating Skype4COM dll.

Resources
Skype4COM Reference (all things you can do with Skype4COM)
Examples (a number of useful examples in many languages)
Forums (unfortunately you will not find prompt help there. most of the threads remain unanswered for days)

Permalink | Leave a comment  »

Comparison of issue tracking systems

Couple of years ago Sotiris Fillippidis - friend of mine and author of famous Zaharias Dentoftiahno tales - initiated a table of existing issue tracking systems to compare their features. Here is his blog post.

Today I came accross something similar in Wikipedia. It's a list of about 40 or more issue tracking systems. Take a look...

Permalink | Leave a comment  »

Overriding a small problem with Net.Tcp Port Sharing service and Visual Studio 2010 RC

I installed Visual Studio 2010 RC a couple of days after it became available, after uninstalling the previous installed beta 2. Today I discovered a small problem with Net.Tcp Port Sharing service. The status of the Windows Services console was the one show in the attached screen shot. It appears that the installation didn't update the service and it was still registered with executable that was in the previous version of .NET 4 (beta 2). So when trying to start the service I was getting a File not found error in Windows Event log.

I'm not sure if this was a problem of installation of RC or uninstallation of beta 2. Anyway, fixing the problem was easy. I downloaded .NET Framework 4 RC and executed it with the Repair option selected.

Permalink | Leave a comment  »

Windows Authentication in WCF Services

Click here to download:
WindowsAuthenticationTest.zip (17 KB)

There aren't may things one has to do to enable windows authentication in a WCF service. Actually Windows Authentication is by default enabled when using most of the standard bindings of WCF.

Configuration
The following configuration ensures this anyway (use this configuration both on server and on client side):

  <system.serviceModel>
      <bindings>
          <wsHttpBinding>
              <binding name="test">
                  <security mode="Message">
                      <message clientCredentialType="Windows"/>
                  </security>
              </binding>
          </wsHttpBinding>
      </bindings>
      ...

Server
To get the credentials of the user on server side using the following (password in never included):
var identity = OperationContext.Current.ServiceSecurityContext.PrimaryIdentity;

Client
On client you have two options:
a) Do not ask credentials from the user (Integrated Authentication): The credentials of the current logged on user will be used. This requires that the user is logged on to a Windows Domain that is trusted or is the same with the Domain of the server. There is no special code to write here. Simple instantiate the client proxy and use it.
b) Ask for Windows Credentials from the user: This is useful when you expect that your application will be used by users using machines not registered to known Windows Domains. In this case you have to create a typical log in dialog and ask for user name and password. Username must contain the domain name (Eg. MYDOMAIN\myUserName). Also this requires that the username and password the user will use belong to a domain that is trusted or is the same with the Domain of the server. In this case you also need to write the following line after instantiating your client proxy, and use the credentials you collected from the log in dialog:
clientProxy.ClientCredentials.Windows.ClientCredential = new NetworkCredential("MYDOMAIN\\myUsername", "myPassword");

Important
Patterns and Practices team created an excellent pdf document called 'WCF Security Guidance'. This is a quite big document that describes perhaps all the security scenarios that you might consider. It is organized in such a way that you can find what you are looking for quickly. Check it out!

Permalink | Leave a comment  »

5 simple (non state of the art) features that make Skype so easy to use

I have been using Skype intensively for some months now, to make both personal and professional voice and video calls. Put aside the superb quality of voice and video (which I've seen also in other solutions like Live Messenger), I noticed some very simple, yet extremely useful features that differentiate it from the competition:
  1. Incoming call notification on all speakers: This means that you can have your headphones pluged in so that you can use them to communicate, but still hear the incoming call notifications when you are not wearing them! (see 1st picture)
  2. Order of preference for sound devices: This is very useful if you are using a laptop and your sound equipement changes frequently. You can specify which device (speakers/microphone) will be used for communication. If not found the next available will be used etc. So if you want to use the microphone of your external camera at work but the integrated microphone of your laptop when you are on the move, you don't have to get into the options page every time. You specify this once and you are done (see 2nd picture).
  3. Mute is canceled when you answer or start a call: Often when you are about to make or answer a call you may forget that you muted your speakers just a while ago. This can also happen to the other participant, especially if he/she is not very comfortable with this way of communication. Skype takes initiative and enables your speakers when a call is started. It's obvious that since you started or answered a call you want to use them! When call is completed speakers are muted again.
  4. Auto answer call: Enable this feature and Skype can be used as a remote surveilance system (see 3rd picture).
  5. Echo / Sound Test Service: A very simple idea that helps you identify microphone, speakers and bandwidth problems. Echo user is a virtual user always present in your contact list. Call this user and see if and how other users hear you.
It seems that web conferencing and remote collaboration will become daily activity of mine in the near future. So stay tuned for more details about this experience.

See and download the full gallery on posterous

Permalink | Leave a comment  »