public class CongestionControlMessageValve extends Object implements gov.nist.javax.sip.stack.SIPMessageValve, org.mobicents.commons.congestion.CongestionListener
CongestionControlTimerTask for the list of properties
A background task gathers information about the current server congestion. The data collection interval can be adjusted, and congestion control deactivated, by setting the interval to 0 or a
negative value through org.mobicents.ext.javax.sip.congestion.CONGESTION_CONTROL_MONITOR_INTERVAL property
The drop policy is specified in org.mobicents.ext.javax.sip.congestion.DROP_RESPONSE_STATUS
where "0" or negative value means silent drop and any positive number will be
interpreted as the status code of the error response that will be generated.
To enable this in your application you must specify this property:
gov.nist.javax.sip.SIP_MESSAGE_VALVE=org.mobicents.ext.javax.sip.congestion.CongestionControlMessageValve
It is advised to extend this class to add your application-specific control conditions or
if you need to add any header to the response generated back (like Retry-After Header)
by overriding the modifyCongestionResponse(SIPResponse response).| Modifier and Type | Field and Description |
|---|---|
protected ScheduledFuture |
congestionControlTimerFuture |
protected int |
dropResponseStatus |
protected SipStackExtension |
sipStack |
| Constructor and Description |
|---|
CongestionControlMessageValve() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
void |
init(javax.sip.SipStack stack) |
boolean |
isRejectMessages() |
protected void |
modifyCongestionResponse(gov.nist.javax.sip.message.SIPResponse response) |
void |
onCongestionFinish(String source) |
void |
onCongestionStart(String source) |
boolean |
processRequest(gov.nist.javax.sip.message.SIPRequest request,
gov.nist.javax.sip.stack.MessageChannel messageChannel) |
boolean |
processResponse(javax.sip.message.Response response,
gov.nist.javax.sip.stack.MessageChannel messageChannel) |
protected SipStackExtension sipStack
protected transient ScheduledFuture congestionControlTimerFuture
protected int dropResponseStatus
public boolean processRequest(gov.nist.javax.sip.message.SIPRequest request,
gov.nist.javax.sip.stack.MessageChannel messageChannel)
processRequest in interface gov.nist.javax.sip.stack.SIPMessageValveprotected void modifyCongestionResponse(gov.nist.javax.sip.message.SIPResponse response)
public boolean processResponse(javax.sip.message.Response response,
gov.nist.javax.sip.stack.MessageChannel messageChannel)
processResponse in interface gov.nist.javax.sip.stack.SIPMessageValvepublic void destroy()
destroy in interface gov.nist.javax.sip.stack.SIPMessageValvepublic void init(javax.sip.SipStack stack)
init in interface gov.nist.javax.sip.stack.SIPMessageValvepublic void onCongestionStart(String source)
onCongestionStart in interface org.mobicents.commons.congestion.CongestionListenerpublic void onCongestionFinish(String source)
onCongestionFinish in interface org.mobicents.commons.congestion.CongestionListenerpublic boolean isRejectMessages()
Copyright © 2016. All Rights Reserved.