LubosD / twinkle

Qt 5 port of Twinkle

Home Page:http://twinkle.dolezel.info

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow SDP change on 200 OK

johannesk opened this issue · comments

Observed Behavior

I am using twinkle connected to a FritzBox which support g722 and g711. When calling somewhere without g722 support (e.g. Android SIP), the FritzBox at first plays the Ringtone over g722 and then changes its SDP offer and switches to g711 when the other side answers the call. Twinkle ignores this SDP change and continues to transmit g722 which results in distorted audio on the other end.

Cause

Upon digging through the twinkle source, I discovered, that twinkle has support for SDP changes, but by default ignores SDP changes unless explicitly configured to do so (Edit->User profile->SIP protocol->Allow SDP change during call setup). Upon enabling this, twinkle processes changed SDP offers received through a 200 OK and switches to transmitting g711.

Others (#177 (comment)) have observed the same behavior, but were unable to find the solution.

The source mentions a reason for this behaviour:

twinkle/src/dialog.cpp

Lines 1966 to 1974 in 1ec8dbb

} else if (!session->recvd_answer ||
(user_config->get_allow_sdp_change() &&
((t_sdp *)r->body)->origin.session_version !=
session->dst_sdp_version))
{
// Only process SDP if no SDP was received yet (RFC 3261
// 13.3.1. Or process SDP if overridden by the
// allow_sdp_change setting in the user profile.
// A changed SDP must have a new version number (RFC 3264)

However, upon reading RFC3261-13.3.1, I did not find anything on ignoring changed SDP offers.

I have a SNOM 360 phone which supports g722 and supports SDP changes without special configuration. Unlike twinkle, the SNOM 360 therefore can establish a working phonecall to non g722 endpoints over the FritzBox.

Solution

Either remove this configuration option completely and always accept SDP changes, or at least enable this configuration option by default.

Closing, fixed by #243.