diff options
-rw-r--r-- | pjmedia/include/pjmedia/config.h | 17 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_media.c | 7 |
2 files changed, 21 insertions, 3 deletions
diff --git a/pjmedia/include/pjmedia/config.h b/pjmedia/include/pjmedia/config.h index 4765ef84..0b7f542a 100644 --- a/pjmedia/include/pjmedia/config.h +++ b/pjmedia/include/pjmedia/config.h @@ -204,6 +204,19 @@ /** + * Specify whether RTCP should be advertised in SDP. This setting would + * affect whether RTCP candidate will be added in SDP when ICE is used. + * Application might want to disable RTCP advertisement in SDP to + * reduce the message size. + * + * Default: 1 (yes) + */ +#ifndef PJMEDIA_ADVERTISE_RTCP +# define PJMEDIA_ADVERTISE_RTCP 1 +#endif + + +/** * Interval to send RTCP packets, in msec */ #ifndef PJMEDIA_RTCP_INTERVAL @@ -343,10 +356,10 @@ /** * Support for sending and decoding RTCP port in SDP (RFC 3605). - * Default is yes. + * Default is equal to PJMEDIA_ADVERTISE_RTCP setting. */ #ifndef PJMEDIA_HAS_RTCP_IN_SDP -# define PJMEDIA_HAS_RTCP_IN_SDP 1 +# define PJMEDIA_HAS_RTCP_IN_SDP (PJMEDIA_ADVERTISE_RTCP) #endif diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c index 2c5b31b2..129e3aa7 100644 --- a/pjsip/src/pjsua-lib/pjsua_media.c +++ b/pjsip/src/pjsua-lib/pjsua_media.c @@ -557,8 +557,13 @@ static pj_status_t create_ice_media_transports(pjsua_transport_config *cfg) for (i=0; i<pjsua_var.ua_cfg.max_calls; ++i) { pj_ice_strans_comp comp; int next_port; +#if PJMEDIA_ADVERTISE_RTCP + enum { COMP_CNT=2 }; +#else + enum { COMP_CNT=1 }; +#endif - status = pjmedia_ice_create(pjsua_var.med_endpt, NULL, 2, + status = pjmedia_ice_create(pjsua_var.med_endpt, NULL, COMP_CNT, &pjsua_var.stun_cfg, &pjsua_var.calls[i].med_tp); if (status != PJ_SUCCESS) { |