xsi repository console help

This page has help for the XSI Repository Console. The XSI Repository Console is shipped with the .NET XSI backend and helps a developer understanding the XSI repository. The product is contained in the DemoApp project within the complete Visual Studio solution. This manual assumes you’ve got the solution checked out and have your environment setup properly.

First things first: make sure the DemoApp project is marked as the StartUp Project within the solution and run it. The console starts:

XSI Repository Console version 1 site

The XSI Repository Command Line Interface uses a one-statement-per-line-based interpreter and it is able to process the commands below:

  • q: Quits the application (after ctrl-c)
  • h: Displays help and includes a link to this page.
  • v: Displays the version of the console.
  • Configure: Configures the backend.
  • AddSubscription: Adds a subscription to the backend.
  • StopSubscription: Removes a subscription from the backend.
  • Start: Starts the repository. This initializes the session with the XSI provider.
  • Stop: Stops the backend.
  • Content: Fetches the first available Repository Content from the repository and displays the content on the console.
  • MessageCount: Displays the current number of Repository Content messages.

The commands are discussed in more details in the next paragraphs.

q

q

Quits the demo application. The console still needs ctrl-c (and confirmation) to really close the console. Once closed, it will terminate the console and terminate the backend.

q

h

Displays help. Only the q and v parameters are documented in the tool. There’s a link directing you to this page.

v

v

Displays the commandline interface version identification. This manual is valid for version 10.

Configure

Configure('http://xsp2.voipit.nl/', 'uid', 'password')
Configure('http://xsp2.voipit.nl/', 'uid', 'password', true) 
Configure('http://xsp2.voipit.nl/', 'uid', 'password', '19.0') 
Configure('http://xsp2.voipit.nl/', 'uid', 'password', '19.0', 'com.broadsoft.xsi-actions', 'com.broadsoft.xsi-events', 'com.broadsoft.async/com.broadsoft.xsi-events') 

Use Configure to configure global settings applicable to this backend. The minimum set includes a base uri, the Broadsoft user id and the password associated to the id. The 4th parameter is either used to disable SSL verification or contains the Broadsoft protocol version. Disabling SSL verification is generally not a good idea and the backend will produce messages when you decide to.

The backend will create a versioned Channel when you specify the Broadsoft Protocol version. This is generally a good idea as this prevents your application from breaking due to version updates at the provider.

Some providers do not use the default Broadsoft namespaces and instead provide their own. You can configure the backend to use different namespaces for the actions uri, the events and the prefix used to create the channel. The values used in the example are default values and running a backend with changed values is probably very rare.

The system will configure the creation of the configuration by emitting a message:

DemoApp.RuntimeWebBackendConfiguration

AddSubscription

AddSubscription('bastb', BasicCall, User)
AddSubscription('bastb', StandardCall, User)
AddSubscription('bastb', AdvancedCall, User)
AddSubscription('bastb', DoNotDisturb, User)
AddSubscription('callcenter', CallCenterQueue, User)
AddSubscription('callcenter', CallCenterAgent, User)
AddSubscription('callcenter', CallCenterAgentMonitoring, User)
AddSubscription('callcenter', CallCenterConfiguration, User)
AddSubscription('callcenter', CallCenterMonitoring, User)

The system is capable of monitoring multiple subscription types. Specify the subscription target, bastb and callcenter in the examples above, the event package and the entity.

Supported packages are BasicCall, StandardCall, AdvancedCall, DoNotDisturb, CallCenterQueue, CallCenterAgent, CallCenterAgentMonitoring, CallCenterConfiguration and CallCenterMonitoring.

Supported entities are User, System, Group and ServiceProvider

The loginname, bastb in the majority of the examples here, represents the loginname of the user being targeted. The loginname used in the examples here is not in the correct format and the XSI provider will return an error if you decide to use it. The correct format is <user>@<domain>, but you can go ahead and give it a try. You’ll find an error message in the logging produced by the backend. Your local XSI administrator will be able to get you a correct loginname. The system can monitor multiple accounts at once, so you’re not limited to 1.

The system will produce RegistrationMessages while monitoring users or callcenters. These messages are available through the Content (and TryContent) properties on the backend. More on that later on, in the Content paragraph.

