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

[reSIProcate] forcing re-REGISTER


Resip Team,

I'm doing something tricky, and I don't know if it's safe.

I'm calling DialogUsageManager::send() from within
Transport::BuildFdSet() to force a re-REGISTER.

Is this safe to do?


Background:

I'm creating a new transport which sends all SIP traffic through a
tunnel to a remote end point. To gracefully handle the case that the
remote end point crashes, I have the transport attempt to create a new
tunnel. Once a new tunnel has been recreated, I want to force a REGISTER
to occur to inform the remote end that a new tunnel has been created.
For simplicity sake, I cause the REGISTER to occur from within the
transport itself.

Some Psuedo Code:

extern DialogUsageManager *dumUac;

void TunnelTransport::buildFdSet( FdSet& fdset )
{
        if (connection is broken) {
                // recreate tunnel

                // Force  re-REGISTER
                SipMessage regMessage = dumUac->makeRegistration(...);
                dumUac->send( regMessage );
        }
        // Continue with rest of buildFdSet
}


So far while testing this, it works fine, but I'm worried that there may
be some possible locking/re-entrancy issue that I've not yet hit. 

Is what I've done safe?

Thanks,
-Matt