org.mobicents.servlet.sip.proxy
Class ProxyBranchImpl

java.lang.Object
  extended by org.mobicents.servlet.sip.proxy.ProxyBranchImpl
All Implemented Interfaces:
java.io.Serializable, ProxyBranch

public class ProxyBranchImpl
extends java.lang.Object
implements ProxyBranch, java.io.Serializable

Author:
root
See Also:
Serialized Form

Field Summary
 javax.sip.header.ViaHeader viaHeader
           
 
Constructor Summary
ProxyBranchImpl(URI uri, ProxyImpl proxy)
           
 
Method Summary
 void addRecursedBranch(ProxyBranchImpl branch)
           
 void cancel()
           
 void cancel(java.lang.String[] protocol, int[] reasonCode, java.lang.String[] reasonText)
           
 void cancelTimer()
          Stop the C Timer.
 boolean getAddToPath()
          
 SipURI getPathURI()
          
 SipServletRequestImpl getPrackOriginalRequest()
           
 Proxy getProxy()
           
 int getProxyBranchTimeout()
           
 boolean getRecordRoute()
          
 SipURI getRecordRouteURI()
           
 boolean getRecurse()
          
 java.util.List<ProxyBranch> getRecursedProxyBranches()
           
 SipServletRequest getRequest()
           
 SipServletResponse getResponse()
           
 boolean isCanceled()
           
 boolean isStarted()
           
 boolean isTimedOut()
          Has the branch timed out?
 boolean isWaitingForPrack()
           
 void onResponse(SipServletResponseImpl response)
          A callback.
 void onTimeout()
          This callback is called when the remote side has been idle too long while establishing the dialog.
 void proxyDialogStateless(SipServletRequestImpl request)
          This method proxies requests without updating JSIP dialog state.
 void proxySubsequentRequest(SipServletRequestImpl request)
          Call this method when a subsequent request must be proxied through the branch.
 void setAddToPath(boolean isAddToPath)
          
 void setOutboundInterface(java.net.InetAddress inetAddress)
          
 void setOutboundInterface(java.net.InetSocketAddress inetSocketAddress)
          
 void setPrackOriginalRequest(SipServletRequestImpl prackOriginalRequest)
           
 void setProxyBranchTimeout(int seconds)
           
 void setRecordRoute(boolean isRecordRoute)
          
 void setRecurse(boolean isRecurse)
          
 void setResponse(SipServletResponse response)
           
 void setWaitingForPrack(boolean waitingForPrack)
           
 void start()
          After the branch is initialized, this method proxies the initial request to the specified destination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viaHeader

public transient javax.sip.header.ViaHeader viaHeader
Constructor Detail

ProxyBranchImpl

public ProxyBranchImpl(URI uri,
                       ProxyImpl proxy)
Method Detail

cancel

public void cancel()
Specified by:
cancel in interface ProxyBranch

cancel

public void cancel(java.lang.String[] protocol,
                   int[] reasonCode,
                   java.lang.String[] reasonText)
Specified by:
cancel in interface ProxyBranch

getProxy

public Proxy getProxy()
Specified by:
getProxy in interface ProxyBranch

getProxyBranchTimeout

public int getProxyBranchTimeout()
Specified by:
getProxyBranchTimeout in interface ProxyBranch

getRecordRouteURI

public SipURI getRecordRouteURI()
Specified by:
getRecordRouteURI in interface ProxyBranch

getRecursedProxyBranches

public java.util.List<ProxyBranch> getRecursedProxyBranches()
Specified by:
getRecursedProxyBranches in interface ProxyBranch

addRecursedBranch

public void addRecursedBranch(ProxyBranchImpl branch)

getRequest

public SipServletRequest getRequest()
Specified by:
getRequest in interface ProxyBranch

getResponse

public SipServletResponse getResponse()
Specified by:
getResponse in interface ProxyBranch

setResponse

public void setResponse(SipServletResponse response)

isStarted

public boolean isStarted()
Specified by:
isStarted in interface ProxyBranch

setProxyBranchTimeout

public void setProxyBranchTimeout(int seconds)
Specified by:
setProxyBranchTimeout in interface ProxyBranch

start

public void start()
After the branch is initialized, this method proxies the initial request to the specified destination. Subsequent requests are proxied through proxySubsequentRequest


onResponse

public void onResponse(SipServletResponseImpl response)
A callback. Here we receive all responses from the proxied requests we have sent.

Parameters:
response -

isTimedOut

public boolean isTimedOut()
Has the branch timed out?

Returns:

proxySubsequentRequest

public void proxySubsequentRequest(SipServletRequestImpl request)
Call this method when a subsequent request must be proxied through the branch.

Parameters:
request -

proxyDialogStateless

public void proxyDialogStateless(SipServletRequestImpl request)
This method proxies requests without updating JSIP dialog state. PRACK and re-INVITE requests require this kind of handling because: 1. PRACK occurs before a dialog has been established (and also produces OKs before the final response) 2. re-INVITE when sent with the dialog method resets the internal JSIP CSeq counter to 1 every time you need it, which causes issues like http://groups.google.com/group/mobicents-public/browse_thread/thread/1a22ccdc4c481f47

Parameters:
request -

onTimeout

public void onTimeout()
This callback is called when the remote side has been idle too long while establishing the dialog.


cancelTimer

public void cancelTimer()
Stop the C Timer.


isCanceled

public boolean isCanceled()

getAddToPath

public boolean getAddToPath()

Specified by:
getAddToPath in interface ProxyBranch

getPathURI

public SipURI getPathURI()

Specified by:
getPathURI in interface ProxyBranch

getRecordRoute

public boolean getRecordRoute()

Specified by:
getRecordRoute in interface ProxyBranch

getRecurse

public boolean getRecurse()

Specified by:
getRecurse in interface ProxyBranch

setAddToPath

public void setAddToPath(boolean isAddToPath)

Specified by:
setAddToPath in interface ProxyBranch

setOutboundInterface

public void setOutboundInterface(java.net.InetAddress inetAddress)

Specified by:
setOutboundInterface in interface ProxyBranch

setOutboundInterface

public void setOutboundInterface(java.net.InetSocketAddress inetSocketAddress)

Specified by:
setOutboundInterface in interface ProxyBranch

setRecordRoute

public void setRecordRoute(boolean isRecordRoute)

Specified by:
setRecordRoute in interface ProxyBranch

setRecurse

public void setRecurse(boolean isRecurse)

Specified by:
setRecurse in interface ProxyBranch

setPrackOriginalRequest

public void setPrackOriginalRequest(SipServletRequestImpl prackOriginalRequest)
Parameters:
prackOriginalRequest - the prackOriginalRequest to set

getPrackOriginalRequest

public SipServletRequestImpl getPrackOriginalRequest()
Returns:
the prackOriginalRequest

isWaitingForPrack

public boolean isWaitingForPrack()

setWaitingForPrack

public void setWaitingForPrack(boolean waitingForPrack)


Copyright © 2009. All Rights Reserved.