summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
Diffstat (limited to 'pjmedia')
-rw-r--r--pjmedia/include/pjmedia/config.h24
-rw-r--r--pjmedia/src/pjmedia/endpoint.c10
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) {