Sun GlassFish Communications Server 2.0 릴리스 노트

해결 방법

SIP 세션과 HTTP 세션의 서로 다른 만료 시간 처리 문제를 해결하는 가장 좋은 방법은 SAS 만료 시간을 충분히 하여 시작하는 것입니다. 여러 HTTP 요청을 포함하여 응용 프로그램 세션이 활성 상태로 있을 시간을 충분히 하십시오. 특히 마지막 프로토콜 하위 세션이 무효화될 때 SipApplicationSession이 무효화되는 invalidateWhenReady 어휘가 사용되는 경우 SAS 수명을 무한으로 설정할 수도 있습니다. SAS에 대한 초기 만료 시간은 배포 설명자에서 구성할 수 있습니다.

최대 총 기간을 미리 추정할 수 있으면, SAS가 만료될 때 SIP 세션과 HTTP 세션을 모두 무효화하는 것이 적절하므로, 추가 코드는 필요 없습니다. 최대 기간을 미리 추정할 수 없으면, 아래 코드 조각에 나타난 대로, SipApplicationSession이 만료될 때 이를 연장할 수 있습니다.

SipApplicationSessionListener 구현 시 다음과 같은 작업을 수행할 수 있습니다.

public void sessionExpired(SipApplicationSessionEvent sasEvent) {
                // check if the SAS needs to be extended first, if so:
		int granted = sasEvent.getApplicationSession().setExpires(2);
		if (granted <= 0) {
			System.out.println("extension rejected");
		} else if (granted < 2) {
			System.out.println("extension granted with lower value " + granted);
		} // else allowed 
	}