<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.innovaphone.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lebowski</id>
	<title>innovaphone wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.innovaphone.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lebowski"/>
	<link rel="alternate" type="text/html" href="https://wiki.innovaphone.com/index.php?title=Special:Contributions/Lebowski"/>
	<updated>2026-05-10T15:55:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://wiki.innovaphone.com/index.php?title=Reference:SOAP_API&amp;diff=5718</id>
		<title>Reference:SOAP API</title>
		<link rel="alternate" type="text/html" href="https://wiki.innovaphone.com/index.php?title=Reference:SOAP_API&amp;diff=5718"/>
		<updated>2007-08-21T21:19:21Z</updated>

		<summary type="html">&lt;p&gt;Lebowski: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;innovaphone®’s PBX software component introduced with firmware V4 features a new call control API, known as “PBX API” (formerly called “XML API”).  This API is released with the V5 firmware. This documents gives a short overview.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
This documents describes innovaphone’s PBX API, a call control API exposed by the PBX software component running on the IP 21, IP202, IP 400, IP800 and IP 3000.  &lt;br /&gt;
&lt;br /&gt;
The PBX API’s goal is to enable 3rd parties to write software targeting the innovaphone® PBX platform. The API is based upon standardized technologies such as XML and SOAP, so that it can be exposed in a platform neutral manner.  Developers are thus not restricted to specific platforms when designing their PBX API based applications.&lt;br /&gt;
&lt;br /&gt;
The PBX API is a call control API.  That is, by use of the API calls can be monitored, placed, controlled and terminated.  However, the PBX API is not the endpoint of a call. Particularly, the PBX API does not provide access to the media stream associated with a call.  The PBX API controls calls between endpoints known to the PBX. &lt;br /&gt;
&lt;br /&gt;
Applications, which need to function as the endpoint of a call, must use a different API, which is described in a separate document.  However, both APIs can be used simultaneously if required.&lt;br /&gt;
&lt;br /&gt;
[[Image:soap-api-01.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figure 1, calls live independently of the PBX API and it is transparent to the application what kind of endpoints are actually involved on the call. Thus, calls are seen in a uniform way by the application.&lt;br /&gt;
&lt;br /&gt;
The call control functions provided by the PBX API are actually exposed as a set of SOAP methods by the PBX, which together make a SOAP service.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, the PBX API is not an API, but a protocol with a well-defined mapping to a transport mechanism.  This transport mechanism is HTTP and the mapping is defined by SOAP. The set of methods exposed can be described using a standard SOAP mechanism, the WSDL file (WSDL is for [[http://www.w3.org/TR/wsdl Web Services Description Language]]). This way, users of the PBX API can access these methods from any platform they happen to utilize, provided this platform provides access to SOAP services.&lt;br /&gt;
&lt;br /&gt;
[[Image:soap-api-02.png]]&lt;br /&gt;
&lt;br /&gt;
Only the PBX part shown in Figure 2 is provided by innovaphone®, the left part is left to individual platform software provided by 3rd parties.  In particular, the actual API used be the application developer is specific to the development environment or tool she is using.&lt;br /&gt;
&lt;br /&gt;
Many development environments do support SOAP and thus enable access to the SOAP methods exposed by the PBX. At this time, we have worked with Microsoft’s .NET environment.  To use the sample applications provided with the beta kit, you need to install the .NET runtime.  To modify and compile the sample applications, you will need the Visual.NET tools.&lt;br /&gt;
&lt;br /&gt;
Looking specifically at the Microsoft.NET environment, there is a language agnostic runtime environment, which implements the IP, HTTP and SOAP layer.  On top of this, there are various language implementations sharing this same runtime environment, namely Visual C#, Visual C++ and Visual Basic. While all these languages provide access to the PBX’s SOAP methods, the API used to accomplish this is obviously syntactically different depending on the language used.&lt;br /&gt;
&lt;br /&gt;
Also, other development environments, such as Perl or Python, may provide access to SOAP methods and thus provide yet another PBX API.&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows how various development environments expose syntactically different PBX API’s .&lt;br /&gt;
&lt;br /&gt;
[[Image:soap-api-03.png]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Concept|{{PAGENAME}}]]&lt;br /&gt;
&lt;br /&gt;
== Definition of PBX object (WSDL) == &lt;br /&gt;
Within the SOAP framework there is a mechanism to formally decribe the definition of remote objects. This is done by so called WSDL (Web Service Description Language) files. This [[http://www.innovaphone.com/wsdl/pbx501.wsdl wsdl file]] defines the PBX web services  described in this document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;There is also an [[http://www.innovaphone.com/wsdl/pbx.wsdl old version of the wsdl]] available which has less interface functions.  This interface can still be accessed by legacy applications and is activated on the PBX by calling the &#039;&#039;&#039;Initialize&#039;&#039;&#039; Function with fewer arguments (&#039;&#039;&#039;Integer Initialize(string user, string appl, out key)&#039;&#039;&#039;).  It should not be used for new develoments though.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==PBX Objects and Methods==&lt;br /&gt;
&lt;br /&gt;
This section contains a language agnostic description of the PBX API’s object model.  Despite of the fact that we are discussing an object model, the PBX API is in fact not an object oriented API.  This is because SOAP itself is not really object oriented.  In particular, there is no object creation, activation or lifetime concept.  This is left up to the service designer.  SOAP is more a message exchange mechanism than an object method invocation mechanism.  This is reflected in the API structure.&lt;br /&gt;
&lt;br /&gt;
Specifically, objects are represented through handles, which are integers.  Objects are created and destroyed using dedicated methods and it’s the users responsibility to manage the lifetime of all objects.&lt;br /&gt;
&lt;br /&gt;
The syntax shown here actually is no valid syntax in any existing language.  Please refer to the various sample codes for working syntax.&lt;br /&gt;
&lt;br /&gt;
===Session===&lt;br /&gt;
&lt;br /&gt;
All PBX API methods are executed in the context of a session.  A session is created using the &#039;&#039;&#039;initialize&#039;&#039;&#039; method and is identified by a handle.  This handle must be provided to all subsequent method calls.&lt;br /&gt;
&lt;br /&gt;
A session is owned by the PBX API user, i.e. there is no way to have access to a session of another application.  Each session has a scope, which defines the view of the PBX the session user has.  The scope determines the set of PBX registrations seen by the session.&lt;br /&gt;
&lt;br /&gt;
Scopes are defined and configured in the PBX applet and are bound to particular PBX users. Thus, a session has a user attribute, which defines the scope.   It includes all users which are members of groups &#039;&#039;&#039;user&#039;&#039;&#039; is active member of.  If &#039;&#039;&#039;user&#039;&#039;&#039; is not an active member of any group, the scope is the user itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Integer Initialize(string user, string appl, bool v, bool v501, out int key)====&lt;br /&gt;
&lt;br /&gt;
To access the current web services implementation, both &#039;&#039;&#039;v&#039;&#039;&#039; and &#039;&#039;&#039;v501&#039;&#039;&#039; must be present and set to &#039;&#039;&#039;true&#039;&#039;&#039;. &lt;br /&gt;
These 2 parameters actually convey the wsdl version used by the client.  Different versions of the interface use different parameter sets for the Initialize call.  Applications should always use the wsdl version current at the time of writing the application.&lt;br /&gt;
&lt;br /&gt;
The method creates a session.  The session will have the user &#039;&#039;&#039;user&#039;&#039;&#039;’s scope.  The session handle is returned and is 0 for failure and positive for a valid session handle.  &#039;&#039;&#039;appl&#039;&#039;&#039; specifies the name of the calling application and is used for administrative purposes.  The output parameter &#039;&#039;&#039;key&#039;&#039;&#039; is a random number associated to the session.   It may be used in subsequent &#039;&#039;&#039;Echo&#039;&#039;&#039; operations.&lt;br /&gt;
&lt;br /&gt;
When a session is created, &#039;&#039;&#039;UserInfo&#039;&#039;&#039; events for all PBX registrations in the scope can be received by the &#039;&#039;&#039;Poll&#039;&#039;&#039; function.  Initially, one &#039;&#039;&#039;UserInfo&#039;&#039;&#039; per registration within the session’s scope is received.  Subsequently, &#039;&#039;&#039;UserInfo&#039;&#039;&#039; events are received when a registrations state changes.&lt;br /&gt;
&lt;br /&gt;
The underlying transport session (HTTP) must authenticate itself  either as &#039;&#039;&#039;user&#039;&#039;&#039;  (using the users long name and PBX password) or as the admin user (using the gateway administrator account name and password) to perform an &#039;&#039;&#039;Initialize&#039;&#039;&#039; and any session related function. &lt;br /&gt;
&lt;br /&gt;
Note that the method to force the SOAP system you are using to authenticate to the PBX is entirely up to the system itself.  Some systems even do not support authentication at all.  If your SOAP implementation does not support digest authentication, make sure the gateway accepts basic authentication by setting the “&#039;&#039;allow HTTP basic authentication&#039;&#039;” in the “&#039;&#039;General settings&#039;&#039;”.&lt;br /&gt;
&lt;br /&gt;
Note that although many HTTP connections may be used in a single session, at least one HTTP connection must remain open during the lifetime of the session.  When the last connection disappears, the logical session is terminated after a short timeout. Some SOAP libraries may per default always close the HTTP connection and reconnect on subsequent SOAP calls, which will not work. The SOAP library should either be configured to keep at least one HTTP connection alive or, if this is not an option, the application should take care to always have a an active request pending (such as &#039;&#039;&#039;Poll&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
====Echo(integer session, integer key)====&lt;br /&gt;
&lt;br /&gt;
Verifies a session.  You need to supply the &#039;&#039;session&#039;&#039; identifier and &#039;&#039;key&#039;&#039; returned by a previous call to &#039;&#039;&#039;Initialize&#039;&#039;&#039;.  Returns nonzero if successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====End(integer session)====&lt;br /&gt;
&lt;br /&gt;
Terminates the session referenced by &#039;&#039;session&#039;&#039;.  No further events will be received.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Integer Version(out string gkId, out string location, out string firmware, out string serial)====&lt;br /&gt;
&lt;br /&gt;
Returns the version number of the WSDL file the PBX supports.  The first released WSDL file had version number 500.  The version described by this document has version number 501. Also delivers information about the connected PBX (in &#039;&#039;gkId&#039;&#039;, &#039;&#039;location&#039;&#039;, &#039;&#039;firmware&#039;&#039; and &#039;&#039;serial&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====AnyInfo Poll(integer session)====&lt;br /&gt;
&lt;br /&gt;
Returns pending events for the session referenced by &#039;&#039;session&#039;&#039;.  &#039;&#039;AnyInfo&#039;&#039; is a struct with four arrays as members: &#039;&#039;user&#039;&#039;, &#039;&#039;call&#039;&#039;, &#039;&#039;reg&#039;&#039; and &#039;&#039;info&#039;&#039;. &#039;&#039;user&#039;&#039; is an array of type &#039;&#039;UserInfo&#039;&#039; and call is an array of type CallInfo.  The other two arrays &#039;&#039;reg&#039;&#039; and &#039;&#039;info&#039;&#039; are currently not used.&lt;br /&gt;
&lt;br /&gt;
After a successful &#039;&#039;&#039;Initialize()&#039;&#039; there will be a &#039;&#039;UserInfo&#039;&#039; event for each defined user in the system.  This allows the application to synchronize on the state of all visible users.  The list will be terminated by an &#039;&#039;UserInfo&#039;&#039; event for a user with an empty &#039;&#039;cn&#039;&#039; which normally cannot happen since a user entry must have a cn.&lt;br /&gt;
&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
A user represents a configured object within the PBX (a “PBX user”). The PBX API provides the &#039;&#039;&#039;UserInitialize&#039;&#039;&#039; method to obtain a handle to the user.&lt;br /&gt;
&lt;br /&gt;
====UserInfo====&lt;br /&gt;
The user’s properties are stored in a &#039;&#039;UserInfo&#039;&#039; structure, which has the following elements:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;boolean active&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if the user exists.  The only case where active can be false is when a user is deleted. A single UserInfo event will be posted with active set to false then.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;integer state&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1 if the user is registered, 0 otherwise.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;integer channel&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
number of current calls.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;integer  alert&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
number of alerting calls&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the type of the users device.  Currently defined are “&#039;&#039;&#039;ep&#039;&#039;&#039;” (it is an endpoint), “&#039;&#039;&#039;gw&#039;&#039;&#039;” (it is a gateway, for example a trunk line), “&#039;&#039;&#039;waiting&#039;&#039;&#039;” (a call queue) or “&#039;&#039;&#039;broadcast&#039;&#039;&#039;” (a group).  Others may be defined over time.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string guid&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the users GUID.  This is a globally unique identifier for the user.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string cn&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the common name of the user. This is what the PBX’s LDAP server recognizes as the CN of this user.  The user’s name in the PBX configuration applet.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string e164&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the extension number the user is registered with.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string h323&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the alias the user is registered with.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string dn&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the users display name.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Group groups&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An array of &#039;&#039;&#039;Group&#039;&#039;&#039; records (see below).&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Info info	&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An &#039;&#039;&#039;Info&#039;&#039;&#039; record describing various aspects of the user.  The type of the information described in an individual &#039;&#039;&#039;Info&#039;&#039;&#039; record is determined by the value of its &#039;&#039;type&#039;&#039; member.  Currently defined values for &#039;&#039;type&#039;&#039; are:&lt;br /&gt;
&lt;br /&gt;
**loc&lt;br /&gt;
&lt;br /&gt;
If the object described is not local to the PBX the &#039;&#039;&#039;UserInfo&#039;&#039;&#039; is sent from, the name of the location the object is homed in is given in this element.  See &#039;&#039;&#039;LocationUrl&#039;&#039;&#039; to find out how to proceed further. &lt;br /&gt;
&lt;br /&gt;
The users group memberships are stored in a &#039;&#039;&#039;Group&#039;&#039;&#039; record which has the following elements:&lt;br /&gt;
&lt;br /&gt;
**&#039;&#039;&#039;string group&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the name of the group the user is a member of&lt;br /&gt;
&lt;br /&gt;
**&#039;&#039;&#039;integer state&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;true&#039;&#039;&#039; if the user is an active member of the group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====integer UserInitialize(integer session, string user, bool follow)====&lt;br /&gt;
&lt;br /&gt;
Returns a handle to the named &#039;&#039;user&#039;&#039; (0 on failure).  Once a user handle is obtained with &#039;&#039;&#039;UserInitialize&#039;&#039;&#039;, &#039;&#039;&#039;CallInfo&#039;&#039;&#039; events will be posted and retrieved via &#039;&#039;&#039;Poll&#039;&#039;&#039; for all calls related to the user.  If &#039;&#039;follow&#039;&#039; is set to &#039;&#039;&#039;true&#039;&#039;&#039;, &#039;&#039;&#039;CallInfo&#039;&#039;&#039; events will also be posted for calls which are transferred away from &#039;&#039;user&#039;&#039;.  Otherwise, such events will be posted only for the user handle which the call has been transferred to. Thus, without setting follow to true, an application will generally not be able to track calls after a transfer unless it has called &#039;&#039;&#039;UserInitialize&#039;&#039;&#039; for any PBX object a call may be transferred to and matches the new call on the transferred-to user via the &#039;&#039;&#039;conf&#039;&#039;&#039; information in the &#039;&#039;&#039;Info&#039;&#039;&#039; record of the new call (which will be identical to the &#039;&#039;&#039;conf&#039;&#039;&#039; information for the transferred call).&lt;br /&gt;
&lt;br /&gt;
Also, the user handle can be used to create and control calls on behalf of the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====void UserEnd(integer user)====&lt;br /&gt;
&lt;br /&gt;
Frees the handle &#039;&#039;user&#039;&#039; obtained with &#039;&#039;&#039;UserInitialize&#039;&#039;&#039;. No events will be posted for this user anymore.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Call===&lt;br /&gt;
A call represents one leg of an existing call in the PBX.  &lt;br /&gt;
&lt;br /&gt;
====CallInfo====&lt;br /&gt;
The calls attributes are stored in a &#039;&#039;&#039;CallInfo&#039;&#039;&#039; structure, which has the following elements:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;int user&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the user handle the call belongs to&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;int call&#039;&#039;&#039;&lt;br /&gt;
the call handle&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;int reg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
currently unused&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;bool active&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;true&#039;&#039;&#039; if the call exists, &#039;&#039;&#039;false&#039;&#039;&#039; if not.  The only case where &#039;&#039;active&#039;&#039; can be &#039;&#039;&#039;false&#039;&#039;&#039; is when a call is terminated. A single &#039;&#039;&#039;CallInfo&#039;&#039;&#039; event will be posted with &#039;&#039;active&#039;&#039; set to &#039;&#039;&#039;false&#039;&#039;&#039; then&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;integer state&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A calls state. A bit field made up as follows:&lt;br /&gt;
{|&lt;br /&gt;
|+&lt;br /&gt;
| Value &lt;br /&gt;
| Mask &lt;br /&gt;
| Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 1 &lt;br /&gt;
| 0xF &lt;br /&gt;
| setup&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||		|| setup-ack&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||		|| call-proc&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||		|| Alert&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||		|| Connect&lt;br /&gt;
|-&lt;br /&gt;
| 6 ||		|| disconnect sent&lt;br /&gt;
|-&lt;br /&gt;
| 7 ||		|| disconnect received&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||	0x80    || inbound  call&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||	0x80    || outbound call&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||	0x100   || active call&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||	0x100   || call on hold&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the PBX API is PBX-centric, not terminal centric.  As such, it considers a call &#039;&#039;from&#039;&#039; the PBX &#039;&#039;to&#039;&#039; the terminal as &#039;&#039;outbound&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string msg&#039;&#039;&#039;&lt;br /&gt;
A textual representation of the signalling message causing this event. E.g. “&#039;&#039;&#039;x-setup&#039;&#039;&#039;”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;No No&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An array of &#039;&#039;&#039;No&#039;&#039;&#039; records (see below).  This can include information about various peers related to the call itself.  The type of the peer described in an individual &#039;&#039;&#039;No&#039;&#039;&#039; record is determined by the value of its &#039;&#039;&#039;type&#039;&#039;&#039; member.  Currently defined values for &#039;&#039;&#039;type&#039;&#039;&#039; are:&lt;br /&gt;
&lt;br /&gt;
**&#039;&#039;&#039;peer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The current remote end of the call (the local end is determined by the UserInfo identified through the user handle above)&lt;br /&gt;
&lt;br /&gt;
**&#039;&#039;&#039;leg2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last diverting user (if any)&lt;br /&gt;
&lt;br /&gt;
**&#039;&#039;&#039;ct&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last user having transferred the call (if any)&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Info info&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An &#039;&#039;&#039;Info&#039;&#039;&#039; record describing various aspects of the call.  The type of the information described in an individual &#039;&#039;&#039;Info&#039;&#039;&#039; record is determined by the value of its &#039;&#039;type&#039;&#039; member.  Currently defined values for &#039;&#039;type&#039;&#039; are:&lt;br /&gt;
&lt;br /&gt;
**&#039;&#039;&#039;conf&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A string holding the conference id (a GUID) of the conference the call is a leg of&lt;br /&gt;
&lt;br /&gt;
====No Record====&lt;br /&gt;
&lt;br /&gt;
Peer information is stored in a &#039;&#039;&#039;No&#039;&#039;&#039; record with the following elements:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the type of the peer described by the record&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string cn&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the peer’s PBX’s objects common name (if any)&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string e164&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the peer’s phone number&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string h323&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the peer’s h323 alias&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string dn&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the peer’s display name&lt;br /&gt;
&lt;br /&gt;
====Info record====&lt;br /&gt;
Various information is stored in &#039;&#039;&#039;Info&#039;&#039;&#039; records with the following elements:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the type of the information described by the record&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;string vals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a string value associated with this information (if any, the &#039;&#039;type&#039;&#039; of the element determines if an &#039;&#039;&#039;Info&#039;&#039;&#039; element has a string or an integer value) &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;integer vali&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
an integer value associated with this information (if any)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the call related functions do not return a meaningful value.  This is because the operations success is reflected in the subsequent CallInfo events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====integer UserCall(integer user, string cn, string e164, string h323, int reg, InfoArray info)====&lt;br /&gt;
&lt;br /&gt;
Creates an outgoing call from the &#039;&#039;&#039;user&#039;&#039;&#039; (which is a handle obtained by a call to &#039;&#039;&#039;UserInitialize&#039;&#039;&#039;)  to the destination described by &#039;&#039;cn&#039;&#039;, &#039;&#039;e164&#039;&#039; and &#039;&#039;h323&#039;&#039;.  Arguments &#039;&#039;reg&#039;&#039; and &#039;&#039;info&#039;&#039; are currently ignored. Returns a handle to the call (0 on failure).&lt;br /&gt;
&lt;br /&gt;
Depending on the nature of the device the user is registered with, the device may actually place the call or the PBX may place a call and once it is accepted, it places another call to the destination.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====UserConnect(integer call)====&lt;br /&gt;
Connects an existing &#039;&#039;call&#039;&#039;.  This forces the device the user is registered with to accept the call.  It may then go into hands-free mode.  Incapable (i.e. non-innovaphone) devices may simply ignore this call.&lt;br /&gt;
&lt;br /&gt;
====UserTransfer (int acall, integer bcall)====&lt;br /&gt;
&#039;&#039;acall&#039;&#039; and &#039;&#039;bcall&#039;&#039; are both calls a single user currently has active.  This method will connect &#039;&#039;acall&#039;&#039; with &#039;&#039;bcall&#039;&#039;, leaving the user without both calls.&lt;br /&gt;
&lt;br /&gt;
====bool UserRedirect(integer call, string cn, string e164, string h323, InfoArray info)====&lt;br /&gt;
Places a call to the destination described by &#039;&#039;cn&#039;&#039;, &#039;&#039;e164&#039;&#039; and &#039;&#039;h323&#039;&#039; and connects &#039;&#039;call&#039;&#039; to this destination.  Argument &#039;&#039;info&#039;&#039; is currently ignored.&lt;br /&gt;
&lt;br /&gt;
====integer UserPickup(int user, string cn, integer call, string group, int reg, InfoArray info)====&lt;br /&gt;
Redirects a call such that it appears as a new call at &#039;&#039;user&#039;&#039;. The call to be redirected can be specified by its &#039;&#039;call&#039;&#039; handle.  Alternatively, calls can be picked up by a users &#039;&#039;cn&#039;&#039; or by a &#039;&#039;group&#039;&#039; name.  If all parameters are null, an implicit pickup is done.  The new call handle is returned. Arguments &#039;&#039;reg&#039;&#039; and &#039;&#039;info&#039;&#039; are currently ignored.&lt;br /&gt;
&lt;br /&gt;
====UserClear(integer call, integer cause, InfoArray info)====&lt;br /&gt;
Disconnects the &#039;&#039;call&#039;&#039; providing &#039;&#039;cause&#039;&#039; as disconnect reason.  &lt;br /&gt;
&lt;br /&gt;
Cause is coded as a 7bit integer according to the table found in [[Reference:ISDN Cause Codes]].&lt;br /&gt;
Argument &#039;&#039;info&#039;&#039; is currently ignored.&lt;br /&gt;
&lt;br /&gt;
====UserCtComplete(integer call, string e164, string h323)====&lt;br /&gt;
&lt;br /&gt;
Sends a notification to the device &#039;&#039;call&#039;&#039; is active on that the remote peer has changed to &#039;&#039;e164&#039;&#039; and &#039;&#039;h323&#039;&#039;.   This resembles the notification a device may receive if its remote peer transfers the call to the new destination.  The device may update its display and/or call data accordingly.  This call is often used to force the devices (i.e. telephones) display to show application specific data.&lt;br /&gt;
&lt;br /&gt;
====UserHold(integer call)====&lt;br /&gt;
Sets the call on hold.  The device may or may not display the hold status.  In any case, the media channel is disconnected until a UserRetrieve is called.&lt;br /&gt;
&lt;br /&gt;
====UserRetrieve(integer call)====&lt;br /&gt;
Retrieves the &#039;&#039;call&#039;&#039; on hold.  The device may or may not display the new status.  In any case, the media channel is reconnected.&lt;br /&gt;
&lt;br /&gt;
===Status Retrieval===&lt;br /&gt;
&lt;br /&gt;
Instead of monitoring calls using the &#039;&#039;Poll&#039;&#039; mechanics, there are some functions to retrieve the current at a certain point in time.&lt;br /&gt;
&lt;br /&gt;
====CallInfo[] Calls(integer session, string user)====&lt;br /&gt;
Returns an array of &#039;&#039;&#039;CallInfo&#039;&#039;&#039; records for the calls currently active at the registration defined by &#039;&#039;user&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
====UserInfo[] FindUser(string v501, string cn, string h323, string e164, integer count, integer next)====&lt;br /&gt;
Returns an array of at most &#039;&#039;count&#039;&#039; &#039;&#039;&#039;UserInfo&#039;&#039;&#039; records for the users matching &#039;&#039;cn&#039;&#039;, &#039;&#039;h323&#039;&#039; or &#039;&#039;e164&#039;&#039;.  Only one of &#039;&#039;cn&#039;&#039;, &#039;&#039;h323&#039;&#039; and &#039;&#039;e164&#039;&#039; may be specified.  The search string will be used as a starting point into the alphabetically sorted list of objects, that is, a search for “&#039;&#039;&#039;A&#039;&#039;&#039;” will yield entries starting with “&#039;&#039;&#039;A&#039;&#039;&#039;” but also – depending on &#039;&#039;count&#039;&#039; – the following entries.  Neither search string may be empty.  v501 must be set to a non-empty value.&lt;br /&gt;
&lt;br /&gt;
To call &#039;&#039;&#039;FindUser&#039;&#039;&#039;, no session is required, however, you need a valid HTTP authentication.&lt;br /&gt;
&lt;br /&gt;
Be aware that large values for &#039;&#039;count&#039;&#039; may fail and even crash the PBX.  If you need to retrieve the whole user list, you should be using 50 as  &#039;&#039;count&#039;&#039;, provide the last &#039;&#039;cn&#039;&#039; retrieved as new start cn and loop until &#039;&#039;&#039;&#039;FindUser&#039;&#039;&#039; returns no more results, passing &#039;&#039;&#039;true&#039;&#039;&#039; as  value for &#039;&#039;next&#039;&#039; for all but the first calls.&lt;br /&gt;
&lt;br /&gt;
====string License(integer session, string name)====&lt;br /&gt;
This function is for internal use only.&lt;br /&gt;
&lt;br /&gt;
====string LocationUrl(string user v501, string location)====&lt;br /&gt;
Returns a string with the HTTP URL for the PBX named location to which a SOAP session can be created. Typically, location  is retrieved from the &#039;&#039;vals&#039;&#039; element of an &#039;&#039;&#039;Info&#039;&#039;&#039; record with &#039;&#039;type&#039;&#039; &#039;&#039;&#039;loc&#039;&#039;&#039; in an &#039;&#039;&#039;UserInfo&#039;&#039;&#039; record.&lt;br /&gt;
&lt;br /&gt;
===Administration===&lt;br /&gt;
The SOAP interface can be used for administrational purposes also.  This is done via the Admin call.&lt;br /&gt;
&lt;br /&gt;
====string Admin(string xml)====&lt;br /&gt;
&lt;br /&gt;
Sends the administrational command &#039;&#039;xml&#039;&#039; to the PBX.  The command is executed and any result is returned.  The scope and format of the commands valid for xml is beyond the scope of this document.&lt;br /&gt;
&lt;br /&gt;
To call &#039;&#039;&#039;Admin&#039;&#039;&#039;, no session is required.  However, you must be authenticated as an admin user on the underlying HTTP layer.&lt;br /&gt;
&lt;br /&gt;
==Typical design of a PBX SOAP Application==&lt;br /&gt;
A typical SOAP application has a thread that collects all PBX events using an infinite loop which calls &#039;&#039;&#039;Poll()&#039;&#039;&#039;, scans the returned &#039;&#039;&#039;AnyInfo&#039;&#039;&#039; arrays and reacts accordingly.  Depending on the type of application, there are 2 typical schemes&lt;br /&gt;
&lt;br /&gt;
*the thread is either initialized with a sequence of calling Initialize() and then UserInitialize() on behalf of a (typically pre-configured) user (1st party scenario) or&lt;br /&gt;
*the thread is initialized via Initialize() and then, when Poll() returns UserInfo records later on, UserInitialize() is called once on behalf of any user made known by the UserInfo (3rd party scenario)&lt;br /&gt;
&lt;br /&gt;
In any case, once initialized, the infinite loop of calls to &#039;&#039;&#039;Poll()&#039;&#039;&#039; will retrieve all relevant events from the PBX, i.e. there is no need to perform distinct calls to &#039;&#039;&#039;Poll()&#039;&#039;&#039; for different users.  &lt;br /&gt;
&lt;br /&gt;
Please note that &#039;&#039;&#039;Poll()&#039;&#039;&#039; is rather a misnomer, since it does not really poll the PBX but will hang as long as no events are to be delivered.  It will not consume extensive CPU cycles thus.  In fact, &#039;&#039;&#039;Poll()&#039;&#039;&#039; will return with an empty &#039;&#039;&#039;AnyInfo&#039;&#039;&#039; Array if no events are present after a while.  This is because many SOAP client implementations consider a call to fail if it takes “long”, where “long” is defined by the client implementation.&lt;br /&gt;
&lt;br /&gt;
When a call to the PBX fails, the PBX link is broken and any associated data structures should be destroyed and the initialization process should start over again.  Most importantly, local user and call ids are no longer valid after a restart of a PBX.  Please note that some SOAP development environments will transparently reconnect a broken link.  To make sure a restart of the PBX is discovered by the application, use the &#039;&#039;&#039;Echo()&#039;&#039;&#039; call since it will change if the key is invalidated by a restart. Some server type applications will find it convenient to use a separate thread that simply loops with an &#039;&#039;&#039;Echo&#039;&#039;&#039;/&#039;&#039;&#039;Pause&#039;&#039;&#039; sequence.&lt;br /&gt;
&lt;br /&gt;
Many applications both react on events returned by &#039;&#039;&#039;Poll()&#039;&#039;&#039; and on events created by a client or by a user interface.  In such cases, make sure that a single SOAP link (depending on the development environment used) is not used for 2 concurrent SOAP calls, as most development systems do not support this.  Rather create 2 or more links. &lt;br /&gt;
&lt;br /&gt;
SOAP is based on http and thus uses http authentication.  Many SOAP development environments will thus send any request unauthorized first and resent it with authorization only when the server has returned the “Unauthorized“ http error code.  This obviously causes delays on the client and extensive CPU usage on the PBX.  If possible, make sure to configure your SOAP client such that it will send each request authenticated in the first place (a mode sometimes known as “pre-authenticated”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
The wsdl definition is available at http://www.innovaphone.com/wsdl/pbx501.wsdl.&lt;br /&gt;
&lt;br /&gt;
==Known Problems==&lt;br /&gt;
==System Requirements==&lt;br /&gt;
The PBX SOAP API requires a working PBX.&lt;br /&gt;
&lt;br /&gt;
To work with the PBX API in this version, you must run at least version 5.01 software on your PBX.  Also, you must run at least version 5 software on the IP200.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
There is no specific installation required, as the PBX API is integral part of the PBX (although licenses are required to operate the PBX).&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
To prepare an PBX for PBX API testing&lt;br /&gt;
*setup a separate PBX&lt;br /&gt;
*install version 5.01 firmware&lt;br /&gt;
*configure the PBX as usually&lt;br /&gt;
*add an user object called “API” , define a password for this object&lt;br /&gt;
*create a new group (e.g. called “all users”), by adding a group tag to “API”, make it “active”&lt;br /&gt;
*add a similar group tag to all other test users&lt;br /&gt;
*call Initialize() and use API as user and API and the password as http credentials&lt;/div&gt;</summary>
		<author><name>Lebowski</name></author>
	</entry>
</feed>