From FS-11833.
After FS sends a reINVITE to T38 which gets rejected by peer it is no
longer in a state where it can properly answer a reINVITE which requests
a change of the media setup.
1. FS sends INVITE (destination is a fax machine)
2. Call connects with "8 101"
3. FS sends reINVITE to T38
4. T38 rejected (488)
5. FS receives INVITE to "8"
6. FS replies with 200 OK without SDP
7. Call fails
The bug is related to TFLAG_SDP. This flag is set when a media session
is established. And when there's a reINVITE sofia_glue_do_invite() from
sofia_glue.c is called and clears the flag again:
sofia_clear_flag_locked(tech_pvt, TFLAG_SDP);
So when FS sends a reINVITE to T38 the flag gets cleared. But when the
reINVITE is rejected with 488 the flag is not set again. It stays
cleared. So the call continues with the previously negotiated media, fax
passthrough (8 101 in this case), but TFLAG_SDP is not set.
So when FS receives a reINVITE at this point it doesn't see the need to
renegotiate anything, even though it realizes that 2833 DTMF is now off:
2019-04-30 16:42:12.478025 [DEBUG] switch_core_media.c:5478 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]
2019-04-30 16:42:12.478025 [DEBUG] switch_core_media.c:5533 Audio Codec Compare [PCMA:8:8000:20:64000:1] ++++ is saved as a match
2019-04-30 16:42:12.478025 [DEBUG] switch_core_media.c:5802 No 2833 in SDP. Disable 2833 dtmf and switch to INFO
When FS doesn't send a reINVITE (fax_enable_t38_request=false) and the
reINVITE to "8" is received, TFLAG_SDP is still set and then FS
understands that it needs to renegotiate and replies with a 200 OK that
includes SDP:
2019-04-30 16:41:19.358028 [DEBUG] switch_core_media.c:5478 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]
2019-04-30 16:41:19.358028 [DEBUG] switch_core_media.c:5533 Audio Codec Compare [PCMA:8:8000:20:64000:1] ++++ is saved as a match
2019-04-30 16:41:19.358028 [DEBUG] switch_core_media.c:5802 No 2833 in SDP. Disable 2833 dtmf and switch to INFO
2019-04-30 16:41:19.358028 [DEBUG] sofia.c:8237 skemper was here in line 8232
2019-04-30 16:41:19.358028 [DEBUG] switch_core_media.c:8390 skemper was here in line 8390.
2019-04-30 16:41:19.358028 [DEBUG] switch_core_media.c:8496 Audio params are unchanged for sofia/external/+called_number.
2019-04-30 16:41:19.358028 [DEBUG] sofia.c:8243 Processing updated SDP
This fixes the state problem after a rejected T38 reINVITE by setting
TFLAG_SDP.
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This reverts commit 53dbe5d84a9c3624804a2b9259433f4d525425f8.
This previous patch made logger function not reentrant so reverting until we can get a fix without that issue
(enable with sofia profile param rfc-7989=true)
FS-11557 [mod_sofia, mod_conference, core] Add support for re-INVITE when setting Session-ID in conference after call has been answered.
FS-11557 [mod_conference] Missed a spot where APP_SESSION_ID needed to be set.
FS-11557: set session id for outbound (initial requests)
FS-11557: [mod_sofia] rename vars and functions "session id" -> "session uuid" to reflect the real meaning for rfc7989.
FS-11557: fix bug - colliding chan var names (session_id)
FS-11557: check nil session uuid
FS-11557 : replace CS_NEW with CS_INIT for when originating calls, generate new uuid.
FS-11557: handle inbound (UAS mode, one leg)
FS-11557: generic param handling and filter via new sip profile option "rfc-7989-filter", eg:
<param name="rfc-7989-filter" value="logme, sec-agree, privacy" />
FS-11557: renamed chan vars (reflect meaning only for RFC7989)
FS-11557: fallback to RFC7329 - "old" Session-ID
FS-11557: distinguish between request and replies when we read the header
(to provide compatibility with old RFC7329 - section 11 of RFC7989)
FS-11557: change more vars/consts names
FS-11557: move compat flag on the channel.
FS-11557: add Session-ID header in REFER
FS-11557: needs extra condition on received initial request
FS-11557: handle NOTIFY
FS-11557: support answer() in dialplan - it was sending back a 200 OK with Session-ID invalid, eg: A=NIL;B=X
FS-11557: add Session-ID for NOTIFY (more cases)
FS-11557: handle reply to SIP INFO (add Session-ID header)
FS-11557: handle case of BYE after REFER, when the channel is destroyed already (save the uuid on sofia_private)
FS-11557: handle more SIP reply cases (eg: 202 Accepted , more negative replies)
FS-11557: handle ACK (UAS role)
FS-11557: added "rfc-7989-force-old" profile param - to enforce old rfc7329 for the UAC role. default off.
enabled with "<param name="rfc-7989-force-old" value="true" />".
FS-11557: fallback to rfc7329 fixes.
FS-11557: set flag CF_RFC7329_COMPAT on partner channel where needed
FS-11557: fix crash (mod_conference)