diff --git a/src/call.h b/src/call.h
index 9f16a0bc4a676e388a0fd3ff207537f861aa4d83..37d85eea52563184c816eaa3c98b9b2a5bfa4ab5 100644
--- a/src/call.h
+++ b/src/call.h
@@ -298,8 +298,11 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> {
 
         void onTextMessage(std::map<std::string, std::string>&& messages);
 
-        virtual bool useVideoCodec(const AccountVideoCodecInfo* /*codec*/) const {
-            return false;
+        virtual std::shared_ptr<AccountCodecInfo> getAudioCodec() const {
+            return {};
+        }
+        virtual std::shared_ptr<AccountCodecInfo> getVideoCodec() const {
+            return {};
         }
 
         virtual void restartMediaSender() = 0;
diff --git a/src/client/configurationmanager.cpp b/src/client/configurationmanager.cpp
index 12d6f3b3309770042917463d0fcd7529fd252463..559fa7c7adf602bcc01dda3a81d460e2676d320f 100644
--- a/src/client/configurationmanager.cpp
+++ b/src/client/configurationmanager.cpp
@@ -505,7 +505,7 @@ setCodecDetails(const std::string& accountID,
                 JAMI_WARN("parameters for %s changed ",
                           foundCodec->systemCodecInfo.name.c_str());
                 if (auto call = jami::Manager::instance().getCurrentCall()) {
-                    if (call->useVideoCodec(foundCodec.get())) {
+                    if (call->getVideoCodec() == foundCodec) {
                         JAMI_WARN("%s running. Need to restart encoding",
                                   foundCodec->systemCodecInfo.name.c_str());
                         call->restartMediaSender();
diff --git a/src/dring/call_const.h b/src/dring/call_const.h
index d2a7c4987bfba24c4f9aa3b45368d0a0c4c2e5b0..e0e08fa348ce64dcba8a9ce43b8f2270c8c3e900 100644
--- a/src/dring/call_const.h
+++ b/src/dring/call_const.h
@@ -58,6 +58,8 @@ constexpr static char AUDIO_MUTED              [] = "AUDIO_MUTED"         ;
 constexpr static char VIDEO_MUTED              [] = "VIDEO_MUTED"         ;
 constexpr static char VIDEO_SOURCE             [] = "VIDEO_SOURCE"        ;
 constexpr static char AUDIO_ONLY               [] = "AUDIO_ONLY"          ;
+constexpr static char AUDIO_CODEC              [] = "AUDIO_CODEC"         ;
+constexpr static char VIDEO_CODEC              [] = "VIDEO_CODEC"         ;
 
 }
 
diff --git a/src/media/audio/audio_sender.cpp b/src/media/audio/audio_sender.cpp
index ff0ff1f002addb660e93c3547a5e4f3cdeabbebd..eb361640c594a3ad625383c74cd14e2caa85e18e 100644
--- a/src/media/audio/audio_sender.cpp
+++ b/src/media/audio/audio_sender.cpp
@@ -83,7 +83,7 @@ AudioSender::setup(SocketPair& socketPair)
         return false;
     }
 
-    Smartools::getInstance().setLocalAudioCodec(audioEncoder_->getEncoderName());
+    Smartools::getInstance().setLocalAudioCodec(audioEncoder_->getAudioCodec());
 
 #ifdef DEBUG_SDP
     audioEncoder_->print_sdp();
diff --git a/src/media/media_encoder.cpp b/src/media/media_encoder.cpp
index 8da58dae68640570f109a80a7f90bcf1e50cec45..ca49952c97123df14ca3f4937f1054ae1a5edaf4 100644
--- a/src/media/media_encoder.cpp
+++ b/src/media/media_encoder.cpp
@@ -134,15 +134,6 @@ MediaEncoder::getLastSeqValue()
         return 0;
 }
 
-std::string
-MediaEncoder::getEncoderName() const
-{
-    if (videoOpts_.isValid())
-        return videoCodec_;
-    else
-        return audioCodec_;
-}
-
 void
 MediaEncoder::openOutput(const std::string& filename, const std::string& format)
 {
@@ -700,15 +691,6 @@ MediaEncoder::extractProfileLevelID(const std::string &parameters,
     JAMI_DBG("Using profile %x and level %d", ctx->profile, ctx->level);
 }
 
-bool
-MediaEncoder::useCodec(const jami::AccountCodecInfo* codec) const noexcept
-{
-    if (codec->systemCodecInfo.mediaType == MEDIA_VIDEO)
-        return videoCodec_ == codec->systemCodecInfo.name;
-    else
-        return audioCodec_ == codec->systemCodecInfo.name;
-}
-
 #ifdef RING_ACCEL
 void
 MediaEncoder::enableAccel(bool enableAccel)
diff --git a/src/media/media_encoder.h b/src/media/media_encoder.h
index 7cbc7f68c71566cc1a397d45fac0b790821d8d17..cb9f2f1c0245509bc529ab7cf0188f7ea3af2b9f 100644
--- a/src/media/media_encoder.h
+++ b/src/media/media_encoder.h
@@ -96,9 +96,9 @@ public:
 
     void setInitSeqVal(uint16_t seqVal);
     uint16_t getLastSeqValue();
-    std::string getEncoderName() const;
 
-    bool useCodec(const AccountCodecInfo* codec) const noexcept;
+    const std::string& getAudioCodec() const { return audioCodec_; }
+    const std::string& getVideoCodec() const { return videoCodec_; }
 
 #ifdef RING_ACCEL
     void enableAccel(bool enableAccel);
diff --git a/src/media/rtp_session.h b/src/media/rtp_session.h
index 66f2d64af3bd1c1fd357b3c41170fda3e9f1849c..5cf24a5721f2577bff8d63364703806fb20cbb24 100644
--- a/src/media/rtp_session.h
+++ b/src/media/rtp_session.h
@@ -58,6 +58,8 @@ public:
     virtual void initRecorder(std::shared_ptr<MediaRecorder>& rec) = 0;
     virtual void deinitRecorder(std::shared_ptr<MediaRecorder>& rec) = 0;
 
+    std::shared_ptr<AccountCodecInfo> getCodec() const { return send_.codec; }
+
 protected:
     std::recursive_mutex mutex_;
     std::unique_ptr<SocketPair> socketPair_;
diff --git a/src/media/video/video_rtp_session.cpp b/src/media/video/video_rtp_session.cpp
index 355f877e203774a34f6b05a3f087ea735056d12a..d0f362a9b28492bd3c6329ac2ef41c8c59792fa4 100644
--- a/src/media/video/video_rtp_session.cpp
+++ b/src/media/video/video_rtp_session.cpp
@@ -336,13 +336,6 @@ void VideoRtpSession::exitConference()
     conference_ = nullptr;
 }
 
-bool
-VideoRtpSession::useCodec(const jami::AccountVideoCodecInfo* codec) const
-{
-    return sender_->useCodec(codec);
-}
-
-
 float
 VideoRtpSession::checkPeerPacketLoss()
 {
diff --git a/src/media/video/video_rtp_session.h b/src/media/video/video_rtp_session.h
index b5a4310530ff27145d900d4d4e65a68596718868..2e589331f7ebd1bc12bd8d15ddd26410c84eb3f5 100644
--- a/src/media/video/video_rtp_session.h
+++ b/src/media/video/video_rtp_session.h
@@ -19,8 +19,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
  */
 
-#ifndef __VIDEO_RTP_SESSION_H__
-#define __VIDEO_RTP_SESSION_H__
+#pragma once
 
 #include "media/rtp_session.h"
 #include "media/media_device.h"
@@ -92,9 +91,6 @@ public:
     }
 
     void setChangeOrientationCallback(std::function<void(int)> cb);
-
-    bool useCodec(const AccountVideoCodecInfo* codec) const;
-
     void initRecorder(std::shared_ptr<MediaRecorder>& rec) override;
     void deinitRecorder(std::shared_ptr<MediaRecorder>& rec) override;
 
@@ -158,5 +154,3 @@ private:
 };
 
 }} // namespace jami::video
