Changeset 2732


Ignore:
Timestamp:
Jun 2, 2009 8:17:56 AM (10 years ago)
Author:
bennylp
Message:

Ticket #870: Changed the mapping of host resolution failure to SIP status code 502 from 503 (thanks Robert Cichielo for the report)

  • also fixed client registration to use the reason phrase of the transaction rather than to retrieve the default reason phrase for the status code
Location:
pjproject/trunk/pjsip/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c

    r2394 r2732  
    10571057        call_callback(regc, PJ_SUCCESS, tsx->status_code,  
    10581058                      (rdata ? &rdata->msg_info.msg->line.status.reason  
    1059                         : pjsip_get_status_text(tsx->status_code)), 
     1059                        : &tsx->status_text), 
    10601060                      rdata, expiration,  
    10611061                      contact_cnt, contact); 
  • pjproject/trunk/pjsip/src/pjsip/sip_transaction.c

    r2724 r2732  
    2424#include <pjsip/sip_errno.h> 
    2525#include <pjsip/sip_event.h> 
     26#include <pjlib-util/errno.h> 
    2627#include <pj/hash.h> 
    2728#include <pj/pool.h> 
     
    16921693        if (!*cont) { 
    16931694            char errmsg[PJ_ERR_MSG_SIZE]; 
     1695            pjsip_status_code sc; 
    16941696            pj_str_t err; 
    16951697 
     
    17091711            tsx->transport_flag |= TSX_HAS_RESOLVED_SERVER; 
    17101712 
     1713            /* Server resolution error is now mapped to 502 instead of 503, 
     1714             * since with 503 normally client should try again. 
     1715             * See http://trac.pjsip.org/repos/ticket/870 
     1716             */ 
     1717            if (-sent==PJ_ERESOLVE || -sent==PJLIB_UTIL_EDNS_NXDOMAIN) 
     1718                sc = PJSIP_SC_BAD_GATEWAY; 
     1719            else 
     1720                sc = PJSIP_SC_TSX_TRANSPORT_ERROR; 
     1721 
    17111722            /* Terminate transaction, if it's not already terminated. */ 
    1712             tsx_set_status_code(tsx, PJSIP_SC_TSX_TRANSPORT_ERROR, &err); 
     1723            tsx_set_status_code(tsx, sc, &err); 
    17131724            if (tsx->state != PJSIP_TSX_STATE_TERMINATED && 
    17141725                tsx->state != PJSIP_TSX_STATE_DESTROYED) 
Note: See TracChangeset for help on using the changeset viewer.