Back-to-back User Agent machine to be used with Application Composition framework.
A subscriber port is associated with the caller when the machine is invoked in
the originating regsion, and with the callee when the machine is invoked in the
Receives INVITE on BoxPort.
Uses optional RequestModifier object to change Request-URI
for outgoing INVITE.
In CONNECTED state, INFO messages are passed transparently between
caller and callee.
Similar to the RI/TCK sample B2BUA application (version 1.0.9),
there are two unhandled protocol level race conditions:
1) CANCEL to callee and 200 OK to INVITE from callee crossed:
(RFC3261 sec 15)
Because the container has already sent 487 to caller, the application should
send ACK then BYE to callee to terminate the callee side.
2) CANCEL from caller and 200 OK to INVITE to caller crossed:
(JSR116 sec 7.2.3)
In the case where container receives CANCEL before application tries to send
200 OK to INVITE to caller side, the send() will throw IllegalStateException.
This exception should be caught, and the application sends ACK then BYE
to callee side to terminate the callee side dialog.
See TODO items in this file for places where additional handling should be added.