Changeset 1402 for pjproject/trunk


Ignore:
Timestamp:
Jul 10, 2007 1:46:08 AM (17 years ago)
Author:
bennylp
Message:

Ticket #352: added PJSIP_CHECK_VIA_SENT_BY configuration to turn off Via sent-by checking for SIP responses, to support IP address change

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_config.h

    r1390 r1402  
    195195 
    196196/** 
     197 * Perform Via sent-by checking as specified in RFC 3261 Section 18.1.2, 
     198 * which says that UAC MUST silently discard responses with Via sent-by 
     199 * containing values that the UAC doesn't recognize as its transport 
     200 * address. 
     201 * 
     202 * In PJSIP, this will cause response to be discarded and a message is 
     203 * written to the log, saying something like: 
     204 *  "Dropping response Response msg 200/INVITE/cseq=608594373 (rdata00A99EF4) 
     205 *   from 1.2.3.4:5060 because sent-by is mismatch" 
     206 * 
     207 * The default behavior is yes, but when the UA supports IP address change 
     208 * for the SIP transport, it will need to turn this checking off since 
     209 * when the transport address is changed between request is sent and  
     210 * response is received, the response will be discarded since its Via 
     211 * sent-by now contains address that is different than the transport 
     212 * address. 
     213 */ 
     214#ifndef PJSIP_CHECK_VIA_SENT_BY 
     215#   define PJSIP_CHECK_VIA_SENT_BY      1 
     216#endif 
     217 
     218 
     219/** 
    197220 * If non-zero, SIP parser will unescape the escape characters ('%') 
    198221 * in the original message, which means that it will modify the 
  • pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c

    r1323 r1402  
    824824               pjsip_rx_data_get_info(rdata))); 
    825825 
     826#if defined(PJSIP_CHECK_VIA_SENT_BY) && PJSIP_CHECK_VIA_SENT_BY != 0 
    826827    /* For response, check that the value in Via sent-by match the transport. 
    827828     * If not matched, silently drop the response. 
     
    880881        } 
    881882    } 
     883#endif 
    882884 
    883885 
Note: See TracChangeset for help on using the changeset viewer.