}
public void provResponseReceived(SipResponse sipResponse, Transaction transaction) {
// dialog may have already been created if a previous 1xx has
// already been received
Dialog dialog = dialogManager.getDialog(sipResponse);
boolean isFirstProvRespWithToTag = false;
if (dialog == null) {
SipHeaderFieldValue to = sipResponse.getSipHeaders().get(
new SipHeaderFieldName(RFC3261.HDR_TO));
String toTag = to.getParam(new SipHeaderParamName(RFC3261.PARAM_TAG));
if (toTag != null) {
dialog = dialogManager.createDialog(sipResponse);
isFirstProvRespWithToTag = true;
} else {
//TODO maybe stop retransmissions
}
}
if (dialog != null) {
buildOrUpdateDialogForUac(sipResponse, transaction);
}
//
// if (dialog == null && sipResponse.getStatusCode() != RFC3261.CODE_100_TRYING) {
// logger.debug("dialog not found for prov response");
// isFirstProvRespWithToTag = true;
// SipHeaderFieldValue to = sipResponse.getSipHeaders()
// .get(new SipHeaderFieldName(RFC3261.HDR_TO));
// String toTag = to.getParam(new SipHeaderParamName(RFC3261.PARAM_TAG));
// if (toTag != null) {
// dialog = buildOrUpdateDialogForUac(sipResponse, transaction);
// }
// }
//TODO this notification is probably useless because dialog state modification
// thereafter always notify dialog observers
if (isFirstProvRespWithToTag) {
SipListener sipListener = userAgent.getSipListener();
if (sipListener != null) {
sipListener.ringing(sipResponse);
}
dialog.receivedOrSent1xx();
}
List<String> guiClosedCallIds = userAgent.getUac().getGuiClosedCallIds();
String callId = Utils.getMessageCallId(sipResponse);
if (guiClosedCallIds.contains(callId)) {
SipRequest sipRequest = transaction.getRequest();