-
-#endif // __VIDEO_RTP_SESSION_H__
diff --git a/src/media/video/video_sender.cpp b/src/media/video/video_sender.cpp
index 25fd9c9769270f93c3b74b38782cd65bec6ab390..ef64ff85182ab1679923a03863f05544999a1efe 100644
--- a/src/media/video/video_sender.cpp
+++ b/src/media/video/video_sender.cpp
@@ -60,7 +60,7 @@ VideoSender::VideoSender(const std::string& dest, const DeviceParams& dev,
     videoEncoder_->setIOContext(muxContext_->getContext());
 
     // Send local video codec in SmartInfo
-    Smartools::getInstance().setLocalVideoCodec(videoEncoder_->getEncoderName());
+    Smartools::getInstance().setLocalVideoCodec(videoEncoder_->getVideoCodec());
 
     // Send the resolution in smartInfo
     Smartools::getInstance().setResolution("local", dev.width, dev.height);
@@ -135,12 +135,6 @@ VideoSender::getLastSeqValue()
     return videoEncoder_->getLastSeqValue();
 }
 
-bool
-VideoSender::useCodec(const jami::AccountVideoCodecInfo* codec) const
-{
-    return videoEncoder_->useCodec(codec);
-}
-
 void
 VideoSender::setChangeOrientationCallback(std::function<void(int)> cb)
 {
diff --git a/src/media/video/video_sender.h b/src/media/video/video_sender.h
index e54fe4231a5ac67548d98932833ebf179d90829a..2b86ad8f30cbf665d3a91f0477b6851c1ecbf944 100644
--- a/src/media/video/video_sender.h
+++ b/src/media/video/video_sender.h
@@ -19,8 +19,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
  */
 
-#ifndef __VIDEO_SENDER_H__
-#define __VIDEO_SENDER_H__
+#pragma once
 
 #include "noncopyable.h"
 #include "media_encoder.h"
@@ -60,8 +59,6 @@ public:
 
     uint16_t getLastSeqValue();
 
-    bool useCodec(const AccountVideoCodecInfo* codec) const;
-
     void setChangeOrientationCallback(std::function<void(int)> cb);
 
 private:
@@ -85,5 +82,3 @@ private:
     std::function<void(int)> changeOrientationCallback_;
 };
 }} // namespace jami::video
-
-#endif // __VIDEO_SENDER_H__
diff --git a/src/sip/sipcall.cpp b/src/sip/sipcall.cpp
index 30467d0205c1bb6eb1e974ccebf1c286621c3232..d719ae44e0a13de01b4074a853f544d88b2c01bb 100644
--- a/src/sip/sipcall.cpp
+++ b/src/sip/sipcall.cpp
@@ -873,14 +873,19 @@ SIPCall::getAllRemoteCandidates()
     return rem_candidates;
 }
 
-bool
-SIPCall::useVideoCodec(const AccountVideoCodecInfo* codec) const
+std::shared_ptr<AccountCodecInfo>
+SIPCall::getVideoCodec() const
 {
 #ifdef ENABLE_VIDEO
-    if (videortp_->isSending())
-        return videortp_->useCodec(codec);
+    return videortp_->getCodec();
 #endif
-    return false;
+    return {};
+}
+
+std::shared_ptr<AccountCodecInfo>
+SIPCall::getAudioCodec() const
+{
+    return avformatrtp_->getCodec();
 }
 
 void
@@ -1210,6 +1215,8 @@ SIPCall::getDetails() const
 #ifdef ENABLE_VIDEO
     // If Video is not enabled return an empty string
     details.emplace(DRing::Call::Details::VIDEO_SOURCE, acc.isVideoEnabled() ? mediaInput_ : "");
+    if (auto codec = videortp_->getCodec())
+        details.emplace(DRing::Call::Details::VIDEO_CODEC, codec->systemCodecInfo.name);
 #endif
 
 #if HAVE_RINGNS
diff --git a/src/sip/sipcall.h b/src/sip/sipcall.h
index 39df1f8fb1528530337e6d2a9cfa7fada191e7b8..aebb254b40cf542f4497b5f75a8de9e139ee955d 100644
--- a/src/sip/sipcall.h
+++ b/src/sip/sipcall.h
@@ -109,7 +109,9 @@ public: // overridden
     void removeCall() override;
     void muteMedia(const std::string& mediaType, bool isMuted) override;
     void restartMediaSender() override;
-    bool useVideoCodec(const AccountVideoCodecInfo* codec) const override;
+    std::shared_ptr<AccountCodecInfo> getAudioCodec() const override;
+    std::shared_ptr<AccountCodecInfo> getVideoCodec() const override;
+
     void sendKeyframe() override;
     std::map<std::string, std::string> getDetails() const override;