当前位置: 首页>>代码示例>>C++>>正文


C++ DialogTracker类代码示例

本文整理汇总了C++中DialogTracker的典型用法代码示例。如果您正苦于以下问题:C++ DialogTracker类的具体用法?C++ DialogTracker怎么用?C++ DialogTracker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DialogTracker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ChangeState

void WaitingFor200OkWithMediaOffer::ProvisionalResponse( DialogTracker& impl, SipMessage& response, const char* address, int port ) const
{
   if( response.getResponseStatusCode() != SIP_TRYING_CODE )
   {
      // RFC requires that all SDP previews be identical.  In ensure that this
      // requirement is met, we apply the saved copy of the patched SDP preview
      // to the response.
      if( response.hasSdpBody() )
      {
         impl.applyPatchedSdpPreview( response );
      }

      // we are receiving a provisional response - check if it is sent reliably...
      if( response.getHeaderValue( 0, SIP_RSEQ_FIELD ) )
      {
         // Presence of RSeq: header in the message indicates that it is sent reliably
         ChangeState( impl, impl.pWaitingForPrackWithMediaAnswer );
      }
      else
      {
         // We have received an unreliable provisional response - although that does
         // not cause a state machine state change, we need to reset the tick counter
         // to show that there is still activity in this dialog.
         impl.resetTimerTickCounter();
      }
   }
}
开发者ID:LordGaav,项目名称:sipxecs,代码行数:27,代码来源:DialogTrackerStates.cpp

示例2: ProvisionalResponse

void WaitingForMediaOffer::ProvisionalResponse( DialogTracker& impl, SipMessage& response, const char* address, int port ) const
{
   if( response.getResponseStatusCode() != SIP_TRYING_CODE )
   {
      // Both reliable and unreliable provisional responses can carry SDP bodies.  According to
      // draft-ietf-sipping-sip-offeranswer-04.txt section 3.1, unreliable provisional responses
      // carrying an offer is a mere preview of what the 'real' SDP offfer will be and that it
      // must be identical to it.  Since we may be changing the SDP of the 'real' offer to compensate
      // for NATs we need to also manipulate the 'preview' offer to make it meet the requirement that
      // the preview and 'real' offers be identical.
      impl.ProcessMediaOffer( response, INITIAL_OFFER_ANSWER );

      // we are receiving a provisional response - check if it is sent reliably...
      if( response.getHeaderValue( 0, SIP_RSEQ_FIELD ) )
      {
         // Presence of RSeq: header in the message indicates that it is sent reliably
         ChangeState( impl, impl.pWaitingForPrackWithMediaAnswer );
      }
      else
      {
         // We have received an unreliable provisional response - take a copy of the
         // patched SDP so that it can be re-applied to subsequent responses carrying
         // the same SDP body.
         impl.savePatchedSdpPreview( response );
         ChangeState( impl, impl.pWaitingFor200OkWithMediaOffer );
      }
   }
}
开发者ID:LordGaav,项目名称:sipxecs,代码行数:28,代码来源:DialogTrackerStates.cpp

示例3: ChangeState

void WaitingFor200OkforInvite::SuccessfulResponse( 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 )
      {
         // normally we would not be expecting this 200 OK response to carry
         // an SDP however we have encountered in the field some endpoints
         // that repeat the SDP answer they already sent in a previous
         // reliable provisional response (see XECS-2079 for the details).
         // Given that, if an SDP answer is found, we will reprocess it
         // to make sure it gets the same transformations that the initial
         // one got as per XECS-2089.
         if( response.hasSdpBody() )
         {
            impl.ProcessMediaAnswer( response, INITIAL_OFFER_ANSWER );
         }
         ChangeState( impl, impl.pWaitingForAckForInvite );
      }
      else
      {
         OsSysLog::add(FAC_NAT,PRI_DEBUG,"'%s:%s' - Received unexpected successful response for %s request",
               impl.name(), impl.GetCurrentState()->name(), seqMethod.data() );    
      }
   }   
}
开发者ID:mranga,项目名称:sipxecs,代码行数:29,代码来源:DialogTrackerStates.cpp

