diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-06-26 08:59:49 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-06-26 08:59:49 +0000 |
commit | 473fe50a16e1109196bfa4affa159e65a8598c08 (patch) | |
tree | 65321760d57e5bde9acd88e91a255657a0b8a3c3 /pjmedia | |
parent | 92940328690432692bb7e47e6d900c23d255771e (diff) |
Ticket #342: added configuration to control whether SDP rtpmap should be included for static payload types (default still yes)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1391 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r-- | pjmedia/include/pjmedia/config.h | 24 | ||||
-rw-r--r-- | pjmedia/src/pjmedia/endpoint.c | 10 |
2 files changed, 32 insertions, 2 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) { |