I'm not sure what is the issue here, since your code is quite straight forward! One small note is that, according to the documentation, the "release" request takes no parameters, while you have specified an empty string parameter. I'm not convinced that it will make a difference, but it may be worth changing this.
Another known issue with session release is that there are actually two sessions to be considered - the Telephony Web Services (TWS) session and the Tomcat session. Although you may have successfully ended the TWS session, it is possible that the Tomcat session is still hanging around (and, possibly, holding on to the CM connection). The release of the Tomcat sessions is known to be a "lazy" mechanism. Essentially, Tomcat does not release a session immediately. Instead, the released session is put on an "expired" queue, and Tomcat gets around to releasing its expired sessions at a later. time
If it is possible, I recommend that, instead of releasing your TWS session (and then creating a new one) you try to re-use it. If this is not possible, you can try increasing the allowed number of concurrent connections to CM. Having more concurrent connections may allow Tomcat more time to clean up its expired sessions.
|