/[resiprocate]/main/resip/dum/InviteSession.cxx
ViewVC logotype

Diff of /main/resip/dum/InviteSession.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3430 by nash, Tue Nov 2 08:27:43 2004 UTC revision 3431 by kenho, Tue Nov 2 12:17:27 2004 UTC
# Line 170  Line 170 
170        CSeqToMessageMap::iterator it = mFinalResponseMap.find(timeout.seq());        CSeqToMessageMap::iterator it = mFinalResponseMap.find(timeout.seq());
171        if (it != mFinalResponseMap.end())        if (it != mFinalResponseMap.end())
172        {        {
173           // BYE could be queued if end() is called when we are still waiting for far end ACK to be received           // RESIP_BYE could be queued if end() is called when we are still waiting for far end RESIP_ACK to be received
174           if (mQueuedBye)           if (mQueuedBye)
175           {           {
176              mState = Terminated;              mState = Terminated;
# Line 271  Line 271 
271           }           }
272           else           else
273           {           {
274              // Start Session-Expiration Timer to mSessionInterval - BYE should be sent a minimum of 32 or SessionInterval/3 seconds before the session expires (recommended by draft-ietf-sip-session-timer-15)              // Start Session-Expiration Timer to mSessionInterval - RESIP_BYE should be sent a minimum of 32 or SessionInterval/3 seconds before the session expires (recommended by draft-ietf-sip-session-timer-15)
275              mDum.addTimer(DumTimeout::SessionExpiration, mSessionInterval - resipMin(32,mSessionInterval/3), getBaseHandle(), ++mSessionTimerSeq);              mDum.addTimer(DumTimeout::SessionExpiration, mSessionInterval - resipMin(32,mSessionInterval/3), getBaseHandle(), ++mSessionTimerSeq);
276           }           }
277        }        }
# Line 331  Line 331 
331           }           }
332           else           else
333           {           {
334              // Start Session-Expiration Timer to mSessionInterval - BYE should be sent a minimum of 32 or SessionInterval/3 seconds before the session expires (recommended by draft-ietf-sip-session-timer-15)              // Start Session-Expiration Timer to mSessionInterval - RESIP_BYE should be sent a minimum of 32 or SessionInterval/3 seconds before the session expires (recommended by draft-ietf-sip-session-timer-15)
335              mDum.addTimer(DumTimeout::SessionExpiration, mSessionInterval - resipMin(32,mSessionInterval/3), getBaseHandle(), ++mSessionTimerSeq);              mDum.addTimer(DumTimeout::SessionExpiration, mSessionInterval - resipMin(32,mSessionInterval/3), getBaseHandle(), ++mSessionTimerSeq);
336           }           }
337        }        }
# Line 390  Line 390 
390        mFinalResponseMap.erase(msg.header(h_CSeq).sequence());        mFinalResponseMap.erase(msg.header(h_CSeq).sequence());
391        if (msg.header(h_CSeq).sequence() == mLastIncomingRequest.header(h_CSeq).sequence())        if (msg.header(h_CSeq).sequence() == mLastIncomingRequest.header(h_CSeq).sequence())
392        {        {
393           // BYE could be queued if end() is called when we are still waiting for far end ACK to be received           // RESIP_BYE could be queued if end() is called when we are still waiting for far end RESIP_ACK to be received
394           if (mQueuedBye)           if (mQueuedBye)
395           {           {
396              mState = Terminated;              mState = Terminated;
# Line 405  Line 405 
405           {                               {                    
406              if (mOfferState == Answered)              if (mOfferState == Answered)
407              {              {
408                 //SDP in invite and in ACK.                 //SDP in invite and in RESIP_ACK.
409                 mDum.mInviteSessionHandler->onIllegalNegotiation(getSessionHandle(), msg);                 mDum.mInviteSessionHandler->onIllegalNegotiation(getSessionHandle(), msg);
410              }              }
411              else              else
# Line 422  Line 422 
422           //temporary hack           //temporary hack
423           else if (mState != ReInviting && mOfferState != Answered)           else if (mState != ReInviting && mOfferState != Answered)
424           {           {
425              //no SDP in ACK when one is required              //no SDP in RESIP_ACK when one is required
426              mDum.mInviteSessionHandler->onIllegalNegotiation(getSessionHandle(), msg);              mDum.mInviteSessionHandler->onIllegalNegotiation(getSessionHandle(), msg);
427           }           }
428        }              }      
# Line 432  Line 432 
432     {     {
433        case Terminated:        case Terminated:
434           //!dcm! -- 481 behaviour here, should pretty much die on anything           //!dcm! -- 481 behaviour here, should pretty much die on anything
435           //eventually 200 to BYE could be handled further out           //eventually 200 to RESIP_BYE could be handled further out
436           if (msg.isResponse())           if (msg.isResponse())
437           {           {
438              int code = msg.header(h_StatusLine).statusCode();              int code = msg.header(h_StatusLine).statusCode();
# Line 513  Line 513 
513                                    break;                                    break;
514                                        
515                 default:                 default:
516                    InfoLog (<< "Ignoring request in an INVITE dialog: " << msg.brief());                    InfoLog (<< "Ignoring request in an RESIP_INVITE dialog: " << msg.brief());
517                    break;                    break;
518              }              }
519           }           }
# Line 548  Line 548 
548                       //this usage other than onTerminated                       //this usage other than onTerminated
549                       if (mQueuedBye)                       if (mQueuedBye)
550                       {                       {
551                          send(makeAck());   // ACK the 200 first then send BYE                          send(makeAck());   // RESIP_ACK the 200 first then send RESIP_BYE
552                          mState = Terminated;                          mState = Terminated;
553                          mLastRequest = *mQueuedBye;                          mLastRequest = *mQueuedBye;
554                          delete mQueuedBye;                          delete mQueuedBye;
# Line 564  Line 564 
564                       {                       {
565                          if (offans.first == Answer)                          if (offans.first == Answer)
566                          {                          {
567                             //no late media required, so just send the ACK                             //no late media required, so just send the RESIP_ACK
568                             send(makeAck());                             send(makeAck());
569                          }                          }
570                          incomingSdp(msg, offans.second);                          incomingSdp(msg, offans.second);
# Line 606  Line 606 
606                    //this usage other than onTerminated                    //this usage other than onTerminated
607                    if (mQueuedBye)                    if (mQueuedBye)
608                    {                    {
609                       send(makeAck());   // ACK the 200 first then send BYE                       send(makeAck());   // RESIP_ACK the 200 first then send RESIP_BYE
610                       mState = Terminated;                       mState = Terminated;
611                       mLastRequest = *mQueuedBye;                       mLastRequest = *mQueuedBye;
612                       delete mQueuedBye;                       delete mQueuedBye;
# Line 630  Line 630 
630           }           }
631           else if(msg.header(h_CSeq).method() == RESIP_BYE && msg.isRequest())           else if(msg.header(h_CSeq).method() == RESIP_BYE && msg.isRequest())
632           {           {
633                  // Inbound BYE crosses with outbound REINVITE                  // Inbound RESIP_BYE crosses with outbound REINVITE
634    
635                  mState = Terminated;                  mState = Terminated;
636    
# Line 677  Line 677 
677  {  {
678     mDialog.makeRequest(mLastRequest, RESIP_REFER);     mDialog.makeRequest(mLastRequest, RESIP_REFER);
679     mLastRequest.header(h_ReferTo) = referTo;     mLastRequest.header(h_ReferTo) = referTo;
680  //   mLastRequest.header(h_ReferTo).param(p_method) = getMethodName(INVITE);    //   mLastRequest.header(h_ReferTo).param(p_method) = getMethodName(RESIP_INVITE);  
681     return mLastRequest;       return mLastRequest;  
682  }  }
683    
# Line 711  Line 711 
711           throw UsageUseException("Cannot end a session that has already been cancelled.", __FILE__, __LINE__);           throw UsageUseException("Cannot end a session that has already been cancelled.", __FILE__, __LINE__);
712           break;           break;
713        case Connected:        case Connected:
714           // Check state of 200 retrans map to see if we have recieved an ACK or not yet           // Check state of 200 retrans map to see if we have recieved an RESIP_ACK or not yet
715           if (mFinalResponseMap.find(mLastIncomingRequest.header(h_CSeq).sequence()) != mFinalResponseMap.end())           if (mFinalResponseMap.find(mLastIncomingRequest.header(h_CSeq).sequence()) != mFinalResponseMap.end())
716           {           {
717              if(!mQueuedBye)              if(!mQueuedBye)
718              {              {
719                 // No ACK yet - send BYE after ACK is received                 // No RESIP_ACK yet - send RESIP_BYE after RESIP_ACK is received
720                 mQueuedBye = new SipMessage(mLastRequest);                 mQueuedBye = new SipMessage(mLastRequest);
721                 mDialog.makeRequest(*mQueuedBye, RESIP_BYE);                 mDialog.makeRequest(*mQueuedBye, RESIP_BYE);
722              }              }
# Line 865  Line 865 
865        {        {
866           mState = Terminated;           mState = Terminated;
867           mDum.send(msg);           mDum.send(msg);
868               //mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), msg);      // This is actually called when recieving the BYE message so that the BYE message can be passed to onTerminated               //mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), msg);      // This is actually called when recieving the RESIP_BYE message so that the RESIP_BYE message can be passed to onTerminated
869           guard.destroy();           guard.destroy();
870        }        }
871        else if (code >= 200 && code < 300 && msg.header(h_CSeq).method() == RESIP_INVITE)        else if (code >= 200 && code < 300 && msg.header(h_CSeq).method() == RESIP_INVITE)

Legend:
Removed from v.3430  
changed lines
  Added in v.3431

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27