10

Is it possible to configure Asterisk so that it sends RTP packets with audio from the receiver before the remote party actually picks up?

This seems to be required for a VoIP compliance test my setup needs to pass. They use a simulator to test this, and when I call the other party, they pick up the receiver without sending an OK. I can hear audio from the other side, but they cannot hear me. I've looked into directmediasetup, progressinband, prematuremedia but none of those accomplishes what I need. Is it even doable with Asterisk?

Environment:

Asterisk registers to a SIP trunk, hardware SIP phones are registered to Asterisk. Outbound calls go through the SIP trunk. Asterisk version: 1.8.11.

4 Answers4

5

Early media is possible with Asterisk, but only in certain situations, and only with the cooperation/support of all the devices and services involved. Some phones and/or service providers do not support early media. Support for early voice and early DTMF may vary.

You have a SIP phone registered to Asterisk, which places a call to an external number. Asterisk in turn Dials that number over a separate SIP trunk. These are two separate call legs. Asterisk can play early media back to the caller (a custom ringtone or music on hold, for instance) and Asterisk can receive early media from the external party over the SIP trunk. However, a standard Dial() statement will automatically Answer() and bridge the call legs together when remote party answers.

It seems you wish to avoid this usually-desired behavior, and bridge the call legs without Answer()ing them. The Dial() application allows you to defer the usually-automatic Answer() using the 'd' or 'D' options. I'm not aware of any Dial() option that will allow you to bridge the call legs without Answer()ing.

Please see the Asterisk wiki for further discussion and examples of early media with Asterisk.

roderickm
  • 346
0

It is not doable with asterisk.

Asterisk does not open the reverse media path prematurely, because doing so causes some devices to stop working. It only does premature media in one direction.

You can probably change this by rewriting code (both endpoints have to support this), but the default source tree does not support this.

cwarden
  • 145
arheops
  • 708
0

Why not just take Asterisk out of the media path altogether? *

directmedia=yes
directrtpsetup=yes
prematuremedia=no ;this does the exact opposite of what everyone assumes it does
progressinband=no

Asterisk will send the Invite to the other side with your phone's IP address specified in the SDP. When the other side gives a 183 Session Progress, that will be sent by Asterisk back to your phone, with the other side's IP address in the SDP.

As long as your phone supports it, you'll have bi-directional early media without asterisk even having the opportunity to get in the way and mess it up.

* well, asterisk will still re-invite itself back in at the end of the call momentarily, but otherwise it stays out altogether

0

There are two ways. Either 1-using 183 Early media. The other way is using Answer() application.

In both cases, the media will come from the Asterisk side.

; 183 - session progress method. 
exten=> _X.,1,Progress()
exten=> _X.n,playback(tt-monkeys,noanswer)
; 200 - Answer 
exten=> _X.,1,Answer()
exten=> _X.,n,playback(tt-monkeys)

Faheem
  • 1
  • 2