ASP.NET - Skype API Use in asp.net

Asked By hvm on 18-Jul-11 04:06 AM
Hi All,
i am developing one chat application in asp.net using SKYPE API.

now i want all functionality implement in java script.
1) Add contacts from my custom page in skype
2) Chat (same as skype) service
3) Call
4) Video
5) Voice Email
all functionality i have to cover in my custom application.
i use Skype4Com API DLL in my custom application.

Please help me to solve this..

Thanks,
hvm
Asked By hvm on 18-Jul-11 04:24 AM
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Skype</title>
    <script language="Javascript" type="text/Javascript">
      var oCall;
      var oChat;
      var oFullname;
      var oSkypeName;
      var oBirthDate;
      var oHomepage;
      var oAbout;
      var oUsers;
      function init() {
        if (!Skype.Client.IsRunning)
          Skype.Client.Start();
        Skype.Attach(false);
        LoadContact();
      }

      function LoadContact() {
        Skype.Client.Minimize();
        // Insert cells into the header row.

        // get the reference for the body
        var mybody = document.getElementsByTagName("body")[0];

        // creates <table> and <tbody> elements
        mytable = document.createElement("table");
        mytablebody = document.createElement("tbody")

        // creating all cells
        for (var j = 0; j < Skype.Friends.Count - 1; j++) {
          // creates a <tr> element
          var oFriend = Skype.Friends.Item(j + 1);
          oFullname = oFriend.Fullname;
          oSkypeName = oFriend.Handle;
          oBirthDate = oFriend.Birthday;
          oHomepage = oFriend.Homepage;
          oAbout = oFriend.About;
          mycurrent_row = document.createElement("tr");

          for (var i = 0; i <= 3; i++) {
            // creates a <td> element
            mycurrent_cell = document.createElement("td");
            // creates a Text Node

            if (i == 0) {
              currenttext = document.createTextNode(oFullname);
              // appends the Text Node we created into the cell <td>
            }
            else if (i == 1) {

              currenttext = document.createTextNode(oSkypeName);
            }
            else if (i == 2) {
              currenttext = document.createTextNode(oHomepage);
            }
            else if (i == 3) {
              currenttext = document.createTextNode(oAbout);
            }
            mycurrent_cell.appendChild(currenttext);
            // appends the cell <td> into the row <tr>
            mycurrent_row.appendChild(mycurrent_cell);
          }
          // appends the row <tr> into <tbody>
          mytablebody.appendChild(mycurrent_row);
        }

        // appends <tbody> into <table>
        mytable.appendChild(mytablebody);
        // appends <table> into <body>
        mybody.appendChild(mytable);
        // sets the border attribute of mytable to 2;
        mytable.setAttribute("border", "1");
      }
      function CallContact() {
        var callTo = document.getElementById('callTo').value;
        oCall = Skype.PlaceCall(callTo);
      }
    </script>
    <style type="text/css">
      #Skype
      {
        height: 2px;
        width: 1px;
      }
      #callTo
      {
        width: 174px;
      }
      #SendButton
      {
        width: 46px;
      }
    </style>
</head>
<body onload="init()">
    <object id="Skype" name="Skype" align="baseline" border="0" classid="CLSID:830690FC-BF2F-47A6-AC2D-330BCB402664"
      codebase="http://localhost:19822/Skype4COM.dll">
      <span class="c1">Failed to load Skype4COM control.</span>
    </object>
    <form name="formu_call" action="#" method="POST">
    Call to:
    <input type="text" name="callTo" id="callTo" size="35" />
    <input name="SendButton" id="SendButton" type="button" onclick="CallContact()" value="Call" /><br />   
    </form>
</body>
</html>

this is my code in that i implement calling functionality from my custom page using Skype
now i want chatting, video, SMS same like my example..
my client don't want .cs file code he just want to put code in javascript or Jquery or Json...

Please help me in this way....
dipa ahuja replied to hvm on 18-Jul-11 04:31 AM

Skype Public API Reference

Full reference for the Skype Public API is available in a zipped web site, which you can download and open.

·     Download the https://developer.skype.com/resources/public_api_ref.zip (zip archive)

Tracer: A Command-Line Implementation

Tracer is a Windows (.exe) console-based application that lets you issue text-based Skype Public API commands to a running Skype client.

·     Download https://developer.skype.com/resources/Tracer.exe

 

You can ask questions and share tips about the Public API in the http://forum.skype.com/index.php?showforum=16.

 

https://developer.skype.com/

 sample : 

http://www.codeproject.com/KB/aspnet/SkypeSample.aspx

 

Jitendra Faye replied to hvm on 18-Jul-11 04:39 AM

It is probably easiest to download and install the Skype API https://developer.skype.com/Download.

Then you can simply add a reference to this wrapper from the COM tab of the Add References dialog in your Visual Studio project.

Below is a short sample program illustrating how to search for a user and how to send a message:

using System;
using SKYPE4COMLib;
class Program
{
    static void Main(string[] args)
    {
        Skype skype = new Skype();
        if (!skype.Client.IsRunning)
        {
            // start minimized with no splash screen
            skype.Client.Start(true, true);
        }
        // wait for the client to be connected and ready
        skype.Attach(6, true);
        // access skype objects
        Console.WriteLine("Missed message count: {0}", skype.MissedMessages.Count);
        // do some stuff
        Console.WriteLine("Enter a skype name to search for: ");
        string username = Console.ReadLine();
        foreach (User user in skype.SearchForUsers(username))
        {
            Console.WriteLine(user.FullName);
        }
        Console.WriteLine("Say hello to: ");
        username = Console.ReadLine();
        skype.SendMessage(username, "Hello World");
    }
}

Hope this will help you.
hvm replied to Jitendra Faye on 18-Jul-11 04:45 AM
Hi,
thanks for reply guys...
but i want code in javascript not server side code...

Thanks,
Hetal
Jitendra Faye replied to hvm on 18-Jul-11 05:32 AM
Ok, for javascript-

There is a product called SkypeX (for Windows) that can be used to access Skype API from IE Javascript, or you can just write the Javascript script and run it using the WSH (Windows Scripting Host).
The SkypeX activex has to be installed on the end user system to be able to access Skype API.

http://www.beesync.com/skypex

Follow this link-

http://forum.skype.com/index.php?showtopic=38656

Hope this will help you.
hvm replied to Jitendra Faye on 18-Jul-11 05:54 AM
http://www.beesync.com/skypex
not work page not open..


Thanks,
Hetal
hvm replied to Jitendra Faye on 18-Jul-11 06:35 AM
Hi Vickey,

Not get Javascript code help from net...

so please provide me sample site or code same functionality in skype chatting and calling..

its ok if windows application or console application available

Thanks,
hetal