I am trying to make calls through Skype API in C#. I can only open Skype but I am not able to make calls. I am looking for some suggestions to solve the issue.
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.");
}
}
public void call(string number)
{
new WebBrowser().Navigate("skype:" + number + "?call");
}
It's the XML code I use:
<Users>
<User>
<Name>Mike</Name>
<Number>1234</Number>
</User>
</Users>
Here's the Skype page after I run the code.
Any hint? Thanks in advance.