Answer with multiple codecs if the underlying pjproject supports it.
[asterisk/asterisk.git] / res / res_pjsip_session.c
index fd13608..13c1e1d 100644 (file)
@@ -947,6 +947,9 @@ int ast_sip_session_create_invite(struct ast_sip_session *session, pjsip_tx_data
 
        pjsip_inv_set_local_sdp(session->inv_session, offer);
        pjmedia_sdp_neg_set_prefer_remote_codec_order(session->inv_session->neg, PJ_FALSE);
+#ifdef PJMEDIA_SDP_NEG_ANSWER_MULTIPLE_CODECS
+       pjmedia_sdp_neg_set_answer_multiple_codecs(session->inv_session->neg, PJ_TRUE);
+#endif
        if (pjsip_inv_invite(session->inv_session, tdata) != PJ_SUCCESS) {
                return -1;
        }
@@ -1459,6 +1462,9 @@ static int new_invite(void *data)
        } else {
                pjsip_inv_set_local_sdp(invite->session->inv_session, local);
                pjmedia_sdp_neg_set_prefer_remote_codec_order(invite->session->inv_session->neg, PJ_FALSE);
+#ifdef PJMEDIA_SDP_NEG_ANSWER_MULTIPLE_CODECS
+               pjmedia_sdp_neg_set_answer_multiple_codecs(invite->session->inv_session->neg, PJ_TRUE);
+#endif
        }
 
        pjsip_timer_setting_default(&timer);