Early Media - ngmediaserver/NG-Media-Server GitHub Wiki
Early Media
early media enables to carry call progress tones and announcements before a call is connected. Early media is typically sent by server-side equipment, like by the PSTN or a PBX. Client-side equipment, like SIP Phones, will typically not send early media. In the absence of early media reception, a phone will typically generate a ringing tone to the caller for convenience.
Client-side early media (reception of RTP before a call is connected) is supported since v4. Server-side early media (sending of RTP before a call is connected) requires NGMS 7.4 or higher.
progress message
NGMS 7.4+ enables to send and report progress messages (SIP 183 Session Progress).
Progress messages notify the presence of early media when the call is not alerting. This occurs for example when you receive an announcement like "the number you have dialed does not exist". Currently, NGMS will report a progress message on the reception of the first 183 Session Progress message containing SDP.
Note that progress messages currently do not report a specific state.
-
>> when sending a progress message, the parameter EarlyMedia must be set to true to indicate to start the sending of early media. When not provided, the default value false is used. Currently, the value false may not be authorized on production platform (as it is not standard with SIP).
>> Sample request to send progress with early media :
{ "method":"POST", "path":"/calls/{callId}/progress", "body": { "EarlyMedia"; true } }
-
<< when receiving a progress message, the parameter EarlyMedia indicates the start of early media reception. The value false may not be reported on production platform (as it is not standard with SIP) : progress messages received without early media at the SIP level may not be reported at the UCS API level.
<< Sample notification of progress reception with early media :
{ "method":"POST", "path":"/calls/{callId}/progress", "body": { "Op": "progress", "EarlyMedia": true } }
At the SIP level:
Caller Called
| |
|-- INVITE (SDP) ------>|
|<--------- 100 --------|
|<--------- 183 (SDP) --| progress with "EarlyMedia": true
|<===== RTP Media =====>|
|<--------- 200 (SDP) --|
|-- ACK --------------->|
|<===== RTP Media =====>|
accept message
Accept messages notify that the called user has been reached and that his phone is now alerting (SIP 180 Ringing).
NGMS 7.4+ enables to request and report the presence of early media in accept messages.
-
>> when sending an accept message, the parameter EarlyMedia can be used to indicate to start the sending of early media. When not provided, the default value false is used. If a progress message was previously sent, the sending of early media will continue.
>> Sample request to send progress with early media :
{ "method":"POST", "path":"/calls/{callId}/accept", "body": { "EarlyMedia": true } }
-
<< when receiving an accept message, the parameter EarlyMedia indicates the start early media reception. Note that this parameter may be undefined if a previous progress message was reported with EarlyMedia set to true.
<< Sample notification of accept reception with early media :
{ "method":"POST", "path":"/calls/{callId}/accept", "body": { "Op": "accept", "State": "delivered", "EarlyMedia": true } }
At the SIP level:
Caller Called
| |
|-- INVITE (SDP) ------>|
|<--------- 100 --------|
|<--------- 180 (SDP) --| accept with "EarlyMedia": true
|<===== RTP Media =====>|
|<--------- 200 (SDP) --|
|-- ACK --------------->|
|<===== RTP Media =====>|
EarlyMedia parameter
NGMS 7.4+ enables to request and report the presence of early media during the call establishments.
- >> when requesting the sending of early media, the parameter EarlyMedia with the value true is used. This parameter is typically set on outgoing calls, on the sending of progress or accept messages. Once started, the sending of early media continues until the call is answered or rejected.
- << when notified of the presence of early media, the parameter EarlyMedia with the value true is reported. This parameter is typically reported on incoming calls, on the reception of a progress or an accept message.
CPA
The Call Progress detection (part of CPA) is based on the analysis of early media reception.
Conference (LineInterconnect)
The conference matrix includes early media reception. NGMS 7.4+ now enables to send early media based on the result of a conference matrix.
Play
NGMS 7.4+ now enables to play early media from a pre recorded file. In earlier version, the play message was authorized only once the call was connected.