Changeset 1241 for pjproject/trunk/pjsip/src/pjsip-simple/evsub.c
- Timestamp:
- May 2, 2007 5:14:29 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-simple/evsub.c
r974 r1241 52 52 const pjsip_method pjsip_subscribe_method = 53 53 { 54 PJSIP_SUBSCRIBE_METHOD,54 (pjsip_method_e) PJSIP_SUBSCRIBE_METHOD, 55 55 { "SUBSCRIBE", 9 } 56 56 }; … … 58 58 const pjsip_method pjsip_notify_method = 59 59 { 60 PJSIP_NOTIFY_METHOD,60 (pjsip_method_e) PJSIP_NOTIFY_METHOD, 61 61 { "NOTIFY", 6 } 62 62 }; … … 328 328 PJ_DEF(pjsip_evsub*) pjsip_tsx_get_evsub(pjsip_transaction *tsx) 329 329 { 330 return tsx->mod_data[mod_evsub.mod.id];330 return (pjsip_evsub*) tsx->mod_data[mod_evsub.mod.id]; 331 331 } 332 332 … … 396 396 /* Create new event package: */ 397 397 398 pkg = pj_pool_alloc(mod_evsub.pool, sizeof(struct evpkg));398 pkg = PJ_POOL_ALLOC_T(mod_evsub.pool, struct evpkg); 399 399 pkg->pkg_mod = pkg_mod; 400 400 pkg->pkg_expires = expires; … … 509 509 set_timer(sub, TIMER_TYPE_NONE, 0); 510 510 511 /* Remo te this session from dialog's list of subscription */512 dlgsub_head = sub->dlg->mod_data[mod_evsub.mod.id];511 /* Remove this session from dialog's list of subscription */ 512 dlgsub_head = (struct dlgsub *) sub->dlg->mod_data[mod_evsub.mod.id]; 513 513 dlgsub = dlgsub_head->next; 514 514 while (dlgsub != dlgsub_head) { … … 573 573 PJ_UNUSED_ARG(timer_heap); 574 574 575 sub = entry->user_data;575 sub = (pjsip_evsub*) entry->user_data; 576 576 577 577 pjsip_dlg_inc_lock(sub->dlg); … … 674 674 /* Init attributes: */ 675 675 676 sub = pj_pool_zalloc(dlg->pool, sizeof(struct pjsip_evsub));676 sub = PJ_POOL_ZALLOC_T(dlg->pool, struct pjsip_evsub); 677 677 sub->pool = dlg->pool; 678 678 sub->endpt = dlg->endpt; … … 685 685 sub->state_str = evsub_state_names[sub->state]; 686 686 sub->expires = pjsip_expires_hdr_create(sub->pool, pkg->pkg_expires); 687 sub->accept = pjsip_hdr_clone(sub->pool, pkg->pkg_accept); 687 sub->accept = (pjsip_accept_hdr*) 688 pjsip_hdr_clone(sub->pool, pkg->pkg_accept); 688 689 689 690 sub->timer.user_data = sub; … … 707 708 /* Create subcription list: */ 708 709 709 dlgsub_head = pj_pool_alloc(sub->pool, sizeof(struct dlgsub));710 dlgsub = pj_pool_alloc(sub->pool, sizeof(struct dlgsub));710 dlgsub_head = PJ_POOL_ALLOC_T(sub->pool, struct dlgsub); 711 dlgsub = PJ_POOL_ALLOC_T(sub->pool, struct dlgsub); 711 712 dlgsub->sub = sub; 712 713 … … 829 830 830 831 /* Just duplicate Event header from the request */ 831 sub->event = pjsip_hdr_clone(sub->pool, event_hdr);832 sub->event = (pjsip_event_hdr*) pjsip_hdr_clone(sub->pool, event_hdr); 832 833 833 834 /* Set the method: */ … … 851 852 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_ACCEPT, NULL); 852 853 if (accept_hdr) 853 sub->accept = pjsip_hdr_clone(sub->pool,accept_hdr);854 sub->accept = (pjsip_accept_hdr*)pjsip_hdr_clone(sub->pool,accept_hdr); 854 855 855 856 /* We can start the session: */ … … 942 943 943 944 /* Add Event header: */ 944 pjsip_msg_add_hdr( tdata->msg, 945 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 945 946 pjsip_hdr_shallow_clone(tdata->pool, sub->event)); 946 947 … … 948 949 if (expires >= 0) 949 950 sub->expires->ivalue = expires; 950 pjsip_msg_add_hdr( tdata->msg, 951 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 951 952 pjsip_hdr_shallow_clone(tdata->pool, sub->expires)); 952 953 953 954 /* Add Accept header: */ 954 pjsip_msg_add_hdr( tdata->msg, 955 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 955 956 pjsip_hdr_shallow_clone(tdata->pool, sub->accept)); 956 957 957 958 958 959 /* Add Allow-Events header: */ 959 pjsip_msg_add_hdr( tdata->msg, 960 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 960 961 pjsip_hdr_shallow_clone(tdata->pool, 961 962 mod_evsub.allow_events_hdr)); … … 1012 1013 1013 1014 /* Add expires header: */ 1014 pjsip_msg_add_hdr( tdata->msg, 1015 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 1015 1016 pjsip_hdr_shallow_clone(tdata->pool, sub->expires)); 1016 1017 … … 1019 1020 const pjsip_hdr *hdr = hdr_list->next; 1020 1021 while (hdr != hdr_list) { 1021 pjsip_msg_add_hdr( tdata->msg, 1022 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 1022 1023 pjsip_hdr_clone(tdata->pool, hdr)); 1023 1024 hdr = hdr->next; … … 1118 1119 1119 1120 /* Add Event header */ 1120 pjsip_msg_add_hdr(tdata->msg, 1121 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 1121 1122 pjsip_hdr_shallow_clone(tdata->pool, sub->event)); 1122 1123 … … 1127 1128 1128 1129 /* Add Allow-Events header */ 1129 pjsip_msg_add_hdr(tdata->msg, 1130 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 1130 1131 pjsip_hdr_shallow_clone(tdata->pool, mod_evsub.allow_events_hdr)); 1131 1132 … … 1259 1260 } 1260 1261 1261 event_hdr = pjsip_msg_find_hdr_by_name(msg, &STR_EVENT, NULL); 1262 event_hdr = (pjsip_event_hdr*) 1263 pjsip_msg_find_hdr_by_name(msg, &STR_EVENT, NULL); 1262 1264 if (!event_hdr) { 1263 1265 /* Not subscription related message */ … … 1269 1271 */ 1270 1272 1271 dlgsub_head = dlg->mod_data[mod_evsub.mod.id];1273 dlgsub_head = (struct dlgsub*) dlg->mod_data[mod_evsub.mod.id]; 1272 1274 if (dlgsub_head == NULL) { 1273 dlgsub_head = pj_pool_alloc(dlg->pool, sizeof(struct dlgsub));1275 dlgsub_head = PJ_POOL_ALLOC_T(dlg->pool, struct dlgsub); 1274 1276 pj_list_init(dlgsub_head); 1275 1277 dlg->mod_data[mod_evsub.mod.id] = dlgsub_head; … … 1417 1419 hdr = res_hdr->next; 1418 1420 while (hdr != res_hdr) { 1419 pjsip_msg_add_hdr( tdata->msg, 1421 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 1420 1422 pjsip_hdr_clone(tdata->pool, hdr)); 1421 1423 hdr = hdr->next; … … 1550 1552 1551 1553 msg = event->body.tsx_state.src.rdata->msg_info.msg; 1552 expires = pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL); 1554 expires = (pjsip_expires_hdr*) 1555 pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL); 1553 1556 if (expires) { 1554 1557 sub->expires->ivalue = expires->ivalue; … … 1656 1659 1657 1660 /* Get subscription state header. */ 1658 sub_state = pjsip_msg_find_hdr_by_name(msg, &STR_SUB_STATE, NULL); 1661 sub_state = (pjsip_sub_state_hdr*) 1662 pjsip_msg_find_hdr_by_name(msg, &STR_SUB_STATE, NULL); 1659 1663 if (sub_state == NULL) { 1660 1664 … … 1804 1808 * or package default expiration time. 1805 1809 */ 1806 event_hdr = pjsip_msg_find_hdr_by_name(msg, &STR_EVENT, NULL); 1807 expires = pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL); 1810 event_hdr = (pjsip_event_hdr*) 1811 pjsip_msg_find_hdr_by_name(msg, &STR_EVENT, NULL); 1812 expires = (pjsip_expires_hdr*) 1813 pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL); 1808 1814 if (event_hdr && expires) { 1809 1815 struct evpkg *evpkg; … … 1860 1866 if (status == PJ_SUCCESS) { 1861 1867 /* Add expires header: */ 1862 pjsip_msg_add_hdr( tdata->msg, 1868 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 1863 1869 pjsip_hdr_shallow_clone(tdata->pool, 1864 1870 sub->expires));
Note: See TracChangeset
for help on using the changeset viewer.