Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to make calls through Skype API in C#. I can only open Skype but I'm not able to make calls. I'm looking for some suggestions to solve the issue.

C#
public void makecall()
    {
        string PhoneName = Mike;
        string MyXMLFilePath = AppDomain.CurrentDomain.BaseDirectory + @"Database\ContactsData.xml";
        XmlDocument MyXmlDoc = new XmlDocument();
        MyXmlDoc.Load(MyXMLFilePath);
        XmlNode RootNode = MyXmlDoc.SelectSingleNode("Users");
        XmlNodeList FirstLevelNodeList = RootNode.ChildNodes;
        foreach (XmlNode Node in FirstLevelNodeList)
        {
            XmlNode SecondLevelNode1 = Node.FirstChild;
            if (SecondLevelNode1.InnerText == PhoneName)
            {
                XmlNode SecondLevelNode2 = Node.ChildNodes[1];
                PhoneNumber = SecondLevelNode2.InnerText;
            }
        }
        if (PhoneNumber != null)
        {
            Call(PhoneNumber);
        }
        else
        {
            MessageBox.Show("Phone number is not available.");
        }
    }
    pubic void Call(string number)
    {
        new WebBrowser().Navigate("skype:" + number + "?call");
    }

It's the XML code I use:

HTML
<Users>
      <User>
        <Name>Mike</Name>
        <Number>1234</Number>
      </User>
    </Users>


What I have tried:

C#
pubic void Call(string number)
{
    Call call = skype.PlaceCall(number);
    //new WebBrowser().Navigate("skype:" + number + "?call");
}


But it says "An handled exception of type 'System.Runtime.Interopservices.COMException'occured in mscorlib.dll."
Additional information: Not online

Since it says it's not oneline, then I try to Skype call via Skype API and it is able to make call.
So I'm confused.
Any suggestion?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900