void Negotiating::FailureResponse( DialogTracker& impl, SipMessage& response, const char* address, int port ) const { int seqNum; UtlString seqMethod; if( response.getCSeqField( &seqNum, &seqMethod ) ) { if( seqMethod.compareTo( SIP_INVITE_METHOD ) == 0 ) { // session negotiation failed. Deallocate all the tentative // media relays tentatively allocated to handle the media // sessions that just failed. impl.deallocateAndClearAllMediaRelaySessions( true, true, false ); if( !impl.getDialogEstablishedFlag() ) { // this is a final failure response to a dialog-forming INVITE. That // event marks the end of the dialog hence, we do not need to continue // to track it. ChangeState( impl, impl.pMoribund ); } else { // the renegotiation failed but the dialog is still active. Go back to state where // we wait for an incoming INVITE. ChangeState( impl, impl.pWaitingForInvite ); } } else { OsSysLog::add(FAC_NAT,PRI_DEBUG,"'%s:%s' - Received unexpected successful response for %s request", impl.name(), impl.GetCurrentState()->name(), seqMethod.data() ); } } }
void WaitingForInvite::CleanUpTimerTick( DialogTracker& impl ) const { if( impl.getDialogEstablishedFlag() ) { // we have an established dialog - check it see if the media is still flowing if( !impl.wasMediaTrafficSeenInLastNSeconds( IDLE_MEDIA_MAXIMUM_IN_SECONDS ) ) { OsSysLog::add(FAC_NAT,PRI_WARNING,"'%s': Terminating dialog tracker due to excessive media inactivity period", impl.name() ); ChangeState( impl, impl.pMoribund ); } } }