/[resiprocate]/main/resip/stack/Helper.cxx
ViewVC logotype

Diff of /main/resip/stack/Helper.cxx

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

revision 5414 by jason, Mon Aug 22 00:30:05 2005 UTC revision 5415 by sgodin, Thu Sep 15 12:57:21 2005 UTC
# Line 350  Line 350 
350     }     }
351     else     else
352     {     {
353        Data &reason(response.header(h_StatusLine).reason());        getResponseCodeReason(responseCode, response.header(h_StatusLine).reason());
354       }
355    }
356    
357    SipMessage*
358    Helper::makeResponse(const SipMessage& request,
359                         int responseCode,
360                         const NameAddr& myContact,
361                         const Data& reason,
362                         const Data& hostname,
363                         const Data& warning)
364    {
365       SipMessage* response = new SipMessage;
366       makeResponse(*response, request, responseCode, reason, hostname, warning);
367    
368       // in general, this should not create a Contact header since only requests
369       // that create a dialog (or REGISTER requests) should produce a response with
370       // a contact(s).
371       response->header(h_Contacts).clear();
372       response->header(h_Contacts).push_back(myContact);
373       return response;
374    }
375    
376    
377    SipMessage*
378    Helper::makeResponse(const SipMessage& request,
379                         int responseCode,
380                         const Data& reason,
381                         const Data& hostname,
382                         const Data& warning)
383    {
384       SipMessage* response = new SipMessage;
385       makeResponse(*response, request, responseCode, reason, hostname, warning);
386       return response;
387    }
388    
389    void  
390    Helper::getResponseCodeReason(int responseCode, Data& reason)
391    {
392        switch (responseCode)        switch (responseCode)
393        {        {
394           case 100: reason = "Trying"; break;           case 100: reason = "Trying"; break;
# Line 409  Line 447 
447           case 606: reason = "Not Acceptable"; break;           case 606: reason = "Not Acceptable"; break;
448        }        }
449     }     }
 }  
   
 SipMessage*  
 Helper::makeResponse(const SipMessage& request,  
                      int responseCode,  
                      const NameAddr& myContact,  
                      const Data& reason,  
                      const Data& hostname,  
                      const Data& warning)  
 {  
    SipMessage* response = new SipMessage;  
    makeResponse(*response, request, responseCode, reason, hostname, warning);  
   
    // in general, this should not create a Contact header since only requests  
    // that create a dialog (or REGISTER requests) should produce a response with  
    // a contact(s).  
    response->header(h_Contacts).clear();  
    response->header(h_Contacts).push_back(myContact);  
    return response;  
 }  
   
   
 SipMessage*  
 Helper::makeResponse(const SipMessage& request,  
                      int responseCode,  
                      const Data& reason,  
                      const Data& hostname,  
                      const Data& warning)  
 {  
    SipMessage* response = new SipMessage;  
    makeResponse(*response, request, responseCode, reason, hostname, warning);  
    return response;  
 }  
450    
451  SipMessage*  SipMessage*
452  Helper::makeCancel(const SipMessage& request)  Helper::makeCancel(const SipMessage& request)

Legend:
Removed from v.5414  
changed lines
  Added in v.5415

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27