« Back to Cisco JTAPI Questions

CiscoProvTerminalRegisteredEv not being fired when JTAPI app first starts

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hi
 
I'm having this whole thing intermittently - I wrote an app that uses the CiscoProvTerminalRegisteredEv event to load certain terminal data (e.g. the current EM user - getEMUserLogin will only return the correct data if you wait for the event and if you call it when you get the CiscoTermInServiceEv you're too early). When I first wrote my software, I was getting one CiscoProvTerminalRegisteredEv for each phone currently registered with my CCM when I started up my app on CCM 7.1.3.10000.
 
Then I deployed the app at a customer.. they have 7.1.3.20000 - and I wasn't getting any of those events. Went back to my lab, same story there.. suddenly no events (if the phone is being reset, then I get the even when the phone registers again).
 
Then today morning, all of a sudden I'm getting the events again during application initialization. Then I reboot to the inactive partition (where I installed 7.1.3.30000 last week), and after the reboot - no more CiscoProvTerminalRegisteredEv. I swapped out the jtapi.jar for the one that comes with 7.1.3.30000 but to no avail.
 
What do I need to do to reliably get the CiscoProvTerminalRegisteredEv fired for each phone that is registered with CCM (and under JTAPI control of course) when my JTAPI app first starts up?

Hi Stephan,
 
To get these events application should register feature with feature id "CiscoProvFeatureID.TERMINAL_REGISTER_UNREGISTER_EVENT_NOTIFY"
 
Moreover, these events will only come for Terminals who unregisters/registers after provider comes in service. This is to reduce the event traffic at the start of applications because application could have lot of devices in control list.
 
So, it would be better to check Terminal state (unregistered/registered) through API "CiscoTerminal.isRegistered()" at the start of application and then update the app whenever you get CiscoProvTerminalRegisteredEv/CiscoProvTerminalUnRegisteredEv after that. HTH.
 
Regards,
Abhishek

Abishek
 
Of course I'm registering my provider for CiscoProvFeatureID.TERMINAL_REGISTER_UNREGISTER_EVENT_NOTIFY.
 
You said the events only come for terminals that register/unregister after the provider comes into service. Then how do you explain why I was getting the CiscoProvTerminalRegisteredEv event for every terminal that was online at the time I started my JTAPI app back when I developed the app last October (I went on an extended leave until end of January thereafter..) and why suddenly this morning I was once again getting them (and then this afternoon I no longer got them)? That doesn't make much sense, does it?
 
The reason why I like the events is because I need to get the EM login information from JTAP.. and due to a race condition, I only get the proper value once I get a CiscoProvTerminalRegisteredEv (for details see here: http://developer.cisco.com/web/jtapi/forums/-/message_boards/message/1672197). I'm currently working with devsupp on why I don't get the proper EM login information when my app starts up.. regardless of how long I delay querying the value - I only get the proper value for phones for which I have received a CiscoProvTerminalRegisteredE.

Hi Stephan,
 
The feature was designed such that CiscoProvTerminalRegisteredEv/CiscoProvTerminalUnRegisteredEv will be delivered for devices which register/unregister only after Provider state changes to IN_SERVICE. This was done to reduce the surge of such events at application start. If in case you are seeing such events before Provider is IN_SERVICE then i would call it a wrong behavior and can take a look into it if you have logs for that.
 
As far as your posting in other thread(http://developer.cisco.com/web/jtapi/forums/-/message_boards/message/1672197) is concerned:
We had a bug in 7.1.3 release where JTAPI use to return EM Login name as null even if device was EM logged in. This issue is already fixed in later releases and We were in discussion with our developer support where someone had raised a case for this with them. Based on that case, we are in process of porting the fix to 7.1(3). I am not sure if it is the same case which you had raised but the fix for that will be available in latest 7.1(3) by feb'2010 end.
 
Once the above fix is available, i believe you can have your application logic based on following:
At app start, once Provider comes IN_SERVICE, check whether CiscoTerminal is registered or not through isRegistered() API, you will also be able to check for EM Login information through getEMLoginUsername() API. From then on(i.e After the app start) you can rely on CiscoProvTerminalRegisteredEv/CiscoProvTerminalUnRegisteredEv and update your application for EM user login name information again on getting CiscoProvTerminalRegisteredEv.
 
Please let me know if you have any questions.
 
Regards,
Abhishek