- Timestamp:
- Jan 21, 2010 5:07:28 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_util.c
r2932 r3069 486 486 pjsip_msg *msg, *req_msg; 487 487 pjsip_hdr *hdr; 488 pjsip_via_hdr *via; 488 pjsip_to_hdr *to_hdr; 489 pjsip_via_hdr *top_via = NULL, *via; 489 490 pjsip_rr_hdr *rr; 490 491 pj_status_t status; … … 528 529 via = rdata->msg_info.via; 529 530 while (via) { 530 pjsip_msg_add_hdr( msg, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, via)); 531 pjsip_via_hdr *new_via; 532 533 new_via = (pjsip_via_hdr*)pjsip_hdr_clone(tdata->pool, via); 534 if (top_via == NULL) 535 top_via = new_via; 536 537 pjsip_msg_add_hdr( msg, (pjsip_hdr*)new_via); 531 538 via = via->next; 532 539 if (via != (void*)&req_msg->hdr) … … 559 566 560 567 /* Copy To header. */ 561 hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, rdata->msg_info.to); 562 pjsip_msg_add_hdr( msg, hdr); 568 to_hdr = (pjsip_to_hdr*) pjsip_hdr_clone(tdata->pool, rdata->msg_info.to); 569 pjsip_msg_add_hdr( msg, (pjsip_hdr*)to_hdr); 570 571 /* Must add To tag in the response (Section 8.2.6.2), except if this is 572 * 100 (Trying) response. Same tag must be created for the same request 573 * (e.g. same tag in provisional and final response). The easiest way 574 * to do this is to derive the tag from Via branch parameter (or to 575 * use it directly). 576 */ 577 if (st_code > 100 && top_via) { 578 to_hdr->tag = top_via->branch_param; 579 } 563 580 564 581 /* Copy CSeq header. */
Note: See TracChangeset
for help on using the changeset viewer.