Changeset 2194 for pjproject/trunk/pjsip/src/pjsip/sip_dialog.c
- Timestamp:
- Aug 5, 2008 8:14:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_dialog.c
r2179 r2194 308 308 { 309 309 pj_status_t status; 310 pjsip_hdr *contact_hdr; 310 pjsip_hdr *pos = NULL; 311 pjsip_contact_hdr *contact_hdr; 311 312 pjsip_rr_hdr *rr; 312 313 pjsip_transaction *tsx = NULL; … … 417 418 418 419 419 /* Init remote's contact from Contact header. */ 420 contact_hdr = (pjsip_hdr*) 421 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 422 NULL); 420 /* Init remote's contact from Contact header. 421 * Iterate the Contact URI until we find sip: or sips: scheme. 422 */ 423 do { 424 contact_hdr = (pjsip_contact_hdr*) 425 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 426 pos); 427 if (contact_hdr) { 428 if (!PJSIP_URI_SCHEME_IS_SIP(contact_hdr->uri) && 429 !PJSIP_URI_SCHEME_IS_SIPS(contact_hdr->uri)) 430 { 431 pos = (pjsip_hdr*)contact_hdr->next; 432 if (pos == &rdata->msg_info.msg->hdr) 433 contact_hdr = NULL; 434 } else { 435 break; 436 } 437 } 438 } while (contact_hdr); 439 423 440 if (!contact_hdr) { 424 441 status = PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_BAD_REQUEST); 425 442 goto on_error; 426 443 } 444 427 445 dlg->remote.contact = (pjsip_contact_hdr*) 428 pjsip_hdr_clone(dlg->pool, contact_hdr);446 pjsip_hdr_clone(dlg->pool, (pjsip_hdr*)contact_hdr); 429 447 430 448 /* Init remote's CSeq from CSeq header */
Note: See TracChangeset
for help on using the changeset viewer.