The reason why the ring back tone is not being heard in the bad scenario, is because the ININ server is shuffling the audio out to the Avaya Media Gateway, before the end point is connected to the audio stream. This behavior is not observed on the good scenario, the ININ server.
<<SEE ATTACHED DIAGRAM>>
The two legs of the call are mark in different colors.
The first leg is the connection between the ININ media server and the agent’s Avaya desk phone.
The second leg is between the ININ Media server and the Avaya Media Gateway.
The Avaya Media Gateway has the audio coming from the external ISDN line.
The key point is the audio point requested by the ININ server during the INVITE message of the second leg of the call. The bad scenario server requests the audio to be sent to the Avaya Media Server. The good scenario ININ server requests the audio to be sent to the ININ media server, instead.
15:44:25.567 |--INVITE-->|
o=ININ 1915390904 1915390905 IN IP4 10.31.41.225 <<< ININ server -- signaling
c=IN IP4 10.81.40.10 <<< Avaya MG -- media
m=audio 16388 RTP/AVP 0 101
The ring back audio is sent to this endpoint.
15:44:31.015 | |<--Ringing-| | (145) 180 Ringing
o=- 1481899465 2 IN IP4 172.20.40.99 <<< CM server -- signaling
c=IN IP4 10.81.40.10 <<< Avaya MG -- media
m=audio 16372 RTP/AVP 0 101
The problem here is that there is no audio connection between the agent phone and the Avaya Media Gateway at this point. The first leg is connected between the ININ Media server and the Avaya Media Gateway. And the second leg between the Avaya Media Gateway port 16388 and the Avaya MG port 16372.
Compare to the invite sent by the ININ server in the good scenario:
Invite:
o=ININ 3529319147 3529319148 IN IP4 10.31.41.225 <<< ININ server -- Signaling
c=IN IP4 10.64.15.2 <<< ININ media server -- media
m=audio 16430 RTP/AVP 0 101
Session Progress, Ringing, 200 OK
o=- 1481123105 2 IN IP4 172.20.40.99 <<< CM server -- signaling
c=IN IP4 10.64.102.10 << Avaya MG -- media
m=audio 16370 RTP/AVP 0 101
Unlike in the bad scenario, here the first leg of the call is connected at this point, between the agent phone and the ININ media server. So, the ringback audio can be heard.
On the First leg of the call the initial end points for audio are the ININ Media Server and the Avaya Media Gateway. Then the call is shuffled, by CM to send the audio directly to the agent phone set instead of the Avaya Media Gateway.
In the bad scenario, the ININ server is initiating the second leg of the call before the first leg of the call shuffles to the agent phone.