/[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 7081 by bcampen, Tue Apr 17 14:46:38 2007 UTC revision 7084 by nash, Thu Apr 19 08:50:33 2007 UTC
# Line 3  Line 3 
3  #include "resip/stack/SdpContents.hxx"  #include "resip/stack/SdpContents.hxx"
4  #include "resip/stack/SipMessage.hxx"  #include "resip/stack/SipMessage.hxx"
5  #include "resip/stack/Helper.hxx"  #include "resip/stack/Helper.hxx"
6    #include "resip/dum/AppDialogSet.hxx"
7  #include "resip/dum/Dialog.hxx"  #include "resip/dum/Dialog.hxx"
8  #include "resip/dum/DialogUsageManager.hxx"  #include "resip/dum/DialogUsageManager.hxx"
9  #include "resip/dum/InviteSession.hxx"  #include "resip/dum/InviteSession.hxx"
# Line 21  Line 22 
22  #include "rutil/Random.hxx"  #include "rutil/Random.hxx"
23  #include "rutil/compat.hxx"  #include "rutil/compat.hxx"
24  #include "rutil/WinLeakCheck.hxx"  #include "rutil/WinLeakCheck.hxx"
25    #include "rutil/SharedPtr.hxx"
26    
27  // Remove warning about 'this' use in initiator list - pointer is only stored  // Remove warning about 'this' use in initiator list - pointer is only stored
28  #if defined(WIN32) && !defined(__GNUC__)  #if defined(WIN32) && !defined(__GNUC__)
# Line 117  Line 119 
119     }     }
120  }  }
121    
122    const SdpContents&
123    InviteSession::getProposedRemoteSdp() const
124    {
125       if(mProposedRemoteSdp.get())
126       {
127          return *mProposedRemoteSdp;
128       }
129       else
130       {
131          return SdpContents::Empty;
132       }
133    }
134    
135  const Data&  const Data&
136  InviteSession::getDialogId() const  InviteSession::getDialogId() const
137  {  {
# Line 521  Line 536 
536  void  void
537  InviteSession::end()  InviteSession::end()
538  {  {
539       if (isConnected())
540       {
541     end(NotSpecified);     end(NotSpecified);
542  }  }
543       //else
544       //{
545       //   AppDialogSetHandle appDialogSetHandle = getAppDialogSet();
546       //   if (appDialogSetHandle.isValid())
547       //   {
548       //      appDialogSetHandle->end();
549       //   }
550       //   else
551       //   {
552       //      assert(!"Has no mean of ending an Invite Session");
553       //   }
554       //}
555    }
556    
557  void  void
558  InviteSession::end(EndReason reason)  InviteSession::end(EndReason reason)
# Line 1192  Line 1222 
1222           *mLastRemoteSessionModification = msg;           *mLastRemoteSessionModification = msg;
1223           transition(ReceivedReinvite);           transition(ReceivedReinvite);
1224           mCurrentEncryptionLevel = getEncryptionLevel(msg);           mCurrentEncryptionLevel = getEncryptionLevel(msg);
1225           mProposedRemoteSdp = InviteSession::makeSdp(*sdp);           mProposedRemoteSdp = sdp; // !nash! don't clone, simply hand over the ownership - InviteSession::makeSdp(*sdp);
1226    
1227           //handler->onDialogModified(getSessionHandle(), Offer, msg);           //handler->onDialogModified(getSessionHandle(), Offer, msg);
1228           handler->onOffer(getSessionHandle(), msg, *sdp);           handler->onOffer(getSessionHandle(), msg, *mProposedRemoteSdp);
1229           break;           break;
1230    
1231        case On2xx:        case On2xx:
# Line 1214  Line 1244 
1244           //  See rfc3311 5.2, 4th paragraph.           //  See rfc3311 5.2, 4th paragraph.
1245           *mLastRemoteSessionModification = msg;           *mLastRemoteSessionModification = msg;
1246           mCurrentEncryptionLevel = getEncryptionLevel(msg);           mCurrentEncryptionLevel = getEncryptionLevel(msg);
1247           mProposedRemoteSdp = InviteSession::makeSdp(*sdp);           mProposedRemoteSdp = sdp; // !nash! don't clone, simply hand over the ownership - InviteSession::makeSdp(*sdp);
1248           handler->onOffer(getSessionHandle(), msg, *sdp);           handler->onOffer(getSessionHandle(), msg, *mProposedRemoteSdp);
1249           break;           break;
1250    
1251        case OnUpdate:        case OnUpdate:
# Line 1275  Line 1305 
1305           {           {
1306              mCurrentEncryptionLevel = getEncryptionLevel(msg);              mCurrentEncryptionLevel = getEncryptionLevel(msg);
1307              setCurrentLocalSdp(msg);              setCurrentLocalSdp(msg);
1308              mCurrentRemoteSdp = InviteSession::makeSdp(*sdp);              mCurrentRemoteSdp = sdp; // !nash! don't clone, simply hand over the ownership - InviteSession::makeSdp(*sdp);
1309              handler->onAnswer(getSessionHandle(), msg, *sdp, InviteSessionHandler::Reinvite);              handler->onAnswer(getSessionHandle(), msg, *mCurrentRemoteSdp, InviteSessionHandler::Reinvite);
1310           }           }
1311           else if(mProposedLocalSdp.get())           else if(mProposedLocalSdp.get())
1312           {           {
# Line 1378  Line 1408 
1408    
1409              if (changed)              if (changed)
1410              {              {
1411                 mCurrentRemoteSdp = InviteSession::makeSdp(*sdp);                 mCurrentRemoteSdp = sdp; // !nash! don't clone, simply hand over the ownership - InviteSession::makeSdp(*sdp);
1412                 handler->onRemoteSdpChanged(getSessionHandle(), msg, *sdp);                 handler->onRemoteSdpChanged(getSessionHandle(), msg, *mCurrentRemoteSdp);
1413              }              }
1414           }           }
1415           else           else
# Line 1477  Line 1507 
1507           handleSessionTimerResponse(msg);           handleSessionTimerResponse(msg);
1508           // mLastSessionModification = msg;   // ?slg? why are we storing 200's?           // mLastSessionModification = msg;   // ?slg? why are we storing 200's?
1509           mCurrentEncryptionLevel = getEncryptionLevel(msg);           mCurrentEncryptionLevel = getEncryptionLevel(msg);
1510           mProposedRemoteSdp = InviteSession::makeSdp(*sdp);           mProposedRemoteSdp = sdp; // !nash! don't clone, simply hand over the ownership - InviteSession::makeSdp(*sdp);
1511           handler->onOffer(getSessionHandle(), msg, *sdp);           handler->onOffer(getSessionHandle(), msg, *mProposedRemoteSdp);
1512    
1513           // !jf! do I need to allow a reINVITE overlapping the retransmission of           // !jf! do I need to allow a reINVITE overlapping the retransmission of
1514           // the ACK when a 200I is received? If yes, then I need to store all           // the ACK when a 200I is received? If yes, then I need to store all
# Line 1561  Line 1591 
1591        case OnAckAnswer:        case OnAckAnswer:
1592           transition(Connected);           transition(Connected);
1593           setCurrentLocalSdp(msg);           setCurrentLocalSdp(msg);
1594           mCurrentRemoteSdp = InviteSession::makeSdp(*sdp);           mCurrentRemoteSdp = sdp; // !nash! don't clone, simply hand over the ownership - InviteSession::makeSdp(*sdp);
1595           mCurrentEncryptionLevel = getEncryptionLevel(msg);           mCurrentEncryptionLevel = getEncryptionLevel(msg);
1596           mCurrentRetransmit200 = 0; // stop the 200 retransmit timer           mCurrentRetransmit200 = 0; // stop the 200 retransmit timer
1597           handler->onAnswer(getSessionHandle(), msg, *sdp, InviteSessionHandler::Ack);                       handler->onAnswer(getSessionHandle(), msg, *mCurrentRemoteSdp, InviteSessionHandler::Ack);              
1598           break;                   break;        
1599        case OnAck:        case OnAck:
1600           if (mLastRemoteSessionModification->header(h_CSeq).sequence() > msg.header(h_CSeq).sequence())           if (mLastRemoteSessionModification->header(h_CSeq).sequence() > msg.header(h_CSeq).sequence())

Legend:
Removed from v.7081  
changed lines
  Added in v.7084

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27