diff options
author | Benny Prijono <bennylp@teluu.com> | 2012-10-26 09:30:37 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2012-10-26 09:30:37 +0000 |
commit | bfaf62527daee7c3e7200a77437bd99b037232b9 (patch) | |
tree | b5a2b8d3ca7a7cb4daee0b7c0e644f1f1eac53bc | |
parent | 7b547d0f502880de7d8899239110972b90da21cf (diff) |
Misc (re #1559): Require name-addr to have the quote if display name is given. Previously an URI like this will be accepted: "301 301" sip:301@host
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4288 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjsip/include/pjsua-lib/pjsua.h | 6 | ||||
-rw-r--r-- | pjsip/src/pjsip/sip_parser.c | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index ad8e519c..40975e4e 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -2729,7 +2729,8 @@ typedef struct pjsua_acc_config /** * The full SIP URL for the account. The value can take name address or - * URL format, and will look something like "sip:account@serviceprovider". + * URL format, and will look something like "sip:account@serviceprovider" + * or "\"Display Name\" <sip:account@provider>". * * This field is mandatory. */ @@ -4534,7 +4535,8 @@ PJ_DECL(pj_status_t) pjsua_call_update2(pjsua_call_id call_id, * of the call transfer request. * * @param call_id The call id to be transfered. - * @param dest Address of new target to be contacted. + * @param dest URI of new target to be contacted. The URI may be + * in name address or addr-spec format. * @param msg_data Optional message components to be sent with * the request. * diff --git a/pjsip/src/pjsip/sip_parser.c b/pjsip/src/pjsip/sip_parser.c index ccdf5d35..56ce484c 100644 --- a/pjsip/src/pjsip/sip_parser.c +++ b/pjsip/src/pjsip/sip_parser.c @@ -1522,8 +1522,15 @@ static pjsip_name_addr *int_parse_name_addr( pj_scanner *scanner, /* Get the SIP-URL */ has_bracket = (*scanner->curptr == '<'); - if (has_bracket) + if (has_bracket) { pj_scan_get_char(scanner); + } else if (name_addr->display.slen) { + /* Must have bracket now (2012-10-26). + * Allowing (invalid) name-addr to pass URI verification will + * cause us to send invalid URI to the wire. + */ + PJ_THROW( PJSIP_SYN_ERR_EXCEPTION); + } name_addr->uri = int_parse_uri( scanner, pool, PJ_TRUE ); if (has_bracket) { if (pj_scan_get_char(scanner) != '>') |