How to connect Cisco webdialer service using VB.NET

[ArgumentNullException: Value cannot be null. Parameter name: user]
aprile 15, 2014
Show all

How to connect Cisco webdialer service using VB.NET

CISCO webdialer VB.NET

Un cliente doveva interfacciare il centralino CISCO per avviare delle chiamate telefoniche da una appliazione scritta in il linguaggio Microsoft vb.net.

Abbiamo così mappato il webservice del centralino:

https://ipCentralino:8443/webdialer/services/WebdialerSoapService

Abbiamo poi scritto i due metodi per avviare una nuova chiamata ed interromperne una in corso:

<br />
    Public Function MakeCall(ByVal userId As String, ByVal password As String, ByVal phoneToCall As String) As String<br />
        ByPassCertificate()<br />
        Dim service As New CiscoService.WebdialerSoapServiceClient</p>
<p>        Dim cred As New CiscoService.Credential<br />
        cred.userID = userId<br />
        cred.password = password</p>
<p>        phoneToCall = phoneToCall</p>
<p>        Dim profList = service.getProfileSoap(cred, userId)<br />
        Dim prof As New CiscoService.UserProfile<br />
        prof.user = userId<br />
        prof.lineNumber = &amp;amp;quot;?&amp;amp;quot;<br />
        prof.deviceName = profList.deviceInfoList(0).deviceName<br />
        prof.supportEM = False<br />
        prof.locale = &amp;amp;quot;?&amp;amp;quot;<br />
        Dim response = service.makeCallSoap(cred, phoneToCall, prof)</p>
<p>        Return response.ToString()<br />
    End Function</p>
<p>    Public Function EndCall(ByVal userId As String, ByVal password As String) As String<br />
        ByPassCertificate()<br />
        Dim service As New CiscoService.WebdialerSoapServiceClient</p>
<p>        Dim cred As New CiscoService.Credential<br />
        cred.userID = userId<br />
        cred.password = password</p>
<p>        Dim profList = service.getProfileSoap(cred, userId)<br />
        Dim prof As New CiscoService.UserProfile<br />
        prof.user = userId<br />
        prof.lineNumber = &amp;amp;quot;?&amp;amp;quot;<br />
        prof.deviceName = profList.deviceInfoList(0).deviceName<br />
        prof.supportEM = False<br />
        prof.locale = &amp;amp;quot;?&amp;amp;quot;</p>
<p>        Dim response = service.endCallSoap(cred, prof)</p>
<p>        Return response.ToString()<br />
    End Function</p>
<p>    Private Sub ByPassCertificate()<br />
        System.Net.ServicePointManager.ServerCertificateValidationCallback = _<br />
  Function(se As Object, _<br />
  cert As System.Security.Cryptography.X509Certificates.X509Certificate, _<br />
  chain As System.Security.Cryptography.X509Certificates.X509Chain, _<br />
  sslerror As System.Net.Security.SslPolicyErrors) True<br />
    End Sub<br />

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *