/[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 5505 by daniel, Fri Oct 7 19:58:39 2005 UTC revision 5531 by derek, Fri Oct 14 01:33:33 2005 UTC
# Line 33  Line 33 
33  using namespace resip;  using namespace resip;
34  using namespace std;  using namespace std;
35    
36    Data EndReasons[] =
37    {
38       "Not Specified",
39       "User Hung Up",
40       "Application Rejected Sdp(usually no common codec)",
41       "Illegal Sdp Negotiation",
42       "ACK not received",
43       "Session Timer Expired"
44    };
45    
46    const Data& getEndReasonString(InviteSession::EndReason reason)
47    {
48       assert(reason >= InviteSession::NotSpecified && reason < InviteSession::ENDREASON_MAX); //!dcm! -- necessary?
49       return EndReasons[reason];
50    }
51    
52  InviteSession::InviteSession(DialogUsageManager& dum, Dialog& dialog)  InviteSession::InviteSession(DialogUsageManager& dum, Dialog& dialog)
53     : DialogUsage(dum, dialog),     : DialogUsage(dum, dialog),
54       mState(Undefined),       mState(Undefined),
# Line 44  Line 60 
60       mSessionTimerSeq(0),       mSessionTimerSeq(0),
61       mSentRefer(false),       mSentRefer(false),
62       mCurrentEncryptionLevel(DialogUsageManager::None),       mCurrentEncryptionLevel(DialogUsageManager::None),
63       mProposedEncryptionLevel(DialogUsageManager::None)       mProposedEncryptionLevel(DialogUsageManager::None),
64         mEndReason(NotSpecified)
65  {  {
66     DebugLog ( << "^^^ InviteSession::InviteSession " << this);     DebugLog ( << "^^^ InviteSession::InviteSession " << this);
67     assert(mDum.mInviteSessionHandler);     assert(mDum.mInviteSessionHandler);
# Line 337  Line 354 
354  void  void
355  InviteSession::end()  InviteSession::end()
356  {  {
357       end(NotSpecified);
358    }
359    
360    void
361    InviteSession::end(EndReason reason)
362    {
363       if (mEndReason != NotSpecified)
364       {
365          mEndReason = reason;  
366       }
367      
368     InviteSessionHandler* handler = mDum.mInviteSessionHandler;     InviteSessionHandler* handler = mDum.mInviteSessionHandler;
369    
370     switch (mState)     switch (mState)
# Line 1955  Line 1983 
1983  {  {
1984     SipMessage bye;     SipMessage bye;
1985     mDialog.makeRequest(bye, BYE);     mDialog.makeRequest(bye, BYE);
1986     InfoLog (<< "Sending " << bye.brief());     Data reason;
1987       if (mEndReason != NotSpecified)
1988       {
1989          reason = getEndReasonString(mEndReason);
1990          bye.header(h_Reasons).push_back(Token(reason));      
1991       }
1992      
1993       InfoLog (<< myAddr() << " Sending BYE " << reason);
1994     send(bye);     send(bye);
1995  }  }
1996    
# Line 2012  Line 2047 
2047     mDialog.send(msg);     mDialog.send(msg);
2048  }  }
2049    
   
2050  /* ====================================================================  /* ====================================================================
2051   * The Vovida Software License, Version 1.0   * The Vovida Software License, Version 1.0
2052   *   *

Legend:
Removed from v.5505  
changed lines
  Added in v.5531

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27