Changeset 3363 for pjproject/trunk/pjsip/src/pjsip-simple/presence.c
- Timestamp:
- Nov 10, 2010 12:13:46 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-simple/presence.c
r3337 r3363 36 36 #define PRES_DEFAULT_EXPIRES PJSIP_PRES_DEFAULT_EXPIRES 37 37 38 #if PJSIP_PRES_BAD_CONTENT_RESPONSE < 200 || \ 39 PJSIP_PRES_BAD_CONTENT_RESPONSE > 699 || \ 40 PJSIP_PRES_BAD_CONTENT_RESPONSE/100 == 3 41 # error Invalid PJSIP_PRES_BAD_CONTENT_RESPONSE value 42 #endif 43 38 44 /* 39 45 * Presence module (mod-presence) … … 760 766 if (status != PJ_SUCCESS) { 761 767 /* Unsupported or bad Content-Type */ 762 pjsip_accept_hdr *accept_hdr; 763 pjsip_warning_hdr *warn_hdr; 764 765 *p_st_code = PJSIP_SC_NOT_ACCEPTABLE_HERE; 766 767 /* Add Accept header */ 768 accept_hdr = pjsip_accept_hdr_create(rdata->tp_info.pool); 769 accept_hdr->values[accept_hdr->count++] = STR_APP_PIDF_XML; 770 accept_hdr->values[accept_hdr->count++] = STR_APP_XPIDF_XML; 771 pj_list_push_back(res_hdr, accept_hdr); 772 773 /* Add Warning header */ 774 warn_hdr = pjsip_warning_hdr_create_from_status( 775 rdata->tp_info.pool, 776 pjsip_endpt_name(pres->dlg->endpt), 777 status); 778 pj_list_push_back(res_hdr, warn_hdr); 779 780 return status; 768 if (PJSIP_PRES_BAD_CONTENT_RESPONSE >= 300) { 769 pjsip_accept_hdr *accept_hdr; 770 pjsip_warning_hdr *warn_hdr; 771 772 *p_st_code = PJSIP_PRES_BAD_CONTENT_RESPONSE; 773 774 /* Add Accept header */ 775 accept_hdr = pjsip_accept_hdr_create(rdata->tp_info.pool); 776 accept_hdr->values[accept_hdr->count++] = STR_APP_PIDF_XML; 777 accept_hdr->values[accept_hdr->count++] = STR_APP_XPIDF_XML; 778 pj_list_push_back(res_hdr, accept_hdr); 779 780 /* Add Warning header */ 781 warn_hdr = pjsip_warning_hdr_create_from_status( 782 rdata->tp_info.pool, 783 pjsip_endpt_name(pres->dlg->endpt), 784 status); 785 pj_list_push_back(res_hdr, warn_hdr); 786 787 return status; 788 } else { 789 pj_assert(PJSIP_PRES_BAD_CONTENT_RESPONSE/100 == 2); 790 PJ_PERROR(4,(THIS_FILE, status, 791 "Ignoring presence error due to " 792 "PJSIP_PRES_BAD_CONTENT_RESPONSE setting [%d]", 793 PJSIP_PRES_BAD_CONTENT_RESPONSE)); 794 *p_st_code = PJSIP_PRES_BAD_CONTENT_RESPONSE; 795 status = PJ_SUCCESS; 796 } 781 797 } 782 798
Note: See TracChangeset
for help on using the changeset viewer.