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

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

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

revision 2992 by derek, Tue Jun 15 19:41:56 2004 UTC revision 2995 by derek, Tue Jun 15 22:15:58 2004 UTC
# Line 25  Line 25 
25  using namespace std;  using namespace std;
26    
27  Dialog::Dialog(DialogUsageManager& dum, const SipMessage& msg, DialogSet& ds)  Dialog::Dialog(DialogUsageManager& dum, const SipMessage& msg, DialogSet& ds)
28     : mId(msg),     : mDum(dum),
      mDum(dum),  
29       mDialogSet(ds),       mDialogSet(ds),
30       mClientSubscriptions(),       mClientSubscriptions(),
31       mServerSubscription(0),       mServerSubscription(0),
# Line 38  Line 37 
37       mClientOutOfDialogRequests(),       mClientOutOfDialogRequests(),
38       mServerOutOfDialogRequest(0),       mServerOutOfDialogRequest(0),
39       mType(Fake),       mType(Fake),
      mCallId(msg.header(h_CallID)),  
40       mRouteSet(),       mRouteSet(),
41       mLocalContact(),       mLocalContact(),
42       mLocalCSeq(0),       mLocalCSeq(0),
43       mRemoteCSeq(0),       mRemoteCSeq(0),
44         mId("INVALID", "INVALID", "INVALID"),
45       mRemoteTarget(),       mRemoteTarget(),
46         mLocalNameAddr(),
47         mRemoteNameAddr(),
48         mCallId(msg.header(h_CallID)),
49       mDestroying(false)       mDestroying(false)
50  {  {
51     assert(msg.isExternal());     assert(msg.isExternal());
# Line 76  Line 78 
78           case INVITE:           case INVITE:
79           case SUBSCRIBE:           case SUBSCRIBE:
80           case REFER:           case REFER:
81                InfoLog ( << "UAS dialog ID creation, DS: " << ds.getId());            
82                mId = DialogId(ds.getId(), request.header(h_From).param(p_tag));
83                mRemoteNameAddr = request.header(h_From);
84                mLocalNameAddr = request.header(h_To);
85                mLocalNameAddr.param(p_tag) = mId.getLocalTag();
86              if (request.exists(h_Contacts) && request.header(h_Contacts).size() == 1)              if (request.exists(h_Contacts) && request.header(h_Contacts).size() == 1)
87              {              {
88                 const NameAddr& contact = request.header(h_Contacts).front();                 const NameAddr& contact = request.header(h_Contacts).front();
# Line 106  Line 113 
113        mRemoteCSeq = request.header(h_CSeq).sequence();        mRemoteCSeq = request.header(h_CSeq).sequence();
114        mLocalCSeq = 1;        mLocalCSeq = 1;
115                
116          InfoLog ( << "************** Created Dialog as UAS **************" );      
117          InfoLog ( << "mRemoteNameAddr: " << mRemoteNameAddr );
118          InfoLog ( << "mLocalNameAddr: " << mLocalNameAddr );
119          InfoLog ( << "mLocalContact: " << mLocalContact );
120          InfoLog ( << "mRemoteTarget: " << mRemoteTarget );
121     }     }
122     else if (msg.isResponse())     else if (msg.isResponse())
123     {     {
124          mId = DialogId(msg);      
125        const SipMessage& response = msg;        const SipMessage& response = msg;
126          mRemoteNameAddr = response.header(h_To);
127          mLocalNameAddr = response.header(h_From);
128    
129        switch (msg.header(h_CSeq).method())        switch (msg.header(h_CSeq).method())
130        {        {
# Line 173  Line 188 
188                
189        mLocalCSeq = response.header(h_CSeq).sequence();        mLocalCSeq = response.header(h_CSeq).sequence();
190        mRemoteCSeq = 0;        mRemoteCSeq = 0;
191          InfoLog ( << "************** Created Dialog as UAC **************" );      
192          InfoLog ( << "mRemoteNameAddr: " << mRemoteNameAddr );
193          InfoLog ( << "mLocalNameAddr: " << mLocalNameAddr );
194          InfoLog ( << "mLocalContact: " << mLocalContact );
195          InfoLog ( << "mRemoteTarget: " << mRemoteTarget );
196    
197                
198     }     }
199     mDialogSet.addDialog(this);     mDialogSet.addDialog(this);
# Line 646  Line 667 
667     rLine.uri() = mRemoteTarget.uri();     rLine.uri() = mRemoteTarget.uri();
668        
669     request.header(h_RequestLine) = rLine;     request.header(h_RequestLine) = rLine;
670     request.header(h_To) = mRemoteTarget;     request.header(h_To) = mRemoteNameAddr;  
671     request.header(h_To).param(p_tag) = mId.getRemoteTag();  //   request.header(h_To).param(p_tag) = mId.getRemoteTag();
672     request.header(h_From) = mLocalContact;     request.header(h_From) = mLocalNameAddr;  
673     request.header(h_From).param(p_tag) = mId.getLocalTag();  //   request.header(h_From).param(p_tag) = mId.getLocalTag();
674    
675     request.header(h_CallId) = mCallId;     request.header(h_CallId) = mCallId;
676     request.header(h_Routes) = mRouteSet;     request.header(h_Routes) = mRouteSet;
677     request.header(h_Contacts) = mLocalContact;       request.remove(h_Contacts);  
678       request.header(h_Contacts).push_front(mLocalContact);  
679     request.header(h_CSeq).method() = method;     request.header(h_CSeq).method() = method;
680     request.header(h_MaxForwards).value() = 70;     request.header(h_MaxForwards).value() = 70;
681    
# Line 674  Line 696 
696     {     {
697        request.header(h_CSeq).sequence() = ++mLocalCSeq;        request.header(h_CSeq).sequence() = ++mLocalCSeq;
698     }     }
699       InfoLog ( << "Dialog::makeRequest: " << request );
700  }  }
701    
702  void  void

Legend:
Removed from v.2992  
changed lines
  Added in v.2995

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27