My application now has a nice GUI and keeps track not only of the currently parked calls, but also of history for each park line for each store, all organized in an intuitive fashion so it's easy to find what you're looking for. (Still hate working in Java though...

) I've learned how to receive events when a call is parked, picked up, or <mostly> if a person hangs up while parked. This is done via the code below. However, there are a few things that I am missing which I'm hopeful somebody here will know how to solve or at least be able to point me in the right direction.
1
2<in my primary object, after the form creation and where it connects to the Call Manager>
3 CucmPeer=JtapiPeerFactory.getJtapiPeer(null);
4 CucmObserver=new CucmObs();
5 CucmObserver.SetParentObject(this);
6 CucmProvider=CucmPeer.getProvider("<provider connection string>");
7 System.out.println("Provider name: " + CucmProvider.getName());
8 CucmProvider.addObserver(CucmObserver);
9 while(((CiscoProvider) CucmProvider).getState() != Provider.IN_SERVICE)
10 {
11 System.out.println("Waiting for connection to server to become active...");
12 try
13 {
14 Thread.sleep(1500);
15 }
16 catch(Exception e)
17 {
18 System.out.println("Exception while sleeping!\n" + e);
19 System.exit(1);
20 }
21 }
22 ((CiscoProvider) CucmProvider).registerFeature(CiscoProvFeatureID.MONITOR_CALLPARK_DN);
23
24<below the main class>
25class CucmObs implements CiscoProviderObserver
26 {
27 frmMain ParentForm;
28
29 public void SetParentObject(frmMain parent)
30 {
31 ParentForm = parent;
32 return;
33 }
34
35 public synchronized void providerChangedEvent(ProvEv[] eventlist)
36 {
37 int counter;
38 try
39 {
40 for(counter=0; counter < eventlist.length; counter++)
41 {
42 System.out.println("provider change event - " + eventlist[counter].getID() + ", iteration " + counter);
43 if(eventlist[counter].getID() == CiscoProvCallParkEv.ID)
44 {
45 ProcessCallParkEvent(eventlist[counter]);
46//ProcessCallParkEvent is a private function in the same class; it sifts through the event and
47//eventually calls a function in ParentForm with a bunch of simple parameters to control the
48//display of calls and history for each line.
49 }
50 if(eventlist[counter].getID() == TermConnDroppedEv.ID)
51 {
52 System.out.println("caller hung up");
53 }
54 }
55 }
56 catch(Exception e)
57 {
58 System.out.println(e);
59 }
60 return;
61 }
Outstanding Issues:
1. If I call a phone via the internal 4-digit dial, am put on park, then hang up, there's no call park event generated. Because of this, I never know that the call has gone away and it gets 'stuck' in the display until somebody else is parked at that park extension.
2. If I call a phone via the PSTN, am put on park, then linger there until the park times out and the call reverts back to the phone which parked me, there's no call park event generated. Again, this leads to the parked call becoming 'stuck' in the display until somebody else is parked at that park extension.
3. In the debug logs generated in the application directory, there is all sorts of information shown - date and time of the server when the event was generated, the text name of the person if it's an internal extension, global call ID, etc. However, in the call park event, most of this information is not available according to the cisco API spec. I can work around some (date/time) and others aren't strictly necessary (text name of extension), but such information would be very nice to include if possible and not too cumbersome. Is there a method of accessing this information?
I'd appreciate any input or advice on these.