Application Development
2 - 43
</body>
</html>
2. Using Microsoft Visual Studio, create a file called webcallback.aspx.cs.
using System;
using System.IO;
using System.Text;
using System.Data;
using System.Configuration;
using System.Net;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Threading;
public partial class WebCallback : System.Web.UI.Page
{
public static ManualResetEvent allDone = new
ManualResetEvent(false);
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
String phoneNum = BoxNumber.Text ;
String name = BoxName.Text;
//send a push request to the phone with the IP address
callbackReq("172.18.103.32", phoneNum, name);
}
private void callbackReq(String phoneIP, String phoneNum, String
name)
{
String strLoc = "http://" + phoneIP + "/push";
String[] cred = { "Polycom", "456" };
NetworkCredential myCred = new NetworkCredential(cred[0],
cred[1]);
CredentialCache myCache = new CredentialCache();
myCache.Add(new Uri(strLoc), "Digest", myCred);