My intention is to create some little utilities in xHarbour/Fivewin that will be able to drive some innovaphone equipments, such as telephone, gateway and so on.
The question is: is it possible to translate the below sample in xharbour/fivewin and obtain the same result?
Thanks in advance
Marco
I've found this sample
Module Module1
Sub Main()
Dim pbx As com.innovaphone.www.pbx
Dim session_h As Integer
Dim user_h As Integer
Dim i As Integer
Dim inf() As com.innovaphone.www.Info
pbx = New com.innovaphone.www.pbx()
pbx.Url = "http://x.x.x.x/PBX0/user.soap"
pbx.Credentials = New Net.NetworkCredential("admin", "ip400")
session_h = pbx.Initialize("eighteen", "demo", 0)
user_h = pbx.UserInitialize(session_h, "eighteen")
pbx.UserCall(user_h, "", "152", "", i, inf)
End Sub
End Module
below there is complete tex of word documents with other explanation.
How to use the PBX API from VB.NET
This information applies to
− PBX API V5
Summary
This document will guide you in a few steps to control an ip200 by means of the PBX API in such, that an ip200 is calling another ip200 on request of a Visual Basic .NET application.
The sample provided here is far from being a fully-fledged demonstration of the PBX API. It rather serveres as a “Hello World” sample.
More Information
System Requirements
.NET Runtime
Visual Studio .NET
2x IP200
1x IP400
Hello World in a few steps
· Get a v5 ip400, install a PBX and create two users
Long Name Name Number
hundredfiftytwo einszwofünf 152
eighteen einsacht 18
· Start Visual Studio
· Go into FILE/NEW/PROJECT/
· The New Project Dialog will appear
· Select Visual Basic Project
· Select Console Application
· Type the application’s name as ConsoleApplication1
· Go into the Solution Explorer an right-click on ConsoleApplication1
· Select Add Web Reference from the context menu
· The Add Web Reference Dialog appears
· As Address enter
http://www.innovaphone.com/wsdl/pbx.wsdl
· Hit the ENTER key
· The XML Content of the WSDL file now appears in the left window pane
· Click on the Add Reference Button
· You will now see a new Web Reference has been added, the whole picture now looks like this:
· Now enter the following few lines as content for Module1.vb
Module Module1
Sub Main()
Dim pbx As com.innovaphone.www.pbx
Dim session_h As Integer
Dim user_h As Integer
Dim i As Integer
Dim inf() As com.innovaphone.www.Info
pbx = New com.innovaphone.www.pbx()
pbx.Url = "http://x.x.x.x/PBX0/user.soap"
pbx.Credentials = New Net.NetworkCredential("admin", "ip400")
session_h = pbx.Initialize("eighteen", "demo", 0)
user_h = pbx.UserInitialize(session_h, "eighteen")
pbx.UserCall(user_h, "", "152", "", i, inf)
End Sub
End Module
That’s it. When you’re running the code you’ll see the ip200 with the number 18 calling the phone with the number 152.
If it does not compile, go to reference.vb and remove the function License. This is a VB bug.
Code Discussion
· Dim pbx As com.innovaphone.www.pbx
A so-called proxy object with name pbx is the point of interest
· pbx = New com.innovaphone.www.pbx()
The proxy object must be allocated
· pbx.Url =
http://192.168.0.18/PBX0/user.soap
The ip400 with the PBX has the ip address 192.168.0.18
· pbx.Credentials = New Net.NetworkCredential("admin", "ip400")
We're using the default user account and password
· session_h = pbx.Initialize("eighteen")
Getting a session handle for user eighteen
· user_h = pbx.UserInitialize(session_h, "eighteen")
Getting a user handle for user eighteen
· pbx.UserCall(user_h, "", "152", "")
Submitting the call from user eighteen towards number 152
If everything worked fine, the ip200 with number 152 is ringing.