Changeset 3329


Ignore:
Timestamp:
Oct 1, 2010 12:24:23 AM (14 years ago)
Author:
bennylp
Message:

Closed #1141: Compile and run-time setting to allow printing of port number in URI in To and From header (thanks Marcus Froeschl for the suggestion)

Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

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

    r3182 r3329  
    6969typedef struct pjsip_cfg_t 
    7070{ 
     71    /** Global settings. */ 
     72    struct { 
     73        /** 
     74         * Specify port number should be allowed to appear in To and From 
     75         * header. Note that RFC 3261 disallow this, see Table 1 in section 
     76         * 19.1.1 of the RFC. Default is PJSIP_ALLOW_PORT_IN_FROMTO_HDR. 
     77         */ 
     78        pj_bool_t allow_port_in_fromto_hdr; 
     79 
     80    } endpt; 
     81 
    7182    /** Transaction layer settings. */ 
    7283    struct { 
     
    362373 
    363374/** 
     375 * Specify port number should be allowed to appear in To and From 
     376 * header. Note that RFC 3261 disallow this, see Table 1 in section 
     377 * 19.1.1 of the RFC. This setting can also be altered at run-time 
     378 * via pjsip_cfg setting, see pjsip_cfg_t.allow_port_in_fromto_hdr 
     379 * field. 
     380 * 
     381 * Default: 0 
     382 */ 
     383#ifndef PJSIP_ALLOW_PORT_IN_FROMTO_HDR 
     384#   define PJSIP_ALLOW_PORT_IN_FROMTO_HDR       0 
     385#endif 
     386 
     387/** 
    364388 * This macro controls maximum numbers of ioqueue events to be processed 
    365389 * in a single pjsip_endpt_handle_events() poll. When PJSIP detects that 
  • pjproject/trunk/pjsip/src/pjsip/sip_config.c

    r2394 r3329  
    2424pjsip_cfg_t pjsip_sip_cfg_var = 
    2525{ 
     26    /* Global settings */ 
     27    { 
     28       PJSIP_ALLOW_PORT_IN_FROMTO_HDR 
     29    }, 
     30 
    2631    /* Transaction settings */ 
    2732    { 
  • pjproject/trunk/pjsip/src/pjsip/sip_uri.c

    r3242 r3329  
    289289 
    290290    /* Only print port if it is explicitly specified.  
    291      * Port is not allowed in To and From header. 
    292      */ 
    293     /* Unfortunately some UA requires us to send back the port 
    294      * number exactly as it was sent. We don't remember whether an 
    295      * UA has sent us port, so we'll just send the port indiscrimately 
    296      */ 
    297     //PJ_TODO(SHOULD_DISALLOW_URI_PORT_IN_FROM_TO_HEADER) 
    298     if (url->port && context != PJSIP_URI_IN_FROMTO_HDR) { 
     291     * Port is not allowed in To and From header, see Table 1 in 
     292     * RFC 3261 Section 19.1.1 
     293     */ 
     294    /* Note: ticket #1141 adds run-time setting to allow port number to 
     295     * appear in From/To header. Default is still false. 
     296     */ 
     297    if (url->port && 
     298        (context != PJSIP_URI_IN_FROMTO_HDR || 
     299         pjsip_cfg()->endpt.allow_port_in_fromto_hdr)) 
     300    { 
    299301        if (endbuf - buf < 10) 
    300302            return -1; 
Note: See TracChangeset for help on using the changeset viewer.