The repository does not need to be started for you to create registrations. You can add them when the system has not been started. The system will activate them when the repository is started and reactivate them as the channel is restarted.

The system will confirm subscription creation after adding it:

PhoneCallLogger.WebBackend.XsiSubscription.CreateXsiSubscription

 StopSubscription

StopSubscription('bastb', BasicCall, User)
StopSubscription('bastb', StandardCall, User)
StopSubscription('bastb', AdvancedCall, User)
StopSubscription('bastb', DoNotDisturb, User)
StopSubscription('callcenter', CallCenterQueue, User)
StopSubscription('callcenter', CallCenterAgent, User)
StopSubscription('callcenter', CallCenterAgentMonitoring, User)
StopSubscription('callcenter', CallCenterConfiguration, User)
StopSubscription('callcenter', CallCenterMonitoring, User)

Removes an existing subscription from the system. Specify the target, the package and the entity, just like creating it.

The next parameter represents the name of the target object. There’s no real problem if the user has not been previously being added using AddSubscription: the system detects that the target is not being monitored. Detailed messages are in the logging as well.

You’ll no longer receive call information regarding this target once this message has been processed.

The system will confirm processing this request by emitting the name of the class used to remove the subscription from the backend:

PhoneCallLogger.WebBackend.XsiSubscription.StopXsiSubscription

 Start

 Start()

Starts or restarts the backend. The system will create an HTTP connection to the XSI provider, if one doesn’t exist yet, and activate both pre-existing and newly added subscriptions.

The system will keep the HTTP connection active, meaning that the HTTP connection gets recreated when the repository decides that it’s required, to a certain extend. Here’s how it works:

  • The system will abort immediately if this is the first attempt to build a connection. The idea here is that there’s probably a configuration problem, like an incorrect username and/or password, or an infrastructure problem.
  • The system will stop connection attempts after 16 consecutive unsuccesfull attempts, using a 66 second delay between those attempts. You can specify another number.

Consuming applications can be informed of state changes using the StatusChanged event.

The backend will emit the current state to the console:

StatusChanged: Connection 17f904e5-6cc7-43d8-b70b-de93199346e2 is Online

Start may take little time to return. A little time should be considerably less than a second, but it’s not instant. It’s a good idea to follow the logging using a tool like TailBlazer.

Stop

Stop()

Stops the system by closing the HTTP connection and associated subscriptions. You can not reuse this backend and you’ll need to create a new instance.

Stop is state independent; you can issue Stop even when the backend has not been started yet.

The console will emit a message resembling this one once Stop() finished:

StatusChanged: Connection 17f904e5-6cc7-43d8-b70b-de93199346e2 is Offline

Content

Content

Content returns the next available message from the queue. The system maintains the order the messages were received in to a certain degree.

The system will throw an InvalidOperationException when there are no messages on the queue. Issue MessageCount to get the number of messages stored. You can cast the backend to an AutoResetEvent instance and wait for it to be set. Keep in mind that the repository may contain multiple messages, even when the AutoResetEvent is set only once.

Content is cached on the backend; there is no persistent storage. This means you’ll loose messages that have not been read from the queue if the application was to crash.

MessageCount

MessageCount

Returns the number of currently cached messages. This number increases as the backend recognizes messages and delivers them. The number decreases when a message is read from the queue using Content (or TryContent).

Events

The console is wired to a set of C# events, which will emit messages as the C# events are triggered. It’s expected behaviour when the console displays a message:

  • … when the system recognizes a call.
    • 2016-03-15 22:40:03: Repository has new content. Use "Content" to view it
  • .. when the system is handled a subscription request:
    • Subscribed: Attempt to add subscription targeting bastb: 1d2be77e-099c-41af-8c1e-dce41860f72e
  • Displays a message when the backend is online. And offline:
    • StatusChanged: Connection 17f904e5-6cc7-43d8-b70b-de93199346e2 is Online
    • StatusChanged: Connection 17f904e5-6cc7-43d8-b70b-de93199346e2 is Offline

Things you need to know

Note that even though the source code of the XSI Repositoy Console is made available, you are not permitted to distribute the software. And I’m not responsible for damages caused by the product or parts of the product in any way, shape or form. You’re using the product at your own risk.

Want to use the backend and tooling? Contact me.

Leave a Reply

Your email address will not be published. Required fields are marked *