1

I am working on a WPF application and I wish to open sip:Username@company.com links. I am able to open mailto links using the following code:

private void btnSendEmail_Click(object sender, RoutedEventArgs e)
{
    try
    {
        string mailURL = String.Format("mailto:{0}", UserDetails.EmailAddress);
        Process.Start(mailURL);
        Close();
    }
    catch
    {
        // Handle exception
    }
}

Although, I am unable to open sip: links in a similar way. What I am trying to achieve is to open a new chat session with a user, like I am able to do when I follow sip: links from Outlook.

Any ideas?

Edit: I ended up using the CommunicatorAPI. Messenger.InstantMessage() seems to work for me. More info here: http://msdn.microsoft.com/en-us/library/bb787232.aspx

Sayak Banerjee
  • 1,954
  • 3
  • 25
  • 58
  • Good to see that you got it working. Since you managed to solve your problem, you should post your solution as an answer instead of editing so we can upvote and recognize it as solved. – Justin Jan 24 '12 at 12:42

5 Answers5

1

Using Process.Start works fine on my system (with Microsoft Lync 2010, a newer version of Communicator):

void Main()
{
    Process.Start("sip:username@company.com");
}

Running the above code results in a new chat window opening. The only exception is when I enter my own user name, in which it starts composing a new Outlook e-mail message to myself. What happens when you use this (maybe also try omitting the following call to Close).

Justin
  • 6,611
  • 3
  • 36
  • 57
0

The following code probably didn't work for you because you were trying to IM yourself.

Process.Start("sip:username@company.com");
flip66
  • 341
  • 2
  • 5
  • 17
0

You probably need to associate a program with the "sip" uri scheme. Try this: how do I create my own URL protocol? (e.g. so://...)

Community
  • 1
  • 1
plmaheu
  • 475
  • 5
  • 12
  • that won't help the OP since he doesn't want to implement a uri handler BUT he wants just to use the existing `sip:` handler! – Yahia Jan 23 '12 at 20:12
  • Maybe that's the problem: no "sip:" handler. That's what I wanted him to validate. – plmaheu Jan 24 '12 at 14:43
  • Perhaps, but it will still be a problem on other computers in my office network that will use this code. Unfortunately, most of them wont have admin access and therefore, no access to registry. – Sayak Banerjee Jan 25 '12 at 05:07
0

if you have Lync or Office Communicator installed, they should respond appropriately to the sip: uri scheme. Also, tel:, callto: etc. For reference, the full list is here.

Is this not working for you from a WPF app? Does it work for you from a basic html page?

Paul Nearney
  • 6,965
  • 2
  • 30
  • 37
0

I ended up using the CommunicatorAPI. Messenger.InstantMessage() seems to work for me. More info here: http://msdn.microsoft.com/en-us/library/bb787232.aspx

Sayak Banerjee
  • 1,954
  • 3
  • 25
  • 58