Index: pjproject/trunk/pjmedia/include/pjmedia/config.h
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia/config.h	(revision 4573)
+++ pjproject/trunk/pjmedia/include/pjmedia/config.h	(revision 4577)
@@ -669,4 +669,17 @@
 #endif
 
+/**
+ * This specifies the behavior of the SDP negotiator when responding to an
+ * offer, whether it should answer with multiple formats or not.
+ *
+ * Note that this behavior can be changed during run-time by calling
+ * pjmedia_sdp_neg_set_allow_multiple_codecs().
+ *
+ * Default is 0 (to maintain backward compatibility)
+ */
+#ifndef PJMEDIA_SDP_NEG_ANSWER_MULTIPLE_CODECS
+#   define PJMEDIA_SDP_NEG_ANSWER_MULTIPLE_CODECS	0
+#endif
+
 
 /**
Index: pjproject/trunk/pjmedia/include/pjmedia/sdp_neg.h
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia/sdp_neg.h	(revision 4573)
+++ pjproject/trunk/pjmedia/include/pjmedia/sdp_neg.h	(revision 4577)
@@ -417,4 +417,21 @@
 					      pj_bool_t prefer_remote);
 
+/**
+ * This specifies the behavior of the SDP negotiator when responding to an
+ * offer, whether it should answer with multiple formats or not.
+ *
+ * By default, the value in PJMEDIA_SDP_NEG_ANSWER_MULTIPLE_CODECS will
+ * be used.
+ *
+ * @param neg           The SDP negotiator instance.
+ * @param answer_multiple
+ *                      If non-zero, the negotiator will respond with
+ *                      multiple formats. If zero only a single format
+ *                      will be returned.
+ */
+PJ_DECL(pj_status_t)
+pjmedia_sdp_neg_set_answer_multiple_codecs(pjmedia_sdp_neg *neg,
+                                           pj_bool_t answer_multiple);
+
 
 /**
Index: pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c	(revision 4573)
+++ pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c	(revision 4577)
@@ -34,4 +34,5 @@
     pjmedia_sdp_neg_state state;	    /**< Negotiator state.	     */
     pj_bool_t		  prefer_remote_codec_order;
+    pj_bool_t             answer_with_multiple_codecs;
     pj_bool_t		  has_remote_answer;
     pj_bool_t		  answer_was_remote;
@@ -115,4 +116,5 @@
     neg->state = PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER;
     neg->prefer_remote_codec_order = PJMEDIA_SDP_NEG_PREFER_REMOTE_CODEC_ORDER;
+    neg->answer_with_multiple_codecs = PJMEDIA_SDP_NEG_ANSWER_MULTIPLE_CODECS;
     neg->initial_sdp = pjmedia_sdp_session_clone(pool, local);
     neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, local);
@@ -179,4 +181,17 @@
     PJ_ASSERT_RETURN(neg, PJ_EINVAL);
     neg->prefer_remote_codec_order = prefer_remote;
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Set multiple codec answering.
+ */
+PJ_DEF(pj_status_t) pjmedia_sdp_neg_set_answer_multiple_codecs(
+                        pjmedia_sdp_neg *neg,
+                        pj_bool_t answer_multiple)
+{
+    PJ_ASSERT_RETURN(neg, PJ_EINVAL);
+    neg->answer_with_multiple_codecs = answer_multiple;
     return PJ_SUCCESS;
 }
@@ -1011,4 +1026,5 @@
 static pj_status_t match_offer(pj_pool_t *pool,
 			       pj_bool_t prefer_remote_codec_order,
+                               pj_bool_t answer_with_multiple_codecs,
 			       const pjmedia_sdp_media *offer,
 			       const pjmedia_sdp_media *preanswer,
@@ -1076,9 +1092,9 @@
 		master_has_codec = 1;
 
-		/* We just need to select one codec. 
+		/* We just need to select one codec if not allowing multiple.
 		 * Continue if we have selected matching codec for previous 
 		 * payload.
 		 */
-		if (found_matching_codec)
+		if (!answer_with_multiple_codecs && found_matching_codec)
 		    continue;
 
@@ -1120,5 +1136,5 @@
 		} else {
 		    master_has_codec = 1;
-		    if (found_matching_codec)
+		    if (!answer_with_multiple_codecs && found_matching_codec)
 			continue;
 		    is_codec = 1;
@@ -1278,4 +1294,5 @@
 static pj_status_t create_answer( pj_pool_t *pool,
 				  pj_bool_t prefer_remote_codec_order,
+                                  pj_bool_t answer_with_multiple_codecs,
 				  const pjmedia_sdp_session *initial,
 				  const pjmedia_sdp_session *offer,
@@ -1327,5 +1344,6 @@
 
 		/* See if it has matching codec. */
-		status2 = match_offer(pool, prefer_remote_codec_order, 
+		status2 = match_offer(pool, prefer_remote_codec_order,
+                                      answer_with_multiple_codecs,
 				      om, im, initial, &am);
 		if (status2 == PJ_SUCCESS) {
@@ -1425,5 +1443,6 @@
 	pjmedia_sdp_session *answer = NULL;
 
-	status = create_answer(pool, neg->prefer_remote_codec_order, 
+	status = create_answer(pool, neg->prefer_remote_codec_order,
+                               neg->answer_with_multiple_codecs,
 			       neg->neg_local_sdp, neg->neg_remote_sdp,
 			       &answer);
