Talk with others about developing applications for Switchvox
Moderators: bmdhacks, dpodolsky, tristand, jwitt, joshuas
by sab1 » Wed May 09, 2012 6:10 pm
Do you have any examples on how to do the below via my C# WindowsForms APP ?
1. User hits “Call Supplier” button on computer
2. Automatic send some type of command like
“phoneMACAddress(or phoneExtension)+suppliersNumber(from TextBox1) +….”
so user does not have to manually type phone number
when calling via a Digium D70 phone
-
sab1
- Newsterisk
-
- Posts: 5
- Joined: Wed May 09, 2012 6:06 pm
-
by sab1 » Thu May 10, 2012 8:42 am
Can you post some sample C# code ?
-
sab1
- Newsterisk
-
- Posts: 5
- Joined: Wed May 09, 2012 6:06 pm
-
by mrjones73 » Thu May 10, 2012 11:28 am
Here is some VB.NET code I am using successfully.
- Code: Select all
Friend Function CertificateValidationCallBack( _
ByVal sender As Object, _
ByVal certificate As System.Security.Cryptography.X509Certificates.X509Certificate, _
ByVal chain As System.Security.Cryptography.X509Certificates.X509Chain, _
ByVal sslPolicyErrors As Net.Security.SslPolicyErrors) As Boolean
Return True
End Function
Net.ServicePointManager.ServerCertificateValidationCallback = New Net.Security.RemoteCertificateValidationCallback(AddressOf CertificateValidationCallBack)
Friend Function SwitchVoxAPICall(ByVal XML_Request As String) As String
Dim XML_Response As String = ""
Try
Dim req As System.Net.WebRequest
req = System.Net.WebRequest.Create(MainForm.SwitchvoxURI)
Dim myCred As New System.Net.NetworkCredential(MainForm.SwitchvoxUserName, MainForm.SwitchvoxPassword)
req.Credentials = myCred
req.Method = "POST"
Dim lbPostBuffer As Char() = XML_Request.ToArray()
req.ContentLength = lbPostBuffer.Length
req.Timeout = 10000
req.ContentType = "application/xml"
Dim writer As New System.IO.StreamWriter(req.GetRequestStream())
writer.Write(lbPostBuffer, 0, lbPostBuffer.Length)
writer.Close()
Dim rsp As WebResponse = req.GetResponse
Dim reader As New System.IO.StreamReader(rsp.GetResponseStream)
XML_Response = reader.ReadToEnd()
reader.Close()
rsp.Close()
Return XML_Response
Catch ex As Exception
Return XML_Response
End Try
-
mrjones73
- Newsterisk
-
- Posts: 1
- Joined: Thu May 10, 2012 11:20 am
-
by sab1 » Fri May 11, 2012 1:05 pm
Thanks
Do you have the user login with their current SwitchVox password ?
If not, how do it get their CURRENT SwitchVox password ?
-
sab1
- Newsterisk
-
- Posts: 5
- Joined: Wed May 09, 2012 6:06 pm
-
Return to Switchvox Developers
Who is online
Users browsing this forum: No registered users and 2 guests