示例4: ProvisionalResponse

void WaitingForMediaAnswer::ProvisionalResponse( DialogTracker& impl, SipMessage& response, const char* address, int port ) const
{
   if( response.getResponseStatusCode() != SIP_TRYING_CODE )
   {
      if( response.hasSdpBody() )
      {
         // Both reliable and unreliable provisional responses can carry SDP bodies.  According to 
         // draft-ietf-sipping-sip-offeranswer-04.txt section 3.1, unreliable provisional responses
         // carrying an answer is a mere previes of what the 'real' SDP answer will be and that it
         // must be identical to it.  Since we may be changing the SDP of the 'real' answer to compensate
         // for NATs we need to also manipulate the 'preview' answer to make match the requirement that
         // the preview and 'real' answers be identical.
   
         // we are receiving a provisional response - check if it is sent reliably...
         impl.ProcessMediaAnswer( response, INITIAL_OFFER_ANSWER );
         if( response.getHeaderValue( 0, SIP_RSEQ_FIELD ) )
         {
            // Presence of RSeq: header in the message indicates that it is sent reliably
            ChangeState( impl, impl.pWaitingForPrack );
         }
         else
         {
            // We have received an unreliable provisional response - although that does
            // not cause a state machine state change, we need to reset the tick counter
            // to show that there is still activity in this dialog.
            impl.resetTimerTickCounter();            
         }
      }
   }
}
开发者ID:mranga,项目名称:sipxecs,代码行数:30,代码来源:DialogTrackerStates.cpp

示例5: SuccessfulResponse

void ProcessingPrack::SuccessfulResponse( 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 )
      {
         // normally we would not be expecting this 200 OK response to carry
         // an SDP in this state however we have encountered in the field some endpoints
         // that repeat the SDP answer they already sent in a previous
         // Successful response (see XECS-2079 for the details).
         // Given that, if an SDP answer is found, we will reprocess it
         // to make sure it gets the same transformations that the initial
         // one got as per XECS-2089.
         if( response.hasSdpBody() )
         {
            impl.ProcessMediaAnswer( response, INITIAL_OFFER_ANSWER );
         }
      }
      else
      {
         OsSysLog::add(FAC_NAT,PRI_DEBUG,"'%s:%s' - Received unexpected Successful Response for %s request",
               impl.name(), impl.GetCurrentState()->name(), seqMethod.data() );
      }
      // We have received a response - although that does
      // not cause a state machine state change, we need to reset the tick counter
      // to show that there is still activity in this dialog.
      impl.resetTimerTickCounter();
   }
}
开发者ID:LordGaav,项目名称:sipxecs,代码行数:32,代码来源:DialogTrackerStates.cpp

示例6: FailureResponse

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() );    
      }
   }   
}
开发者ID:mranga,项目名称:sipxecs,代码行数:35,代码来源:DialogTrackerStates.cpp

示例7: AckRequest

