protected void TextBox1_TextChanged(object sender, EventArgs e) { SipConnector sip = new SipConnector(Session["sipIP"].ToString(), Session["sipPORT"].ToString(), Session["sipUSERNAME"].ToString(), Session["sipPASSWORD"].ToString(), Convert.ToInt32(Session["sipEXTRA_NUMBER"])); txtBarcode.Visible = false; if (sip.authorizeBarcode(txtBarcode.Text)) assignComputer(); else lblScan.Text = "Invalid Barcode! Please see a librarian for assistance!"; txtBarcode.Text = String.Empty; }
protected void btnTest_Click(object sender, EventArgs e) { string ip = txtIP1.Text + "." + txtIP2.Text + "." + txtIP3.Text + "." + txtIP4.Text; try { using (SipConnector sip = new SipConnector(ip, txtPort.Text, txtUsername.Text, txtPassword.Text, Convert.ToInt32(txtExtra_Number.Text))) { if (sip.startConnection().Contains("941")) { ClientScript.RegisterStartupScript(Form.GetType(), "AlertScript", "alert('SIP test successful!');", true); } else { ClientScript.RegisterStartupScript(Form.GetType(), "AlertScript", "alert('SIP connection failed!');", true); } } } catch (Exception) { ClientScript.RegisterStartupScript(Form.GetType(), "AlertScript", "alert('SIP connection failed!');", true); } }