SIP early media

Hello everybody,

I would like Asterisk to listen to incoming SIP calls. When it gets a call, it should play a wave file as early media (that is, send 180 or 183 Ringing with SDP body and play the whole wave file before sending 200 OK).

I mention I have searched in this forum and in Internet, but I’ve found no results regarding this feature.

Thank you in advance,
RaduDumi

i think i see what you mean, IE play a sound to the channel before answering, the same way some voicemail systems won’t actually answer the call until after the recorded message (so you can get your quarter back from a payphone if you don’t want to leave a message). Asterisk doesn’t (to the best of my knowledge) support this feature. To add such a thing would be a pretty big change, you’d need to add an application (PrePlayback perhaps?) and modify chan_sip.c to allow this.

@IronHelix: Yes, you have understood me.

However, it is funny: I get such an early media from an Asterisk server. But I cannot contact the company hosting it (so that I can ask them how they did it) and that is why I have asked it in this forum.

Early media is signaled through “180 Ringing” or “183 Session Progress”, both with SDP body.

progressinband=yes in SIP.CONF

Hi,

This is definitely possible, we have done the exact same thing; play a gsm file to the user without answering the call, so that billsec=0. I have done this with Background, but here it is with Read,and it is in AEL, so just convert it.

Progress();
Read(PIN,demo-congrats,5,5);

It also depended on which SIP phone I used, it worked with most, but not with eyebeam, dont quite know why.

progressinband=yes will make asterisk send inband ringing but that won’t help here, that can safely be left off.

Progress() then other things would be the way to go. Some like playback require the n or noanswer flag to make them not bring up the channel and answer it.

Also keep in mind that your provider must support this feature. Not all do.

[quote=“radudumi”]Hello everybody,

I would like Asterisk to listen to incoming SIP calls. When it gets a call, it should play a wave file as early media (that is, send 180 or 183 Ringing with SDP body and play the whole wave file before sending 200 OK).

I mention I have searched in this forum and in Internet, but I’ve found no results regarding this feature.

Thank you in advance,
RaduDumi[/quote]
Yes, its usual need and solution is very, very simple :smile:
exten => s,n,Playback(file.wav,noanswer)

But be careful - in case you send Session Progress + InBand (i.e. 183 + SDP) your VoIP TSP opens only recieving audio channel, not both (it will be done after recieving 200 OK). This is due to TelCo laws significant in most countries…

Hope this helps!

kokoska.rokoska