03-23-2015 05:32 AM
Hi,
I'm having an issue with a JTAPI application I'm building. The application reacts to an incoming connection to a listener on a CTI route point. I'm working with CUCM 8.6 and Cisco IP Communicator.
The normal flow is: - User dials a directory number
- A connected JTAPI application picks up on the call connection event.
- The application gets the call information
- The application disconnects the two connections (calling and receiving connections)
- Sends XML response to the terminal which originally called.
This works fine sometimes. But other times I'm getting an InvalidStateException when disconnecting the calling terminal. I've checked the state the call is in and when this exception occurs it says that the state is already disconnected. When my application disconnects the connection, the calling terminal will lose the dialling interface. But when my application can't disconnect the connection this interface will remain there until the user exits it. The phone can still receive incoming calls so it's a minor issue.
There's no pattern to when it will occur and when everything works fine. I think it may simply be a race condition between my app disconnection the connection and CallManager doing the same, but I'm not sure.
Has anyone experienced something similar or have any ideas?
03-23-2015 09:46 AM
When application disconnects both the connections in the call the second disconnect could fail depending on when then call leg is cleared. In a 2 party call there is no need to disconnect both the connections. Application can disconnect one connection and except to see call go to INVALID state.
Is the caller always observed? You can call disconnect only for observed addresses.
04-01-2015 04:45 AM
Hi Mohan, thanks for the reply.
I added an observer to the calling address and it seems to have improved the situation, but there are still rare instances where an InvalidStateException is thrown. When this happens, the state being reported for the connection is DISCONNECTED.
I've tried to simply disconnect one connection rather than both. Upon disconnecting the receiving end of the connection (The CTI route point end) the call interface on the calling IP phone will always remain. Now, if I try to disconnect the calling terminal's connection, It actually won't allow me to, again because of an InvalidStateException. However, the state of the connection being reported is CONNECTED, so I'm thinking that I may be missing something obvious which is preventing me from disconnecting that connection. I have observers on the call, the calling terminal and the calling address. The user being used for the program has control over the device too.
I'm sure it's a case of a race condition which is causing the current InvalidStateException occurrences, due to my program trying to disconnect both connections in sequence. But I'm thinking there is a fundamental issue in the program which is preventing me from disconnecting the calling connection.
04-14-2015 09:17 PM
As Mohan specified u need to disconnect only CTI Port end, other end will disconnect automatically. If call at other end not clearing then this could me media codec issue between 2 ends. We also faced this kind of problem sometimes. Try to add all codecs in CTI Port registration.
Regards,
Umesh
04-15-2015 02:50 AM
Hi Umesh,
The codec may be the issue. I had considered and looked at it before but only for a short amount of time.
I'll consentrate on that area.
Thank you.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide