Index: pjproject/trunk/pjsip/include/pjsua2/endpoint.hpp
===================================================================
--- pjproject/trunk/pjsip/include/pjsua2/endpoint.hpp	(revision 6118)
+++ pjproject/trunk/pjsip/include/pjsua2/endpoint.hpp	(revision 6119)
@@ -1554,4 +1554,21 @@
      */
     void resetVideoCodecParam(const string &codec_id) PJSUA2_THROW(Error);
+
+#if defined(PJMEDIA_HAS_OPUS_CODEC) && (PJMEDIA_HAS_OPUS_CODEC!=0)
+    /**
+     * Get codec Opus config.
+     *
+     */
+     CodecOpusConfig getCodecOpusConfig() const PJSUA2_THROW(Error);
+
+    /**
+     * Set codec Opus config.
+     *
+     * @param opus_cfg	Codec Opus configuration.
+     *
+     */
+    void setCodecOpusConfig(const CodecOpusConfig &opus_cfg)
+			    PJSUA2_THROW(Error);
+#endif
 
     /**
Index: pjproject/trunk/pjsip/include/pjsua2/media.hpp
===================================================================
--- pjproject/trunk/pjsip/include/pjsua2/media.hpp	(revision 6118)
+++ pjproject/trunk/pjsip/include/pjsua2/media.hpp	(revision 6119)
@@ -2442,4 +2442,21 @@
 
 /**
+ * Opus codec parameters setting;
+ */
+struct CodecOpusConfig
+{
+    unsigned   sample_rate; /**< Sample rate in Hz.                     */
+    unsigned   channel_cnt; /**< Number of channels.                    */
+    unsigned   frm_ptime;   /**< Frame time in msec.   			*/
+    unsigned   bit_rate;    /**< Encoder bit rate in bps.		*/
+    unsigned   packet_loss; /**< Encoder's expected packet loss pct.	*/
+    unsigned   complexity;  /**< Encoder complexity, 0-10(10 is highest)*/
+    bool       cbr;         /**< Constant bit rate?			*/
+
+    pjmedia_codec_opus_config toPj() const;
+    void fromPj(const pjmedia_codec_opus_config &config);
+};
+
+/**
  * Detailed codec attributes used in configuring a video codec and in querying
  * the capability of video codec factories. 
Index: pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp
===================================================================
--- pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp	(revision 6118)
+++ pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp	(revision 6119)
@@ -2221,4 +2221,36 @@
 }
 
+#if defined(PJMEDIA_HAS_OPUS_CODEC) && (PJMEDIA_HAS_OPUS_CODEC!=0)
+
+CodecOpusConfig Endpoint::getCodecOpusConfig() const PJSUA2_THROW(Error)
+{
+   pjmedia_codec_opus_config opus_cfg;
+   CodecOpusConfig config;
+
+   PJSUA2_CHECK_EXPR(pjmedia_codec_opus_get_config(&opus_cfg));
+   config.fromPj(opus_cfg);
+
+   return config;
+}
+
+void Endpoint::setCodecOpusConfig(const CodecOpusConfig &opus_cfg)
+				  PJSUA2_THROW(Error)
+{
+   const pj_str_t codec_id = {"opus", 4};
+   pjmedia_codec_param param;
+   pjmedia_codec_opus_config new_opus_cfg;
+
+   PJSUA2_CHECK_EXPR(pjsua_codec_get_param(&codec_id, &param));
+
+   PJSUA2_CHECK_EXPR(pjmedia_codec_opus_get_config(&new_opus_cfg));
+
+   new_opus_cfg = opus_cfg.toPj();
+
+   PJSUA2_CHECK_EXPR(pjmedia_codec_opus_set_default_param(&new_opus_cfg,
+							  &param));
+}
+
+#endif
+
 void Endpoint::clearCodecInfoList(CodecInfoVector &codec_list)
 {
Index: pjproject/trunk/pjsip/src/pjsua2/media.cpp
===================================================================
--- pjproject/trunk/pjsip/src/pjsua2/media.cpp	(revision 6118)
+++ pjproject/trunk/pjsip/src/pjsua2/media.cpp	(revision 6119)
@@ -1824,4 +1824,30 @@
 }
 
+pjmedia_codec_opus_config CodecOpusConfig::toPj() const
+{
+    pjmedia_codec_opus_config config;
+
+    config.sample_rate = sample_rate;
+    config.channel_cnt = channel_cnt;
+    config.frm_ptime = frm_ptime;
+    config.bit_rate = bit_rate;
+    config.packet_loss = packet_loss;
+    config.complexity = complexity;
+    config.cbr = cbr;
+
+    return config;
+}
+
+void CodecOpusConfig::fromPj(const pjmedia_codec_opus_config &config)
+{
+    sample_rate = config.sample_rate;
+    channel_cnt = config.channel_cnt;
+    frm_ptime = config.frm_ptime;
+    bit_rate = config.bit_rate;
+    packet_loss = config.packet_loss;
+    complexity = config.complexity;
+    cbr = config.cbr;
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 void VidCodecParam::fromPj(const pjmedia_vid_codec_param &param)
