diff options
-rw-r--r-- | pjmedia/include/pjmedia/config.h | 24 | ||||
-rw-r--r-- | pjmedia/src/pjmedia/endpoint.c | 10 | ||||
-rw-r--r-- | pjsip-apps/src/pjsua/pjsua_app.c | 4 |
3 files changed, 32 insertions, 6 deletions
diff --git a/pjmedia/include/pjmedia/config.h b/pjmedia/include/pjmedia/config.h index 23e1318d..4765ef84 100644 --- a/pjmedia/include/pjmedia/config.h +++ b/pjmedia/include/pjmedia/config.h @@ -351,6 +351,30 @@ /** + * This macro controls whether pjmedia should include SDP rtpmap + * attribute for static payload types. SDP rtpmap for static + * payload types are optional, although they are normally included + * for interoperability reason. + * + * Note that there is also a run-time variable to turn this setting + * on or off, defined in endpoint.c. To access this variable, use + * the following construct + * + \verbatim + extern pj_bool_t pjmedia_add_rtpmap_for_static_pt; + + // Do not include rtpmap for static payload types (<96) + pjmedia_add_rtpmap_for_static_pt = PJ_FALSE; + \endverbatim + * + * Default: 1 (yes) + */ +#ifndef PJMEDIA_ADD_RTPMAP_FOR_STATIC_PT +# define PJMEDIA_ADD_RTPMAP_FOR_STATIC_PT 1 +#endif + + +/** * This macro declares the payload type for telephone-event * that is advertised by PJMEDIA for outgoing SDP. If this macro * is set to zero, telephone events would not be advertised nor diff --git a/pjmedia/src/pjmedia/endpoint.c b/pjmedia/src/pjmedia/endpoint.c index 5e643512..5848c4a3 100644 --- a/pjmedia/src/pjmedia/endpoint.c +++ b/pjmedia/src/pjmedia/endpoint.c @@ -45,6 +45,10 @@ static const pj_str_t STR_SENDRECV = { "sendrecv", 8 }; */ static int error_subsys_registered; +/* Config to control rtpmap inclusion for static payload types */ +pj_bool_t pjmedia_add_rtpmap_for_static_pt = + PJMEDIA_ADD_RTPMAP_FOR_STATIC_PT; + /** * Defined in pjmedia/errno.c @@ -394,8 +398,10 @@ PJ_DEF(pj_status_t) pjmedia_endpt_create_sdp( pjmedia_endpt *endpt, rtpmap.param.slen = 0; } - pjmedia_sdp_rtpmap_to_attr(pool, &rtpmap, &attr); - m->attr[m->attr_count++] = attr; + if (codec_info->pt >= 96 || pjmedia_add_rtpmap_for_static_pt) { + pjmedia_sdp_rtpmap_to_attr(pool, &rtpmap, &attr); + m->attr[m->attr_count++] = attr; + } /* Add fmtp mode where applicable */ if (codec_param.setting.dec_fmtp_mode != 0) { diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c index 3be107cd..98b6f2c4 100644 --- a/pjsip-apps/src/pjsua/pjsua_app.c +++ b/pjsip-apps/src/pjsua/pjsua_app.c @@ -96,8 +96,6 @@ static void stereo_demo(); #endif pj_status_t app_destroy(void); -extern pj_bool_t pjsip_use_compact_form; - /***************************************************************************** * Configuration manipulation */ @@ -2886,8 +2884,6 @@ pj_status_t app_init(int argc, char *argv[]) unsigned i; pj_status_t status; - //pjsip_use_compact_form = PJ_TRUE; - /* Create pjsua */ status = pjsua_create(); if (status != PJ_SUCCESS) |