Reusing a Flow

A UAC or a User Agent Server (UAS) may specify the flow to send messages on by using one of the following methods.

  • SipSession.setFlow(Flow flow).

  • Proxy.setFlow(Flow flow)

  • ProxyBranch.setFlow(Flow flow)

For example, a UAC can specify that the same flow that is used for sending REGISTER messages be used for sending INVITE messages as shown in Example 8-3.

Example 8-3 Reusing a Flow

void sendInvite(SipServletRequest invite){
  Flow flow = // Retrieve the flow...
  invite.getSession().setFlow(flow);
  invite.send();
}