diff options
author | Liong Sauw Ming <ming@teluu.com> | 2013-02-27 10:16:08 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2013-02-27 10:16:08 +0000 |
commit | e0b9872e5b72532014d4f2fd8116662cc92fdf64 (patch) | |
tree | be3ac789db5892454d95b218849b56ebdcf24520 /pjsip/src | |
parent | 1703f7d9893e43ae31e81cb9de5b26420e2f6857 (diff) |
Re #1559: Backported to 1.x, except r4312,r4330
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@4387 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src')
-rw-r--r-- | pjsip/src/pjsip/sip_parser.c | 9 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 15 |
2 files changed, 23 insertions, 1 deletions
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) != '>') diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 434bbee4..0d700bd7 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -34,6 +34,17 @@ */ #define LOCK_CODEC_MAX_RETRY 5 + +/* + * The INFO method. + */ +const pjsip_method pjsip_info_method = +{ + PJSIP_OTHER_METHOD, + { "INFO", 4 } +}; + + /* This callback receives notification from invite session when the * session state has changed. */ @@ -175,6 +186,10 @@ pj_status_t pjsua_call_subsys_init(const pjsua_config *cfg) pjsip_endpt_add_capability(pjsua_var.endpt, NULL, PJSIP_H_SUPPORTED, NULL, 1, &str_norefersub); + /* Add "INFO" in Allow header, for DTMF and video key frame request. */ + pjsip_endpt_add_capability(pjsua_var.endpt, NULL, PJSIP_H_ALLOW, + NULL, 1, &pjsip_info_method.name); + return status; } |