Early Media with Progress()
Early Media with Progress()
Progress() sends a SIP 183 Session Progress response with SDP, establishing a media path to the caller before the call is answered. This lets you play audio (custom ringback, announcements, or music) while the call is still in the "ringing" state.
Dialplan
[from-trunk]
exten => 1001,1,Progress()
same => n,Verbose(1,Early media: playing greeting before answer)
same => n,Playback(custom/please-hold)
same => n,Answer()
same => n,Dial(PJSIP/1001,30)
same => n,Hangup()
Progress vs Answer
[examples]
; Early media -- caller hears audio but call is not "answered"
; (no billing on metered trunks, CID shows "ringing" on caller's phone)
exten => 2001,1,Progress()
same => n,Playback(custom/welcome)
same => n,Answer()
same => n,Dial(PJSIP/2001,30)
same => n,Hangup()
; Immediate answer -- billing starts, phone shows "connected"
exten => 2002,1,Answer()
same => n,Playback(custom/welcome)
same => n,Dial(PJSIP/2002,30)
same => n,Hangup()
How it works
- 183 Session Progress:
Progress()causes Asterisk to send a SIP 183 response with an SDP body. This establishes a media (RTP) path so the caller can hear audio, but the call state remains "ringing". the caller's phone still shows "calling..." or "ringing." - Billing implications: On metered SIP trunks, billing typically starts when a 200 OK (Answer) is received. Using
Progress()for pre-answer announcements avoids starting the billing clock. - Playback before Answer: After
Progress(),Playback()sends audio over the early media channel. This is how carriers play "your call is being connected" messages or custom ringback tones. - Answer() still required: Early media is temporary. You must still call
Answer()(which sends a 200 OK) before bridging the call withDial(),Queue(), or other applications that expect a fully established call. - SIP signaling flow: The sequence is: INVITE -> 100 Trying -> 183 Session Progress (with SDP) -> [audio plays] -> 200 OK -> ACK -> [call is bridged].
Tips
- Not all SIP providers and phones support early media correctly. Test with your provider before relying on it for production IVR greetings.
- Use
Progress()+Playback()for "please hold while we connect your call" messages before Dial(). - If the caller's phone doesn't support early media, they'll hear nothing or their carrier's default ringback until Answer().
- For inbound calls from the PSTN, early media is well supported. For calls between SIP endpoints on the same PBX, it depends on the phone firmware.
Ringing()sends a 180 Ringing without SDP: the caller hears their phone's built-in ring tone.Progress()sends 183 with SDP. the caller hears audio you provide.
User Notes
No notes yet. Be the first to contribute a tip or example.
Contribute a note
Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.