use of javax.sip.ResponseEvent in project XobotOS by xamarin.
the class SipSessionGroup method expectResponse.
/**
* @return true if the event is a response event and the CSeqHeader method
* match the given arguments; false otherwise
*/
private static boolean expectResponse(String expectedMethod, EventObject evt) {
if (evt instanceof ResponseEvent) {
ResponseEvent event = (ResponseEvent) evt;
Response response = event.getResponse();
return expectedMethod.equalsIgnoreCase(getCseqMethod(response));
}
return false;
}
use of javax.sip.ResponseEvent in project XobotOS by xamarin.
the class SipSessionGroup method expectResponse.
/**
* @return true if the event is a response event and the response code and
* CSeqHeader method match the given arguments; false otherwise
*/
private static boolean expectResponse(int responseCode, String expectedMethod, EventObject evt) {
if (evt instanceof ResponseEvent) {
ResponseEvent event = (ResponseEvent) evt;
Response response = event.getResponse();
if (response.getStatusCode() == responseCode) {
return expectedMethod.equalsIgnoreCase(getCseqMethod(response));
}
}
return false;
}
use of javax.sip.ResponseEvent in project XobotOS by xamarin.
the class SipProviderImpl method handleEvent.
/**
* Handle the SIP event - because we have only one listener and we are
* already in the context of a separate thread, we dont need to enque the
* event and signal another thread.
*
* @param sipEvent
* is the event to process.
*
*/
public void handleEvent(EventObject sipEvent, SIPTransaction transaction) {
if (sipStack.isLoggingEnabled()) {
sipStack.getStackLogger().logDebug("handleEvent " + sipEvent + "currentTransaction = " + transaction + "this.sipListener = " + this.getSipListener() + "sipEvent.source = " + sipEvent.getSource());
if (sipEvent instanceof RequestEvent) {
Dialog dialog = ((RequestEvent) sipEvent).getDialog();
if (sipStack.isLoggingEnabled())
sipStack.getStackLogger().logDebug("Dialog = " + dialog);
} else if (sipEvent instanceof ResponseEvent) {
Dialog dialog = ((ResponseEvent) sipEvent).getDialog();
if (sipStack.isLoggingEnabled())
sipStack.getStackLogger().logDebug("Dialog = " + dialog);
}
sipStack.getStackLogger().logStackTrace();
}
EventWrapper eventWrapper = new EventWrapper(sipEvent, transaction);
if (!sipStack.reEntrantListener) {
// Run the event in the context of a single thread.
this.eventScanner.addEvent(eventWrapper);
} else {
// just call the delivery method
this.eventScanner.deliverEvent(eventWrapper);
}
}
Aggregations