Interface SessionTimer
-
public interface SessionTimer
Interface for interacting with a dialog's session timer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.sip.message.Request
generateSessionRefreshRequest(String method)
Generate a session-refresh re-INVITE or UPDATE request using the dialog's current session timer options.javax.sip.message.Request
generateSessionRefreshRequest(String method, SessionTimerOptions newOptions)
Generate a session-refresh re-INVITE or UPDATE request using the specified session timer options.javax.sip.message.Response
generateSessionRefreshResponse(javax.sip.message.Request refresh)
Generates a 200 OK response to a session refresh request, based on the session timer headers in the request.javax.sip.message.Response
generateSessionRefreshResponse(javax.sip.message.Request refresh, SessionTimerOptions newOptions)
Generates a 200 OK response to a session refresh request, based on the session timer headers in the request and the given session timer options.SessionTimerOptions
getCurrentSessionTimerOptions()
Get the dialog's currently configured session timer options.boolean
isActive()
Determine if the dialog's session timer is active.boolean
isExpired()
Determine if the dialog's session timer has expired.
-
-
-
Method Detail
-
isActive
boolean isActive()
Determine if the dialog's session timer is active. If the session timer is not active, this means there will be no automatic session expiry on this dialog.- Returns:
- true if the dialog has an active session timer, otherwise false.
-
isExpired
boolean isExpired()
Determine if the dialog's session timer has expired. If so, the dialog should be terminated with a BYE.- Returns:
- true if the dialog's session timer (if it was using one) has expired, otherwise false.
-
getCurrentSessionTimerOptions
SessionTimerOptions getCurrentSessionTimerOptions()
Get the dialog's currently configured session timer options. These are the options established by the last successful session refresh request & response.- Returns:
- the dialog's current session timer options, or
SessionTimerOptions.NONE
if there is no session timer active
-
generateSessionRefreshRequest
javax.sip.message.Request generateSessionRefreshRequest(String method)
Generate a session-refresh re-INVITE or UPDATE request using the dialog's current session timer options.- Parameters:
method
- the request method, must be "INVITE" or "UPDATE".- Returns:
- a
Request
that may be used as a session refresh request. The request will contain Session-Expires and Min-SE headers based on the current session timer options.Note that INVITE requests should contain the current SDP for the session. it is the application's responsibility to add the SDP body to refresh requests.
-
generateSessionRefreshRequest
javax.sip.message.Request generateSessionRefreshRequest(String method, SessionTimerOptions newOptions)
Generate a session-refresh re-INVITE or UPDATE request using the specified session timer options.- Parameters:
method
- the request method, must be "INVITE" or "UPDATE".newOptions
- the refreshing parties' desired new session timer options. Note that the other party may adjust these options in the response, or even reject the request. An application should usegetCurrentSessionTimerOptions()
after a successful session refresh to see what options were actually agreed.
The valueSessionTimerOptions.NONE
is ignored, in this case the dialog's current session timer options will be reused in the refresh.
The valueSessionTimerOptions.PROXY
is not permitted here as proxy mode may only be selected at dialog creation time.- Returns:
- a
Request
that may be used as a session refresh request. The request will contain Session-Expires and Min-SE headers based on the given session timer options.Note that INVITE requests should contain the current SDP for the session. it is the application's responsibility to add the SDP body to refresh requests.
- Throws:
IllegalArgumentException
- if method is not "INVITE" or "UPDATE"; or if newOptions isSessionTimerOptions.PROXY
-
generateSessionRefreshResponse
javax.sip.message.Response generateSessionRefreshResponse(javax.sip.message.Request refresh)
Generates a 200 OK response to a session refresh request, based on the session timer headers in the request. The request's Session-Expires value will be copied into the responses' Session-Expires header. If there was no Session-Expires header, the dialog's current session expiry will be used. If the request's Session-Expires "refresher" parameter is not defined, then the response will have a "uac" or "uas" refresher parameter according to the dialog's currently selected refresher.Note that INVITE responses should contain the current SDP for the session. it is the application's responsibility to add the SDP body to refresh responses.
- Parameters:
refresh
- a session refresh re-INVITE or UPDATE request- Returns:
- a 200 OK response object
-
generateSessionRefreshResponse
javax.sip.message.Response generateSessionRefreshResponse(javax.sip.message.Request refresh, SessionTimerOptions newOptions)
Generates a 200 OK response to a session refresh request, based on the session timer headers in the request and the given session timer options. The request's Session-Expires value will be copied into the responses' Session-Expires header. If there was no Session-Expires header, the dialog's current session expiry will be used. If the request's Session-Expires "refresher" parameter is not defined, then the response will have a "uac" or "uas" refresher parameter according to the dialog's currently selected refresher.Note that INVITE responses should contain the current SDP for the session. it is the application's responsibility to add the SDP body to refresh responses.
- Parameters:
refresh
- a session refresh re-INVITE or UPDATE requestnewOptions
- the refreshee parties' desired new session timer options. Using the valueSessionTimerOptions.NONE
here is ignored, in this case the dialog's current session timer options will be used in the response.
The valueSessionTimerOptions.PROXY
is not permitted here as proxy mode may only be selected at dialog creation time.- Returns:
- a 200 OK response object
- Throws:
IllegalArgumentException
- if the request method is not "INVITE" or "UPDATE"; or if newOptions isSessionTimerOptions.PROXY
-
-