Switchvox 5.5 -- C# WindowsForms APP ?

Talk with others about developing applications for Switchvox

Moderators: bmdhacks, dpodolsky, tristand, jwitt, joshuas

Switchvox 5.5 -- C# WindowsForms APP ?

Postby 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

Re: Switchvox 5.5 -- C# WindowsForms APP ?

Postby ricmarques » Wed May 09, 2012 7:02 pm

The Call Creation API is what you're looking for...

Here's a link to the wiki page: http://developers.digium.com/switchvox/ ... n_overview
Ric Marques
Team One Networking, Digium Select Reseller
Roseville, CA
http://www.teamonenetworking.com
ricmarques
Newsterisk
 
Posts: 49
Joined: Wed Jan 05, 2011 6:22 pm
Location: Roseville, CA

Re: Switchvox 5.5 -- C# WindowsForms APP ?

Postby 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

Re: Switchvox 5.5 -- C# WindowsForms APP ?

Postby 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

Re: Switchvox 5.5 -- C# WindowsForms APP ?

Postby 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