/[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 3430 by nash, Tue Nov 2 08:27:43 2004 UTC revision 3431 by kenho, Tue Nov 2 12:17:27 2004 UTC
# Line 97  Line 97 
97                 }                 }
98                 else                 else
99                 {                 {
100                    InfoLog(<< "Got an INVITE or SUBSCRIBE with invalid scheme");                    InfoLog(<< "Got an RESIP_INVITE or SUBSCRIBE with invalid scheme");
101                    DebugLog(<< request);                    DebugLog(<< request);
102                    throw Exception("Invalid scheme in request", __FILE__, __LINE__);                    throw Exception("Invalid scheme in request", __FILE__, __LINE__);
103                 }                 }
104              }              }
105              else              else
106              {              {
107                 InfoLog (<< "Got an INVITE or SUBSCRIBE that doesn't have exactly one contact");                 InfoLog (<< "Got an RESIP_INVITE or SUBSCRIBE that doesn't have exactly one contact");
108                 DebugLog (<< request);                 DebugLog (<< request);
109                 throw Exception("Too many (or no contact) contacts in request", __FILE__, __LINE__);                 throw Exception("Too many (or no contact) contacts in request", __FILE__, __LINE__);
110              }              }
# Line 172  Line 172 
172                    }                    }
173                    else                    else
174                    {                    {
175                       InfoLog (<< "Got an INVITE or SUBSCRIBE with invalid scheme");                       InfoLog (<< "Got an RESIP_INVITE or SUBSCRIBE with invalid scheme");
176                       DebugLog (<< response);                       DebugLog (<< response);
177                       throw Exception("Bad scheme in contact in response", __FILE__, __LINE__);                       throw Exception("Bad scheme in contact in response", __FILE__, __LINE__);
178                    }                    }
179                 }                 }
180                 else                 else
181                 {                 {
182                    InfoLog (<< "Got an INVITE or SUBSCRIBE that doesn't have exactly one contact");                    InfoLog (<< "Got an RESIP_INVITE or SUBSCRIBE that doesn't have exactly one contact");
183                    DebugLog (<< response);                    DebugLog (<< response);
184                    throw Exception("Too many contacts (or no contact) in response", __FILE__, __LINE__);                    throw Exception("Too many contacts (or no contact) in response", __FILE__, __LINE__);
185                 }                 }
# Line 252  Line 252 
252           }           }
253           else           else
254           {           {
255              throw UsageUseException("Can only CANCEL an INVITE", __FILE__, __LINE__);              throw UsageUseException("Can only CANCEL an RESIP_INVITE", __FILE__, __LINE__);
256           }           }
257        }        }
258        else        else
# Line 271  Line 271 
271        const SipMessage& request = msg;        const SipMessage& request = msg;
272        switch (request.header(h_CSeq).method())        switch (request.header(h_CSeq).method())
273       {       {
274           case RESIP_INVITE:  // new INVITE           case RESIP_INVITE:  // new RESIP_INVITE
275              if (mInviteSession == 0)              if (mInviteSession == 0)
276              {              {
277                 DebugLog ( << "Dialog::dispatch  --  Created new server invite session" << msg.brief());                 DebugLog ( << "Dialog::dispatch  --  Created new server invite session" << msg.brief());
# Line 279  Line 279 
279              }              }
280              mInviteSession->dispatch(request);              mInviteSession->dispatch(request);
281              break;              break;
282              //refactor, send bad request for BYE, INFO, CANCEL?              //refactor, send bad request for RESIP_BYE, INFO, CANCEL?
283           case RESIP_BYE:           case RESIP_BYE:
284              if (mInviteSession == 0)              if (mInviteSession == 0)
285              {              {
286                 InfoLog ( << "Spurious BYE" );                 InfoLog ( << "Spurious RESIP_BYE" );
287                 return;                               return;              
288              }              }
289              else              else
# Line 306  Line 306 
306           case RESIP_CANCEL:           case RESIP_CANCEL:
307              if (mInviteSession == 0)              if (mInviteSession == 0)
308              {              {
309                 InfoLog (<< "Drop stray ACK or CANCEL in dialog on the floor");                 InfoLog (<< "Drop stray RESIP_ACK or CANCEL in dialog on the floor");
310                 DebugLog (<< request);                 DebugLog (<< request);
311              }              }
312              else              else
# Line 787  Line 787 
787        assert(request.exists(h_Vias));        assert(request.exists(h_Vias));
788     }     }
789    
790     //don't increment CSeq for ACK or CANCEL     //don't increment CSeq for RESIP_ACK or CANCEL
791     if (method != RESIP_ACK && method != RESIP_CANCEL)     if (method != RESIP_ACK && method != RESIP_CANCEL)
792     {     {
793        request.header(h_CSeq).sequence() = ++mLocalCSeq;        request.header(h_CSeq).sequence() = ++mLocalCSeq;
794     }     }
795     else     else
796     {     {
797        // ACK and cancel have a minimal header set        // RESIP_ACK and cancel have a minimal header set
798        request.remove(h_Accepts);        request.remove(h_Accepts);
799        request.remove(h_AcceptEncodings);        request.remove(h_AcceptEncodings);
800        request.remove(h_AcceptLanguages);        request.remove(h_AcceptLanguages);
# Line 804  Line 804 
804        request.remove(h_Supporteds);        request.remove(h_Supporteds);
805     }     }
806    
807     // If method is INVITE then advertise required headers     // If method is RESIP_INVITE then advertise required headers
808     if(method == RESIP_INVITE)     if(method == RESIP_INVITE)
809     {     {
810        if(mDum.getProfile()->isAdvertisedCapability(Headers::Allow)) request.header(h_Allows) = mDum.getProfile()->getAllowedMethods();        if(mDum.getProfile()->isAdvertisedCapability(Headers::Allow)) request.header(h_Allows) = mDum.getProfile()->getAllowedMethods();
# Line 813  Line 813 
813        if(mDum.getProfile()->isAdvertisedCapability(Headers::Supported)) request.header(h_Supporteds) = mDum.getProfile()->getSupportedOptionTags();        if(mDum.getProfile()->isAdvertisedCapability(Headers::Supported)) request.header(h_Supporteds) = mDum.getProfile()->getSupportedOptionTags();
814     }     }
815    
816     // Remove Session Timer headers for all requests except INVITE and UPDATE     // Remove Session Timer headers for all requests except RESIP_INVITE and UPDATE
817     if(method != RESIP_INVITE && method != RESIP_UPDATE)     if(method != RESIP_INVITE && method != RESIP_UPDATE)
818     {     {
819        request.remove(h_SessionExpires);        request.remove(h_SessionExpires);
# Line 865  Line 865 
865               );               );
866                
867  //      assert (request.header(h_RequestLine).getMethod() == CANCEL ||  // Contact header is not required for Requests that do not form a dialog  //      assert (request.header(h_RequestLine).getMethod() == CANCEL ||  // Contact header is not required for Requests that do not form a dialog
868  //                    request.header(h_RequestLine).getMethod() == BYE ||  //                    request.header(h_RequestLine).getMethod() == RESIP_BYE ||
869  //                    request.header(h_Contacts).size() == 1);  //                    request.header(h_Contacts).size() == 1);
870        Helper::makeResponse(response, request, code, mLocalContact);        Helper::makeResponse(response, request, code, mLocalContact);
871        response.header(h_To).param(p_tag) = mId.getLocalTag();        response.header(h_To).param(p_tag) = mId.getLocalTag();

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

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27