Summary:ASTERISK-18987: Alcatel workaround broke EARLY MEDIA for BeroFix
Reporter:Dan Lukes (dan_lukes)Labels:EarlyMedia asterisk sdp
Date Opened:2011-12-07 23:47:56.000-0600Date Closed:
Versions: 10.0.0 13.18.4 Frequency of
Environment:Asterisk connected to TELCO via Bero*Fix ver. 2.2rc3 (SIP<->ISDN30 gateway) Outgoing call (from Asterisk to Telco), destination number is unreachable number, announcement (EARLY MEDIA)Attachments:
Description:Problem affects all versions from 1.4 to HEAD.

During call setup (called number is unreachable which is announced by TELCO via EARLY MEDIA), the caller can hear short fragment (less than 0.5s) of early-media announcement only, then it is replaced by RINGING tone despite the announcement from TELCO continues.

Schematic description of PRI handshaking (just for completeness):
Bero*Fix <->Telco
<- CALL PROCEEDING (B channel allocated)
<- PROGRESS (with Progress Indicator = 8 = EARLY MEDIA)

It is translated to following SIP handshaking:
Asterisk <-> Bero*Fix:
<- 100 Trying
<- 183 PROCEEDING (with SDP)  
<- 183 PROGRESS (no SDP as audio channel is opened already)
{color:blue}... about 15 second (it correlate with length of announcement){color}
<- 404 RELEASE (hangup cause 31)

The problem is caused by following fragment of code:

{code:title=chan_sip.c, function handle_response_invite()|borderStyle=solid}
} else
 /* Alcatel PBXs are known to send 183s with no SDP after sending
  * a 100 Trying response. We're just going to treat this sort of thing
  * the same as we would treat a 180 Ringing
 if (!req->ignore && p->owner) {
    ast_queue_control(p->owner, AST_CONTROL_RINGING);

Proposed correction:

183 with no SDP should not trigger AST_CONTROL_RINGING when EARLY MEDIA active already

so plain {color:red}"else"{color} above should be changed to:

} else if (p->invitestate != INV_EARLY_MEDIA)

Comments:By: Andrey Solovyev (corruptor) 2012-12-07 06:55:24.064-0600

We have same problem.
We receive two 183 (from cisco) from telco - the first one is with SDP and second one is without it. The second 183 is translated  by asterisk to 180 for another leg so the user can't hear telco messages. (But the send them, I can see the them in the call pcap dump).
The second 183 without SDP is wrong for sure but asterisk should ignore it IMHO.