Commit 8d4fad41 authored by Adrien Béraud's avatar Adrien Béraud Committed by Sébastien Blin

sipvoiplink: catch exception in requestKeyframe

requestKeyframe is stateless and failure is not critical.

Change-Id: Iced5b13496e07153e7352d316c4cb5b06a9aab89
Reviewed-by: Sébastien Blin's avatarSebastien Blin <sebastien.blin@savoirfairelinux.com>
parent e6ed1e1f
......@@ -81,22 +81,6 @@ static constexpr int ICE_VIDEO_RTCP_COMPID {3};
const char* const SIPCall::LINK_TYPE = SIPAccount::ACCOUNT_TYPE;
static void
dtmfSend(SIPCall &call, char code, const std::string& /*dtmf*/)
{
int duration = Manager::instance().voipPreferences.getPulseLength();
char dtmf_body[1000];
// handle flash code
if (code == '!') {
snprintf(dtmf_body, sizeof dtmf_body - 1, "Signal=16\r\nDuration=%d\r\n", duration);
} else {
snprintf(dtmf_body, sizeof dtmf_body - 1, "Signal=%c\r\nDuration=%d\r\n", code, duration);
}
call.sendSIPInfo(dtmf_body, "dtmf-relay");
}
SIPCall::SIPCall(SIPAccountBase& account, const std::string& id, Call::CallType type,
const std::map<std::string, std::string>& details)
: Call(account, id, type, details)
......@@ -671,7 +655,21 @@ SIPCall::peerHungup()
void
SIPCall::carryingDTMFdigits(char code)
{
dtmfSend(*this, code, getSIPAccount().getDtmfType());
int duration = Manager::instance().voipPreferences.getPulseLength();
char dtmf_body[1000];
// handle flash code
if (code == '!') {
snprintf(dtmf_body, sizeof dtmf_body - 1, "Signal=16\r\nDuration=%d\r\n", duration);
} else {
snprintf(dtmf_body, sizeof dtmf_body - 1, "Signal=%c\r\nDuration=%d\r\n", code, duration);
}
try {
sendSIPInfo(dtmf_body, "dtmf-relay");
} catch (const std::exception& e) {
RING_ERR("Error sending DTMF: %s", e.what());
}
}
void
......
......@@ -781,7 +781,11 @@ SIPVoIPLink::requestKeyframe(const std::string &callID)
"</to_encoder></vc_primitive></media_control>";
RING_DBG("Sending video keyframe request via SIP INFO");
call->sendSIPInfo(BODY, "media_control+xml");
try {
call->sendSIPInfo(BODY, "media_control+xml");
} catch (const std::exception& e) {
RING_WARN("Error sending video keyframe request: %s", e.what());
}
}
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment