|
|
|
@ -4222,7 +4222,10 @@ static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *si
|
|
|
|
|
const char *to = get_header(req, "To");
|
|
|
|
|
const char *cseq = get_header(req, "Cseq");
|
|
|
|
|
|
|
|
|
|
if (!callid || !to || !from || !cseq) /* Call-ID, to, from and Cseq are required by RFC 3261. (Max-forwards and via too - ignored now) */
|
|
|
|
|
/* Call-ID, to, from and Cseq are required by RFC 3261. (Max-forwards and via too - ignored now) */
|
|
|
|
|
/* get_header always returns non-NULL so we must use ast_strlen_zero() */
|
|
|
|
|
if (ast_strlen_zero(callid) || ast_strlen_zero(to) ||
|
|
|
|
|
ast_strlen_zero(from) || ast_strlen_zero(cseq))
|
|
|
|
|
return NULL; /* Invalid packet */
|
|
|
|
|
|
|
|
|
|
if (pedanticsipchecking) {
|
|
|
|
@ -7710,7 +7713,7 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
|
|
|
|
|
|
|
|
|
|
/* Save User agent */
|
|
|
|
|
useragent = get_header(req, "User-Agent");
|
|
|
|
|
if (useragent && strcasecmp(useragent, peer->useragent)) {
|
|
|
|
|
if (strcasecmp(useragent, peer->useragent)) { /* XXX copy if they are different ? */
|
|
|
|
|
ast_copy_string(peer->useragent, useragent, sizeof(peer->useragent));
|
|
|
|
|
if (option_verbose > 3)
|
|
|
|
|
ast_verbose(VERBOSE_PREFIX_3 "Saved useragent \"%s\" for peer %s\n", peer->useragent, peer->name);
|
|
|
|
@ -8460,7 +8463,8 @@ static int get_refer_info(struct sip_pvt *transferer, struct sip_request *outgoi
|
|
|
|
|
if (!req)
|
|
|
|
|
req = &transferer->initreq;
|
|
|
|
|
|
|
|
|
|
if (!(p_refer_to = get_header(req, "Refer-To"))) {
|
|
|
|
|
p_refer_to = get_header(req, "Refer-To");
|
|
|
|
|
if (ast_strlen_zero(p_refer_to)) {
|
|
|
|
|
ast_log(LOG_WARNING, "Refer-To Header missing. Skipping transfer.\n");
|
|
|
|
|
return -2; /* Syntax error */
|
|
|
|
|
}
|
|
|
|
@ -8476,7 +8480,8 @@ static int get_refer_info(struct sip_pvt *transferer, struct sip_request *outgoi
|
|
|
|
|
refer_to += 4; /* Skip sip: */
|
|
|
|
|
|
|
|
|
|
/* Get referred by header if it exists */
|
|
|
|
|
if ((p_referred_by = get_header(req, "Referred-By"))) {
|
|
|
|
|
p_referred_by = get_header(req, "Referred-By");
|
|
|
|
|
if (!ast_strlen_zero(p_referred_by)) {
|
|
|
|
|
char *lessthan;
|
|
|
|
|
h_referred_by = ast_strdupa(p_referred_by);
|
|
|
|
|
if (pedanticsipchecking)
|
|
|
|
@ -11767,6 +11772,8 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str
|
|
|
|
|
/* according to section 6.13 of RFC, contact headers override
|
|
|
|
|
expires headers, so check those first */
|
|
|
|
|
expires = 0;
|
|
|
|
|
|
|
|
|
|
/* XXX todo: try to save the extra call */
|
|
|
|
|
if (!ast_strlen_zero(get_header(req, "Contact"))) {
|
|
|
|
|
const char *contact = NULL;
|
|
|
|
|
const char *tmptmp = NULL;
|
|
|
|
@ -12856,13 +12863,13 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
|
|
|
|
|
/* Find out what they support */
|
|
|
|
|
if (!p->sipoptions) {
|
|
|
|
|
const char *supported = get_header(req, "Supported");
|
|
|
|
|
if (supported)
|
|
|
|
|
if (!ast_strlen_zero(supported))
|
|
|
|
|
parse_sip_options(p, supported);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Find out what they require */
|
|
|
|
|
required = get_header(req, "Require");
|
|
|
|
|
if (required && !ast_strlen_zero(required)) {
|
|
|
|
|
if (!ast_strlen_zero(required)) {
|
|
|
|
|
required_profile = parse_sip_options(NULL, required);
|
|
|
|
|
if (required_profile && required_profile != SIP_OPT_REPLACES) {
|
|
|
|
|
/* At this point we only support REPLACES */
|
|
|
|
@ -12894,7 +12901,8 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((p_replaces = get_header(req, "Replaces")) && !ast_strlen_zero(p_replaces)) {
|
|
|
|
|
p_replaces = get_header(req, "Replaces");
|
|
|
|
|
if (!ast_strlen_zero(p_replaces)) {
|
|
|
|
|
/* We have a replaces header */
|
|
|
|
|
char *ptr;
|
|
|
|
|
char *fromtag = NULL;
|
|
|
|
|