1.1 XML Bridge

The purpose of XML bridge is safe encapsulation of the message-bridge interface. Safe in this respect means that the user application does not work directly with the binary structures, of which the messages are composed, but rather with their XML image. This prevents undesirable system behavior in the event that an incorrectly written external application sends an incorrectly formatted message to it. The XML bridge also defines the set of messages that external programs may exchange with the NetStar system. The user application model is illustrated on the following figure. 

 Communication model of the user tool of the NetStar system 

Operator.exe – a Application connected via NsBridge.dll to the PBX.

Message-bridge – proprietary communication protocol.

The program that needs to connect with NetStar PBX will use dynamically linked library, NsBridge.dll. This library consists of the message core including the message-bridge, the XML translator and the session administrator. After implemented, the library must be initiated by calling the InitNsBridge function. This function must be called prior to using any other function from the library. Prior to the release of the library it is necessary to call, for example, the ExitNsBridge function, so that non-allocated resources could be released correctly.

Connection to a remote system is done in three steps:

1) obtaining XML stream handle (local calling of OpenXmlBridge);

2) connecting of the stream to the remote system (XML Element Bind);

3) authentication (XML element auth).

After successful authentication the systems may send messages to each other (XML element msg). The session is closed by the CloselBridge function. Message delivery is asynchronous. Writing, or reading to XML stream is done using standard functions of Win32 API (ReadFile/WriteFile or ReadFileEx/WriteFileEx, respectively). Status automatic machines, which control the process of message processing, are implemented in the client application as necessary.