/[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 2985 by derek, Mon Jun 14 04:40:48 2004 UTC revision 2990 by derek, Tue Jun 15 03:58:47 2004 UTC
# Line 11  Line 11 
11    
12  using namespace resip;  using namespace resip;
13    
14    unsigned long
15    InviteSession::T1 = 500;
16    
17    unsigned long
18    InviteSession::T2 = 8 * T1;
19    
20    unsigned long
21    InviteSession::TimerH = 64 * T1;
22    
23  InviteSession::InviteSession(DialogUsageManager& dum, Dialog& dialog, State initialState)  InviteSession::InviteSession(DialogUsageManager& dum, Dialog& dialog, State initialState)
24     : BaseUsage(dum, dialog),     : BaseUsage(dum, dialog),
25       mState(initialState),       mState(initialState),
# Line 19  Line 28 
28       mCurrentRemoteSdp(0),       mCurrentRemoteSdp(0),
29       mProposedLocalSdp(0),       mProposedLocalSdp(0),
30       mProposedRemoteSdp(0),       mProposedRemoteSdp(0),
31       mNextOfferOrAnswerSdp(0)       mNextOfferOrAnswerSdp(0),
32         mCurrentRetransmit200(0)      
33    
34  {  {
35     assert(mDum.mInviteSessionHandler);     assert(mDum.mInviteSessionHandler);
36  }  }
# Line 72  Line 83 
83     return InviteSessionHandle(mDum, getBaseHandle().getId());     return InviteSessionHandle(mDum, getBaseHandle().getId());
84  }  }
85    
86    
87    void
88    InviteSession::dispatch(const DumTimeout& timeout)
89    {
90       if (timeout.type() == DumTimeout::Retransmit200 && mState == Accepting)
91       {
92          mDum.addTimer(DumTimeout::Retransmit200, resipMin(T2, mCurrentRetransmit200*2), getBaseHandle(),  0);
93       }
94       else if (timeout.type() == DumTimeout::WaitForAck && mState != Connected)
95       {
96          mDialog.makeResponse(mLastResponse, mLastRequest, 408);
97          mDum.mInviteSessionHandler->onTerminated(getSessionHandle(), mLastResponse);      
98          delete this;      
99       }
100    }
101    
102  void  void
103  InviteSession::dispatch(const SipMessage& msg)  InviteSession::dispatch(const SipMessage& msg)
104  {  {
# Line 269  Line 296 
296        else if (code >= 200 && code < 300 && msg.header(h_CSeq).method() == INVITE)        else if (code >= 200 && code < 300 && msg.header(h_CSeq).method() == INVITE)
297        {        {
298           assert(&msg == &mFinalResponse);           assert(&msg == &mFinalResponse);
299           //!dcm! -- start timer...this should be mFinalResponse...maybe assign here in           mCurrentRetransmit200 = T1;        
300             mDum.addTimer(DumTimeout::Retransmit200, mCurrentRetransmit200, getBaseHandle(),  0);
301             mDum.addTimer(DumTimeout::WaitForAck, TimerH, getBaseHandle(),  0);
302                
303             //!dcm! -- this should be mFinalResponse...maybe assign here in
304           //case the user wants to be very strange           //case the user wants to be very strange
305           if (mNextOfferOrAnswerSdp)           if (mNextOfferOrAnswerSdp)
306           {           {

Legend:
Removed from v.2985  
changed lines
  Added in v.2990

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27