Changeset 1241 for pjproject/trunk/pjsip/src/pjsip-simple/presence.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/presence.c
r974 r1241 198 198 199 199 /* Create presence */ 200 pres = pj_pool_zalloc(dlg->pool, sizeof(pjsip_pres));200 pres = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_pres); 201 201 pres->dlg = dlg; 202 202 pres->sub = sub; … … 245 245 246 246 /* Check that Event header contains "presence" */ 247 event = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &STR_EVENT, NULL); 247 event = (pjsip_event_hdr*) 248 pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &STR_EVENT, NULL); 248 249 if (!event) { 249 250 return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_BAD_REQUEST); … … 254 255 255 256 /* Check that request contains compatible Accept header. */ 256 accept = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_ACCEPT, NULL); 257 accept = (pjsip_accept_hdr*) 258 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_ACCEPT, NULL); 257 259 if (accept) { 258 260 unsigned i; … … 281 283 282 284 /* Check that expires is not too short. */ 283 expires_hdr=pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_EXPIRES, NULL); 285 expires_hdr=(pjsip_expires_hdr*) 286 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_EXPIRES, NULL); 284 287 if (expires_hdr) { 285 288 if (expires_hdr->ivalue < 5) { … … 305 308 306 309 /* Create server presence subscription */ 307 pres = pj_pool_zalloc(dlg->pool, sizeof(pjsip_pres));310 pres = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_pres); 308 311 pres->dlg = dlg; 309 312 pres->sub = sub; … … 367 370 PJ_ASSERT_RETURN(sub && status, PJ_EINVAL); 368 371 369 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);372 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 370 373 PJ_ASSERT_RETURN(pres!=NULL, PJSIP_SIMPLE_ENOPRESENCE); 371 374 … … 390 393 PJ_ASSERT_RETURN(sub && status, PJ_EINVAL); 391 394 392 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);395 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 393 396 PJ_ASSERT_RETURN(pres!=NULL, PJSIP_SIMPLE_ENOPRESENCE); 394 397 … … 423 426 424 427 /* Get publisher URI */ 425 entity.ptr = pj_pool_alloc(tdata->pool, PJSIP_MAX_URL_SIZE);428 entity.ptr = (char*) pj_pool_alloc(tdata->pool, PJSIP_MAX_URL_SIZE); 426 429 entity.slen = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, 427 430 pres->dlg->local.info->uri, … … 463 466 464 467 /* Get the presence object. */ 465 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);468 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 466 469 PJ_ASSERT_RETURN(pres != NULL, PJSIP_SIMPLE_ENOPRESENCE); 467 470 … … 509 512 510 513 /* Get the presence object. */ 511 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);514 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 512 515 PJ_ASSERT_RETURN(pres != NULL, PJSIP_SIMPLE_ENOPRESENCE); 513 516 … … 559 562 pjsip_pres *pres; 560 563 561 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);564 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 562 565 PJ_ASSERT_ON_FAIL(pres!=NULL, {return;}); 563 566 … … 574 577 pjsip_pres *pres; 575 578 576 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);579 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 577 580 PJ_ASSERT_ON_FAIL(pres!=NULL, {return;}); 578 581 … … 594 597 pjsip_pres *pres; 595 598 596 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);599 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 597 600 PJ_ASSERT_ON_FAIL(pres!=NULL, {return;}); 598 601 … … 722 725 pj_status_t status; 723 726 724 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);727 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 725 728 PJ_ASSERT_ON_FAIL(pres!=NULL, {return;}); 726 729 … … 774 777 pjsip_pres *pres; 775 778 776 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);779 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 777 780 PJ_ASSERT_ON_FAIL(pres!=NULL, {return;}); 778 781 … … 796 799 pjsip_pres *pres; 797 800 798 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);801 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 799 802 PJ_ASSERT_ON_FAIL(pres!=NULL, {return;}); 800 803
Note: See TracChangeset
for help on using the changeset viewer.