- Timestamp:
- Apr 17, 2014 9:13:01 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r4806 r4819 29 29 #include <pjmedia/sdp_neg.h> 30 30 #include <pjmedia/errno.h> 31 #include <pj/array.h> 31 32 #include <pj/string.h> 32 33 #include <pj/pool.h> … … 1673 1674 hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_SUPPORTED, NULL); 1674 1675 if (hdr) { 1675 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 1676 pjsip_hdr_shallow_clone(tdata->pool, hdr)); 1676 pjsip_supported_hdr *h_sup; 1677 1678 h_sup = (pjsip_supported_hdr*) pjsip_hdr_clone(tdata->pool, hdr); 1679 /* Remove "timer" from Supported header if Session-Timers is 1680 * disabled (https://trac.pjsip.org/repos/ticket/1761) 1681 */ 1682 if ((inv->options & PJSIP_INV_SUPPORT_TIMER) == 0) { 1683 unsigned i; 1684 const pj_str_t STR_TIMER = { "timer", 5 }; 1685 for (i=0; i<h_sup->count; ++i) { 1686 if (pj_stricmp(&h_sup->values[i], &STR_TIMER)==0) { 1687 pj_array_erase(h_sup->values, sizeof(h_sup->values[0]), 1688 h_sup->count, i); 1689 --h_sup->count; 1690 break; 1691 } 1692 } 1693 } 1694 1695 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)h_sup); 1677 1696 } 1678 1697 … … 2846 2865 hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_SUPPORTED, NULL); 2847 2866 if (hdr) { 2848 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 2849 pjsip_hdr_shallow_clone(tdata->pool, hdr)); 2867 pjsip_supported_hdr *h_sup; 2868 2869 h_sup = (pjsip_supported_hdr*) pjsip_hdr_clone(tdata->pool, hdr); 2870 /* Remove "timer" from Supported header if Session-Timers is 2871 * disabled (https://trac.pjsip.org/repos/ticket/1761) 2872 */ 2873 if ((inv->options & PJSIP_INV_SUPPORT_TIMER) == 0) { 2874 unsigned i; 2875 const pj_str_t STR_TIMER = { "timer", 5 }; 2876 for (i=0; i<h_sup->count; ++i) { 2877 if (pj_stricmp(&h_sup->values[i], &STR_TIMER)==0) { 2878 pj_array_erase(h_sup->values, sizeof(h_sup->values[0]), 2879 h_sup->count, i); 2880 --h_sup->count; 2881 break; 2882 } 2883 } 2884 } 2885 2886 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)h_sup); 2850 2887 } 2851 2888
Note: See TracChangeset
for help on using the changeset viewer.