providing the highest level of communication services

Architecture dilema

Hello chris,

I have some questions/or more or like a discussion regarding the architecture I am about to setup.

## number 1:
I have 1x Hipath 3000 (multiple devices, agents).

In my opinion, I would set up the architecture like this:

1x cstaserver
Nx cstaclient (one client per one device) - i know i can monitor more devices with one client, but It seems better for a web application, where oneclient will be connected to one user.

what is your expert opinion on that?

## number 2:
How or what is the best way to stop the cstaMulti. I noticed there is a method setRunFlag - and that should stop the run method, but what about other things? or is this enough... How I start my client:


csta = new CSTAMulti(this, _props);
csta.RegisterParentApplication(this);
cstaThread = new Thread(csta, "CSTA Thread");
cstaThread.start();

try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}

that is part of code in my CstaClient.java.

Why I am asking, after a longer while of running, I think my web app makes N-timer instatiations of the CstaClient, and older instatiations threads are still running?

## number 3:
I added support for client to setAgentState; it was matter of getting the method from LogicalDeviceFeatures to correct csta implementation.

So I added the method SetAgentState(device, agent, state) to CSTAFunctions, and then I called the correct one from the CSTAMulti implementation (CstaClient3000 - where I implemented tha call to ldsf (logical device features) )...

I thing that is the correct way? - If not please correct me...

Hope I wasnt too long, its been a while....
With best regards to Australia...
Kristjan

P.S. I have a working demo application I would like to share with others - so we can upload it somewhere...

Cool!

OK - I'll sort out svn write access for you and stuff..
I'll send you an email in the next few days and we'll work out what/how you want to do stuff, i.e. License, Pages on the site and whatever else.

## number 1 response
As for monitoring devices, I hope to come up with a diagram and post to the site for future reference, but it is something like this.


[PBX]------[CSTA Server monitoring a single device once]=========[Nx CSTA clents monitoring X number of devices]

In CSTAServer.java there is a hashtable called xref2list. http://server.trac.opencsta.org/browser/trunk/src/org/opencsta/server/CS...

There's a bit of client/hashtable juggling that goes on - some of the logic is, does this client already monitor other extensions, is this extension already being monitored.

Here, http://server.trac.opencsta.org/browser/trunk/src/org/opencsta/server/CS..., is what happens when a client asks to monitor an extension that is NOT being monitored.

Here, http://server.trac.opencsta.org/browser/trunk/src/org/opencsta/server/CS..., is what happens when the extension is already being monitored.

Basically, when an event comes through it has an crossReferenceId. If your app is the first client to monitor the extension, it's the only client in the list listening on that crossRef (stored in the list at that hashtable - xref2list) If there are already other clients waiting for events on this crossRef, then the server just relays the events to each client in the list.

This is a bit more efficient on the network, i.e. CSTAServer is a "proxy", and the Hipath 3000 is limited to 64 monitored extensions I believe.

You can get more fancy with monitoring because this is a bitmask configuration where a monitor (crossRefId) can be waiting for "only service initiated and connection cleared events" as an example. But it's easier to just listen for all events and filter them in your code as needed - there are plenty of CPU cycles compared to available Hipath monitoring slots (64), which can be easily exhausted.

## number 2 response
There's some left over threads? yuck.... Don't know - there shouldn't be. This I'll have to get back to you on.

## number 3 response
Sounds good. Because the ericsson and alcatel implementations may not have SetAgentState (different CSTA implementations across different vendors, the project may have to create a separate interface - but for the Siemens and how you've done it - that's fine!)

All software requires a bit of customisation these days :) And CSTA, even though it's an open standard, has it's minor differences between switches and manufacturers - and even within the same manufacturer (e.g. hipath 3000 vs hipath 4000!)

I'll contact you in the next few days,
BR
Chris

Ok, then... thank you for the

Ok, then...

thank you for the answers...

we will get in touch regarding svn...

I added some code for the agent event passing. There were some calls missing in CSTAMulti (call to parent) and in the specific implementation, in my case I added the call to CSTAMulti from CstaClient3000, to call the agentevent method handler. Now the agent event get passed to the correct implementation.

The changes were in CSTAMulti (method public void CSTAEventReceived(AgentEvent_Base currentEvent):
added call to parent:
parent.CSTAAgentEventReceived((AgentEvent) currentEvent);

and in CstaClient3000.java - added call to Csta Multi...

public void CSTAEventReceived(AgentEvent_Base event) {
cstaMulti.CSTAEventReceived(event);
}

before there were some printouts - they are still in multi - so no double printing to console...

with br and looking forward to hearing from you...

Kristjan