use of com.sun.voip.TreatmentManager in project Openfire by igniterealtime.
the class CallSetupAgent method cancelRequest.
/**
* Cancel a call
*/
public void cancelRequest(String s) {
if (reasonCallTerminated != null || getState() == CallState.ENDED) {
return;
}
reasonCallTerminated = s;
if (inviteTimeoutThread != null) {
inviteTimeoutThread.interrupt();
inviteTimeoutThread = null;
}
if (Logger.logLevel >= Logger.LOG_INFO) {
Logger.println("Call " + callHandler + ": cancelling call, " + s);
}
if (callAnsweredTreatment != null) {
callAnsweredTreatment.stopTreatment();
}
if (callEstablishedTreatment != null) {
callEstablishedTreatment.stopTreatment();
}
if (getState() == CallState.ESTABLISHED) {
String endTreatment = cp.getCallEndTreatment();
if (endTreatment != null && cp.isConferenceMuted() == false) {
try {
MediaInfo mediaInfo = callHandler.getConferenceManager().getMediaInfo();
TreatmentManager callEndTreatment = new TreatmentManager(endTreatment, 0, mediaInfo.getSampleRate(), mediaInfo.getChannels());
setState(CallState.ENDING, "Reason='" + s + "'");
if (Logger.logLevel >= Logger.LOG_MOREINFO) {
Logger.println("Call " + callHandler + " adding end treatment...");
}
callEndTreatment.addTreatmentDoneListener(this);
callHandler.addTreatment(callEndTreatment);
return;
} catch (IOException e) {
Logger.error("Call " + callHandler + " " + e.getMessage());
}
}
}
// do subclass specific work
terminateCall();
setState(CallState.ENDING, "Reason='" + s + "'");
done();
}
Aggregations