Author Message
liu159
Joined: Jan 19, 2015
Messages: 96
Offline
After the call is initiated, how can I access to this call object if I want to write code to drop it ?

Do I have to store this object (maybe in a Hashmap) or is there any function (maybe with an ID) such that I can access to it whenever I want ?
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
A number of solutions exist. You do not necessarily need to store a handle to the actual object. CallFactory allows you to get a handle to a Call object using a Call ID. One thing that is nice about this approach is that you could do this lookup on a different EDP server than the one that initially handled the call (though within the same cluster). EDP supports cross-node call control invocations (to drop calls, for instance). Note that cross-node media invocations are NOT supported at this point.

The question I have for you to help further with the design is, what event will occur that will prompt you to drop a call? Expiration of a timer? An incoming HTTP message? Consider whether there is a way to store a call ID in some other object or HttpSession that will enable you to avoid having your own global hashmap.
liu159
Joined: Jan 19, 2015
Messages: 96
Offline
The scenario is like this:

We have a web UI to initiate the call (on the server). After the call is initiated we will have a callId sent back from the server to the UI and wait for the user actions. There will also be a Timer running on the UI (counting down for 1 minute). If the user does not pick up the call in 1 minute, the web UI will send an HTTP request to the server and ask the server to drop that call, and then update the call status to be Timeout.

Another approach is to have a timer associated with the call and in the timeout() method drop that call in certain time. But I' not sure if this is a better way since each timer will create a new thread running inside the service, when we have multiple calls need to be handled, will these threads have some bad effects ? Another thing is that if we do this way then in the timeout() method I also have to send notification back to the web ui. Since HTTP request is a one way communication, we will have to either use asynchronous request (tried to but failed) or open a web socket. That will make thing more complicated. We are using simple HTTP polling to update status of calls right now. BTW, I also tried EJB Timer but got confused about the Properties and InitialContext in the example you gave me in another post. Is there any example in SDK which uses a Timer service so I can see how to get the Properties and InitialContext in the project ?
Go to:   
Mobile view