Changeset 1266 for pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
- Timestamp:
- May 11, 2007 3:14:34 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r1242 r1266 230 230 return PJ_FALSE; 231 231 232 inv = dlg->mod_data[mod_inv.mod.id];232 inv = (pjsip_inv_session*) dlg->mod_data[mod_inv.mod.id]; 233 233 234 234 /* Report to dialog that we handle INVITE, CANCEL, BYE, ACK. … … 412 412 PJ_DEF(pjsip_inv_session*) pjsip_dlg_get_inv_session(pjsip_dialog *dlg) 413 413 { 414 return dlg->mod_data[mod_inv.mod.id];414 return (pjsip_inv_session*) dlg->mod_data[mod_inv.mod.id]; 415 415 } 416 416 … … 453 453 454 454 /* Create the session */ 455 inv = pj_pool_zalloc(dlg->pool, sizeof(pjsip_inv_session));455 inv = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_inv_session); 456 456 pj_assert(inv != NULL); 457 457 … … 578 578 579 579 /* Parse and validate SDP */ 580 status = pjmedia_sdp_parse(rdata->tp_info.pool, body->data, body->len,581 &sdp);580 status = pjmedia_sdp_parse(rdata->tp_info.pool, 581 (char*)body->data, body->len, &sdp); 582 582 if (status == PJ_SUCCESS) 583 583 status = pjmedia_sdp_validate(sdp); … … 651 651 * implicitly by sending this INVITE. 652 652 */ 653 allow = pjsip_msg_find_hdr(msg, PJSIP_H_ALLOW, NULL);653 allow = (pjsip_allow_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_ALLOW, NULL); 654 654 if (allow) { 655 655 unsigned i; … … 669 669 670 670 /* Check Supported header */ 671 sup_hdr = pjsip_msg_find_hdr(msg, PJSIP_H_SUPPORTED, NULL); 671 sup_hdr = (pjsip_supported_hdr*) 672 pjsip_msg_find_hdr(msg, PJSIP_H_SUPPORTED, NULL); 672 673 if (sup_hdr) { 673 674 unsigned i; … … 684 685 685 686 /* Check Require header */ 686 req_hdr = pjsip_msg_find_hdr(msg, PJSIP_H_REQUIRE, NULL); 687 req_hdr = (pjsip_require_hdr*) 688 pjsip_msg_find_hdr(msg, PJSIP_H_REQUIRE, NULL); 687 689 if (req_hdr) { 688 690 unsigned i; … … 743 745 pj_assert(h); 744 746 if (h) { 745 sup_hdr = pjsip_hdr_clone(rdata->tp_info.pool, h); 747 sup_hdr = (pjsip_supported_hdr*) 748 pjsip_hdr_clone(rdata->tp_info.pool, h); 746 749 pj_list_push_back(&res_hdr_list, sup_hdr); 747 750 } … … 783 786 pj_assert(h); 784 787 if (h) { 785 sup_hdr = pjsip_hdr_clone(rdata->tp_info.pool, h); 788 sup_hdr = (pjsip_supported_hdr*) 789 pjsip_hdr_clone(rdata->tp_info.pool, h); 786 790 pj_list_push_back(&res_hdr_list, sup_hdr); 787 791 } … … 815 819 pjsip_hdr *cloned; 816 820 817 cloned = pjsip_hdr_clone(tdata->pool, h);821 cloned = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, h); 818 822 PJ_ASSERT_RETURN(cloned, PJ_ENOMEM); 819 823 … … 875 879 876 880 /* Create the session */ 877 inv = pj_pool_zalloc(dlg->pool, sizeof(pjsip_inv_session));881 inv = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_inv_session); 878 882 pj_assert(inv != NULL); 879 883 … … 894 898 895 899 /* Parse and validate SDP */ 896 status = pjmedia_sdp_parse(inv->pool, body->data, body->len,900 status = pjmedia_sdp_parse(inv->pool, (char*)body->data, body->len, 897 901 &rem_sdp); 898 902 if (status == PJ_SUCCESS) … … 936 940 937 941 /* Attach our data to the transaction. */ 938 tsx_inv_data = pj_pool_zalloc(inv->invite_tsx->pool, 939 sizeof(struct tsx_inv_data)); 942 tsx_inv_data = PJ_POOL_ZALLOC_T(inv->invite_tsx->pool, struct tsx_inv_data); 940 943 tsx_inv_data->inv = inv; 941 944 inv->invite_tsx->mod_data[mod_inv.mod.id] = tsx_inv_data; … … 998 1001 { 999 1002 PJ_UNUSED_ARG(len); 1000 return pjmedia_sdp_session_clone(pool, data);1003 return pjmedia_sdp_session_clone(pool, (const pjmedia_sdp_session*)data); 1001 1004 } 1002 1005 1003 1006 static int print_sdp(pjsip_msg_body *body, char *buf, pj_size_t len) 1004 1007 { 1005 return pjmedia_sdp_print( body->data, buf, len);1008 return pjmedia_sdp_print((const pjmedia_sdp_session*)body->data, buf, len); 1006 1009 } 1007 1010 … … 1015 1018 pjsip_msg_body *body; 1016 1019 1017 body = pj_pool_zalloc(pool, sizeof(pjsip_msg_body));1020 body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body); 1018 1021 PJ_ASSERT_RETURN(body != NULL, PJ_ENOMEM); 1019 1022 … … 1083 1086 1084 1087 while (hdr != &inv->dlg->inv_hdr) { 1085 pjsip_msg_add_hdr(tdata->msg, 1088 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 1086 1089 pjsip_hdr_shallow_clone(tdata->pool, hdr)); 1087 1090 hdr = hdr->next; … … 1118 1121 hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_ALLOW, NULL); 1119 1122 if (hdr) { 1120 pjsip_msg_add_hdr(tdata->msg, 1123 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 1121 1124 pjsip_hdr_shallow_clone(tdata->pool, hdr)); 1122 1125 } … … 1125 1128 hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_SUPPORTED, NULL); 1126 1129 if (hdr) { 1127 pjsip_msg_add_hdr(tdata->msg, 1130 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 1128 1131 pjsip_hdr_shallow_clone(tdata->pool, hdr)); 1129 1132 } … … 1178 1181 1179 1182 /* Get/attach invite session's transaction data */ 1180 tsx_inv_data = tsx->mod_data[mod_inv.mod.id];1183 tsx_inv_data = (struct tsx_inv_data*) tsx->mod_data[mod_inv.mod.id]; 1181 1184 if (tsx_inv_data == NULL) { 1182 tsx_inv_data = pj_pool_zalloc(tsx->pool, sizeof(struct tsx_inv_data));1185 tsx_inv_data = PJ_POOL_ZALLOC_T(tsx->pool, struct tsx_inv_data); 1183 1186 tsx_inv_data->inv = inv; 1184 1187 tsx->mod_data[mod_inv.mod.id] = tsx_inv_data; … … 1208 1211 /* Parse the SDP body. */ 1209 1212 1210 status = pjmedia_sdp_parse(rdata->tp_info.pool, msg->body->data, 1213 status = pjmedia_sdp_parse(rdata->tp_info.pool, 1214 (char*)msg->body->data, 1211 1215 msg->body->len, &sdp); 1212 1216 if (status != PJ_SUCCESS) { … … 1588 1592 1589 1593 pj_strdup_with_null(inv->dlg->pool, &tmp, new_contact); 1590 contact_hdr = pjsip_parse_hdr(inv->dlg->pool, &STR_CONTACT, 1594 contact_hdr = (pjsip_contact_hdr*) 1595 pjsip_parse_hdr(inv->dlg->pool, &STR_CONTACT, 1591 1596 tmp.ptr, tmp.slen, NULL); 1592 1597 if (!contact_hdr) { … … 1685 1690 pjsip_dlg_inc_lock(inv->dlg); 1686 1691 1687 tsx_inv_data = pj_pool_zalloc(inv->pool, sizeof(struct tsx_inv_data));1692 tsx_inv_data = PJ_POOL_ZALLOC_T(inv->pool, struct tsx_inv_data); 1688 1693 tsx_inv_data->inv = inv; 1689 1694 … … 1701 1706 * request. 1702 1707 */ 1703 PJ_ASSERT_RETURN((cseq= pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL))!=NULL1708 PJ_ASSERT_RETURN((cseq=(pjsip_cseq_hdr*)pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL))!=NULL 1704 1709 && (cseq->cseq == inv->invite_tsx->cseq), 1705 1710 PJ_EINVALIDOP); … … 2416 2421 NULL); 2417 2422 if (accept) { 2418 pjsip_msg_add_hdr(tdata->msg, 2423 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 2419 2424 pjsip_hdr_clone(tdata->pool, accept)); 2420 2425 }
Note: See TracChangeset
for help on using the changeset viewer.