bool WaitingForAckForInvite::AckRequest( DialogTracker& impl, SipMessage& request, TransactionDirectionality direction, const char* address, int port ) const
{
   impl.setDialogEstablishedFlag();
   impl.promoteTentativeMediaRelaySessionsToCurrent();
   ChangeState( impl, impl.pWaitingForInvite );
   return false;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:7,代码来源:DialogTrackerStates.cpp

示例8: CleanUpTimerTick

void TimeBoundState::CleanUpTimerTick( DialogTracker& impl ) const
{
   if( impl.incrementTimerTickCounter() >= MAX_TIMER_TICK_COUNTS_BEFORE_DIALOG_TRACKER_CLEAN_UP )
   {
      OsSysLog::add(FAC_NAT,PRI_DEBUG,"'%s:%s' - cleaning up stale dialog tracker",
             impl.name(), impl.GetCurrentState()->name() );         
      ChangeState( impl, impl.pMoribund );      
   }
}
开发者ID:mranga,项目名称:sipxecs,代码行数:9,代码来源:DialogTrackerStates.cpp

示例9: SuccessfulResponse

void DialogTrackerState::SuccessfulResponse( DialogTracker& impl, SipMessage& response, const char* address, int port ) const
{
   if( impl.isARetransmittedResponse( response ) )
   {
      impl.restoreSdpBodyOfRetransmittedResponse( response );
   }
   else
   {
      OsSysLog::add(FAC_NAT,PRI_WARNING,"'%s': Received unexpected event SuccessfulResponse while in state '%s'",
            impl.name(), impl.GetCurrentState()->name() );
   }
}
开发者ID:mranga,项目名称:sipxecs,代码行数:12,代码来源:DialogTrackerStates.cpp

示例10: UpdateRequest

bool DialogTrackerState::UpdateRequest( DialogTracker& impl, SipMessage& request, TransactionDirectionality direction, const char* address, int port ) const
{
   if( impl.isARetransmittedRequest( request ) )
   {
      impl.restoreSdpBodyOfRetransmittedRequest( request );
   }
   else
   {
      OsSysLog::add(FAC_NAT,PRI_WARNING,"'%s': Received unexpected event UpdateRequest while in state '%s'",
            impl.name(), impl.GetCurrentState()->name() );
   }
   return true;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:13,代码来源:DialogTrackerStates.cpp

示例11: PrackRequest

bool WaitingForPrack::PrackRequest( DialogTracker& impl, SipMessage& request, TransactionDirectionality direction, const char* address, int port ) const
{
   if( request.hasSdpBody() )
   {
      impl.ProcessMediaOffer( request, NON_INITIAL_OFFER_ANSWER );
      ChangeState( impl, impl.pWaitingFor200OkWithAnswerForPrack );
   }
   else
   {
      ChangeState( impl, impl.pWaitingFor200OkForPrack );
   }
   return true;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:13,代码来源:DialogTrackerStates.cpp

示例12: DialogTracker

DialogTracker* SessionContext::allocateNewDialogTrackerBasedOnReference( const UtlString& discriminatingTag )
{
   DialogTracker* pNewDialogTracker = 0;
   pNewDialogTracker = new DialogTracker( *mpReferenceDialogTracker, discriminatingTag );
   if( pNewDialogTracker )
   {
      addDialogTrackerToList( discriminatingTag, pNewDialogTracker );
      OsSysLog::add(FAC_NAT, PRI_DEBUG, "SessionContext[%s]::allocateNewDialogTrackerBasedOnReference: allocated DialogTracker #%zd for tag %s",
                                         mHandle.data(), getNumberOfTrackedDialogs(), discriminatingTag.data() );

      // We have a new tracker that is utilizing the same Media RelaySessions as the
      // reference.  Increment their link count to track the number of DialogTrackers using
      // them and avoid premature de-allocations.
      size_t index;
      size_t numSavedMediaDescriptors = pNewDialogTracker->getNumberOfMediaDescriptors();
      for( index = 0; index < numSavedMediaDescriptors; index++ )
      {
         const MediaDescriptor* pMediaDescriptor;
         pMediaDescriptor = pNewDialogTracker->getReadOnlyMediaDescriptor( index );
         tMediaRelayHandle tempMediaRelayHandle;

         if( ( tempMediaRelayHandle = pMediaDescriptor->getTentativeInitialMediaRelayHandle() ) != INVALID_MEDIA_RELAY_HANDLE )
         {
            mpMediaRelay->incrementLinkCountOfMediaRelaySession( tempMediaRelayHandle );
         }

         if( ( tempMediaRelayHandle = pMediaDescriptor->getTentativeNonInitialMediaRelayHandle() ) != INVALID_MEDIA_RELAY_HANDLE )
         {
            mpMediaRelay->incrementLinkCountOfMediaRelaySession( tempMediaRelayHandle );
         }

         if( ( tempMediaRelayHandle = pMediaDescriptor->getCurrentMediaRelayHandle() ) != INVALID_MEDIA_RELAY_HANDLE )
         {
            mpMediaRelay->incrementLinkCountOfMediaRelaySession( tempMediaRelayHandle );
         }
      }
   }
   return pNewDialogTracker;
}
开发者ID:LordGaav,项目名称:sipxecs,代码行数:39,代码来源:SessionContext.cpp

示例13: getNumberOfTrackedDialogs

void SessionContext::handleCleanUpTimerTick( void )
{
   ssize_t numberOfDialogTrackersEnteringRoutine = getNumberOfTrackedDialogs();
   UtlHashMapIterator dialogTrackerIterator( mDialogTrackersMap );

   while( dialogTrackerIterator() )
   {
      DialogTracker *pDialogTracker;
      pDialogTracker = dynamic_cast<DialogTracker*>( dialogTrackerIterator.value() );

      pDialogTracker->handleCleanUpTimerTick();
   }

   // Check if the processing of the request caused the last DialogTracker to be deleted.
   // If so, the SessionContext is not required anymore therefore tell the CallTracker that
   // we are ready for deletion
   if( numberOfDialogTrackersEnteringRoutine &&
       deleteDialogTrackersReadyForDeletion() == numberOfDialogTrackersEnteringRoutine )
   {
      mpOwningCallTracker->reportSessionContextReadyForDeletion( mHandle );
   }
}
开发者ID:LordGaav,项目名称:sipxecs,代码行数:22,代码来源:SessionContext.cpp

示例14: InviteRequest

bool DialogTrackerState::InviteRequest( DialogTracker& impl, SipMessage& request, TransactionDirectionality direction, const char* address, int port  ) const
{
    if( !impl.isRequestAlreadyHandledByOther( request ) )
    {
        impl.markRequestAsHandledByUs( request );
    }

    if( impl.isARetransmittedRequest( request ) )
    {
        impl.restoreSdpBodyOfRetransmittedRequest( request );
    }
    else
    {
        Os::Logger::instance().log(FAC_NAT,PRI_WARNING,"'%s': Received unexpected event InviteRequest while in state '%s'",
                                   impl.name(), impl.GetCurrentState()->name() );
    }
    return true;
}
开发者ID:kingservice,项目名称:sipxecs,代码行数:18,代码来源:DialogTrackerStates.cpp

示例15: InviteRequest

bool WaitingForInvite::InviteRequest( DialogTracker& impl, SipMessage& request, TransactionDirectionality direction, const char* address, int port ) const
{
   bool bTrackRequestResponse = false;
   impl.setTransactionDirectionality( direction );

   // check is another sipX is already taking care of NAT traversing this session. 
   if( !impl.isRequestAlreadyHandledByOther( request ) )
   {
      bTrackRequestResponse = true;
      impl.markRequestAsHandledByUs( request );
      // check if the INVITE contains an SDP offer
      if( request.hasSdpBody() )
      {
         // request contains an SDP offer.  Check if the SDP or the or the actual
         // location of the two endpoints impose the use of a media relay. 
         if( impl.doesEndpointsLocationImposeMediaRelay() )
         {
            OsSysLog::add(FAC_NAT,PRI_DEBUG,"'%s:%s' - Media relay required",
                  impl.name(), impl.GetCurrentState()->name() );   
            impl.setMediaRelayRequiredFlag();
         }
         else
         {
            OsSysLog::add(FAC_NAT,PRI_DEBUG,"'%s:%s' - Media relay not required",
                  impl.name(), impl.GetCurrentState()->name() );    
            impl.clearMediaRelayRequiredFlag();
         }
         impl.ProcessMediaOffer( request, INITIAL_OFFER_ANSWER );         
         ChangeState( impl, impl.pWaitingForMediaAnswer );
      }
      else
      {
         // request does contains an SDP offer.  This INVITE may be used to set up a 3PCC
         // call.  Play it safe and impose the use of a media relay to guarantee speechpath
         impl.setMediaRelayRequiredFlag();
         ChangeState( impl, impl.pWaitingForMediaOffer );
      }
   }
   else
   {
      // this particular session is already being handled by another sipX i nthe network.
      // That sipX is taking care of overcoming the NATs that separate the endpoints involved
      // in that session.  There isn't much value we can add here so just bail on tracking that
      // session.
      ChangeState( impl, impl.pMoribund );
   }
   return bTrackRequestResponse;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:48,代码来源:DialogTrackerStates.cpp


注:本文中的DialogTracker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。