- Again '*' Contact header in unREGISTER

- new: tools/extract_sip.pl
This commit is contained in:
Thomas Ries
2004-03-30 19:45:01 +00:00
parent 2fba2bcb3b
commit e3ed50d8db
4 changed files with 53 additions and 17 deletions

View File

@@ -242,19 +242,38 @@ int register_client(osip_message_t *my_msg, int force_lcl_masq) {
}
url1_to=my_msg->to->url;
url1_contact=((osip_contact_t*)(my_msg->contacts->node->element))->url;
DEBUGC(DBCLASS_REG,"register: %s@%s expires=%i seconds",
(url1_contact->username) ? url1_contact->username : "*NULL*",
(url1_contact->host) ? url1_contact->host : "*NULL*",
expires);
/*
* REGISTER
*/
if (expires > 0) {
/* Update registration. There are two possibilities:
/*
* First make sure, we have a prober Contact header:
* - url
* - url -> hostname
*
* Libosip parses an:
* "Contact: *"
* the following way (Note: Display name!! and URL is NULL)
* (gdb) p *((osip_contact_t*)(sip->contacts->node->element))
* $5 = {displayname = 0x8af8848 "*", url = 0x0, gen_params = 0x8af8838}
*/
url1_contact=((osip_contact_t*)(my_msg->contacts->node->element))->url;
if ((url1_contact == NULL) || (url1_contact->host == NULL)) {
/* Don't have reqiured Contact fields */
ERROR("tried registration with empty Contact header");
return STS_FAILURE;
}
DEBUGC(DBCLASS_REG,"register: %s@%s expires=%i seconds",
(url1_contact->username) ? url1_contact->username : "*NULL*",
(url1_contact->host) ? url1_contact->host : "*NULL*",
expires);
/*
* Update registration. There are two possibilities:
* - already registered, then update the existing record
* - not registered, then create a new record
*/

View File

@@ -239,17 +239,6 @@ RFC 3261 SIP: Session Initiation Protocol June 2002
return STS_FAILURE;
}
/*
* check for existing Contact: header
* according to RFC3261 not mandatory, but siproxd relies on it
* on REGISTER...
*/
if (MSG_IS_REGISTER(sip) && ((sip->contacts==NULL)||
(sip->contacts->node==NULL)||(sip->contacts->node->element==NULL)||
((osip_contact_t*)(sip->contacts->node->element))->url==NULL)) {
ERROR("security check failed: NULL Contact Header");
return STS_FAILURE;
}
/* TODO: still way to go here ... */