|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Max-Forwards header field must be used with any SIP method to limit the number of proxies or gateways that can forward the request to the next downstream server. This can also be useful when the client is attempting to trace a request chain that appears to be failing or looping in mid-chain.
The Max-Forwards value is an integer in the range 0-255 indicating the remaining number of times this request message is allowed to be forwarded. This count is decremented by each server that forwards the request. The recommended initial value is 70.
This header field should be inserted by elements that can not otherwise guarantee loop detection. For example, a B2BUA should insert a Max-Forwards header field.
For Example:
Max-Forwards: 6
Field Summary | |
static String |
NAME
Name of MaxForwardsHeader |
Method Summary | |
void |
decrementMaxForwards()
This convenience function decrements the number of max-forwards by one. |
int |
getMaxForwards()
Gets the maximum number of forwards value of this MaxForwardsHeader. |
void |
setMaxForwards(int maxForwards)
Sets the max-forwards argument of this MaxForwardsHeader to the supplied maxForwards value. |
Methods inherited from interface javax.sip.header.Header |
clone, equals, getName, toString |
Field Detail |
public static final String NAME
Method Detail |
public void decrementMaxForwards() throws TooManyHopsException
TooManyHopsException
- if implementation cannot decrement
max-fowards i.e. max-forwards has reached zeropublic int getMaxForwards()
public void setMaxForwards(int maxForwards) throws InvalidArgumentException
maxForwards
- - the number of max-forwards
InvalidArgumentException
- if the maxForwards argument is less
than 0 or greater than 255.
|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |