* #21507: daemon: get audio codec names from audiortpfactory, not SDP

This fixes the race-condition + SEGFAULT
This commit is contained in:
Tristan Matthews
2013-03-14 14:55:03 -04:00
parent 81b95dd7f2
commit 429d1f3603
6 changed files with 39 additions and 2 deletions

View File

@ -95,7 +95,7 @@ SIPCall::createHistoryEntry() const
using sfl::HistoryItem;
std::map<std::string, std::string> entry(Call::createHistoryEntry());
entry[HistoryItem::AUDIO_CODEC_KEY] = local_sdp_->getAudioCodecNames();
entry[HistoryItem::AUDIO_CODEC_KEY] = audiortp_.getCurrentAudioCodecNames();
#ifdef SFL_VIDEO
entry[HistoryItem::VIDEO_CODEC_KEY] = local_sdp_->getSessionVideoCodec();
#endif

View File

@ -1342,7 +1342,12 @@ SIPVoIPLink::getCurrentVideoCodecName(Call *call) const
std::string
SIPVoIPLink::getCurrentAudioCodecNames(Call *call) const
{
return static_cast<SIPCall*>(call)->getLocalSDP()->getAudioCodecNames();
try {
return static_cast<SIPCall*>(call)->getAudioRtp().getCurrentAudioCodecNames();
} catch (const AudioRtpFactoryException &e) {
ERROR("%s", e.what());
return "";
}
}
/* Only use this macro with string literals or character arrays, will not work