diff options
author | Benny Prijono <bennylp@teluu.com> | 2012-08-13 07:26:03 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2012-08-13 07:26:03 +0000 |
commit | cf86e0d99fdf01059695eed3d75519af5cd92853 (patch) | |
tree | 0669add9b27832fa93089bb006dcd68430e0a53a | |
parent | eea3d23ebe28284d50245a042279e26ed31d911e (diff) |
Fixed #1569: Option to allow hash character ('#') to appear in user part of SIP URL
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4228 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjsip/include/pjsip/sip_config.h | 6 | ||||
-rw-r--r-- | pjsip/src/pjsip/sip_uri.c | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/pjsip/include/pjsip/sip_config.h b/pjsip/include/pjsip/sip_config.h index 2c94bbf8..b67859fb 100644 --- a/pjsip/include/pjsip/sip_config.h +++ b/pjsip/include/pjsip/sip_config.h @@ -78,6 +78,12 @@ typedef struct pjsip_cfg_t pj_bool_t allow_port_in_fromto_hdr; /** + * Allow hash character ('#') to appear in outgoing URIs. See + * https://trac.pjsip.org/repos/ticket/1569 + */ + pj_bool_t allow_tx_hash_in_uri; + + /** * Disable rport in request. */ pj_bool_t disable_rport; diff --git a/pjsip/src/pjsip/sip_uri.c b/pjsip/src/pjsip/sip_uri.c index 4bd17f68..df125bae 100644 --- a/pjsip/src/pjsip/sip_uri.c +++ b/pjsip/src/pjsip/sip_uri.c @@ -269,7 +269,10 @@ static pj_ssize_t pjsip_url_print( pjsip_uri_context_e context, /* Print "user:password@", if any. */ if (url->user.slen) { - copy_advance_escape(buf, url->user, pc->pjsip_USER_SPEC); + const pj_cis_t *spec = pjsip_cfg()->endpt.allow_tx_hash_in_uri ? + &pc->pjsip_USER_SPEC_LENIENT : + &pc->pjsip_USER_SPEC; + copy_advance_escape(buf, url->user, *spec); if (url->passwd.slen) { *buf++ = ':'; copy_advance_escape(buf, url->passwd, pc->pjsip_PASSWD_SPEC); |