diff options
author | Benny Prijono <bennylp@teluu.com> | 2010-10-01 00:24:23 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2010-10-01 00:24:23 +0000 |
commit | c9b181750958386e9b5f2b21e486b214e0c5906d (patch) | |
tree | 47ea20912d51b8e61a0ae1c0cffc10e525d7c870 /pjsip/src | |
parent | 2263a30d5a775d8ffd73484f73c6d13e93dab77e (diff) |
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)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3329 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src')
-rw-r--r-- | pjsip/src/pjsip/sip_config.c | 5 | ||||
-rw-r--r-- | pjsip/src/pjsip/sip_uri.c | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/pjsip/src/pjsip/sip_config.c b/pjsip/src/pjsip/sip_config.c index 85466d4e..87eba3f0 100644 --- a/pjsip/src/pjsip/sip_config.c +++ b/pjsip/src/pjsip/sip_config.c @@ -23,6 +23,11 @@ /* pjsip configuration instance, initialized with default values */ pjsip_cfg_t pjsip_sip_cfg_var = { + /* Global settings */ + { + PJSIP_ALLOW_PORT_IN_FROMTO_HDR + }, + /* Transaction settings */ { PJSIP_MAX_TSX_COUNT, diff --git a/pjsip/src/pjsip/sip_uri.c b/pjsip/src/pjsip/sip_uri.c index d4054573..d2b31d9f 100644 --- a/pjsip/src/pjsip/sip_uri.c +++ b/pjsip/src/pjsip/sip_uri.c @@ -288,14 +288,16 @@ static pj_ssize_t pjsip_url_print( pjsip_uri_context_e context, } /* Only print port if it is explicitly specified. - * Port is not allowed in To and From header. + * Port is not allowed in To and From header, see Table 1 in + * RFC 3261 Section 19.1.1 */ - /* Unfortunately some UA requires us to send back the port - * number exactly as it was sent. We don't remember whether an - * UA has sent us port, so we'll just send the port indiscrimately + /* Note: ticket #1141 adds run-time setting to allow port number to + * appear in From/To header. Default is still false. */ - //PJ_TODO(SHOULD_DISALLOW_URI_PORT_IN_FROM_TO_HEADER) - if (url->port && context != PJSIP_URI_IN_FROMTO_HDR) { + if (url->port && + (context != PJSIP_URI_IN_FROMTO_HDR || + pjsip_cfg()->endpt.allow_port_in_fromto_hdr)) + { if (endbuf - buf < 10) return -1; |