< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate] DUM state machine


Hi everyone,

I have a question about the UAS state machine in DUM.
void
ServerInviteSession::accept(int code)
{
...
     case UAS_OfferProvidedAnswer:
     case UAS_EarlyProvidedAnswer:
        transition(UAS_Accepted);
        sendAccept(code, mCurrentLocalSdp.get());
        handler->onConnected(getSessionHandle(), mInvite200);
        break;
...

I am curious as to why the state transitions to UAS_Accepted, and the onConnected handler is called. I thought that the onConnected handler would be called after the ACK arrives.

Also,

void
ServerInviteSession::dispatchAccepted(const SipMessage& msg)
{
...
     case OnAck:
     {
        mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
        transition(Connected);
// handler->onConnected(getSessionHandle(), msg); // not needed since onConnected is called when 200 is sent
        break;
     }

I noticed that in the ServerInviteSession::dispatchAccepted(const SipMessage& msg) method that there used to be a call to the onConnected handler function in the OnAck case that has been commented out although the state transitions to Connected. Again, why is onConnected commented out?

The reason I am asking is that I am using DUM to build a B2BUA and came across an exception when calling requestOffer() if the state is not 'connected'. It's just a small window from sending the response to getting the ACK that the session is in the state UAS_Accepted before it truly gets to the COnnected state.

Thanks,
Steve Robichaud
Upstream Works