Early media audio problem

Hello,
I didn’t get any audio in sip calling when using early media feature of asterisk.

Normally its working fine but due to playback apps, asterisk answer the sip channel and timer of user start that should not be happen.
That why I am trying to implement early media option in asterisk.
It is working as said but problem occur in audio. I could not hear anything unless user pick the phone.

extension.conf
exten => _X.,1,Progress()
exten => _X.,n,Playback(/var/lib/asterisk/sounds/verification,noanswer)
exten => _X.,n,Dial(SIP/channel/number)

sip.conf
[xxx]
fullname=xxx
type=friend
host=dynamic
disallow=all
allow=g729
allow=ulaw
allow=alaw
allow=gsm
username=xxx
secret=xxx
context=sip-calling-test
qualify=yes
call-limit=2
nat=yes

Does any one know what is the problem.

Not all devices support early media, how did you made the test?

I created a sip channel in asterisk and call that sip account by my cell phone. Then I didn’t hear any voice on my mobile phone unless it is connected to end user.

Also if it is not possible then is there any way to play audio to caller before call has been picked or before channel gets answer?

You need to check ith your PSTN provider if they support Early-Media, I only know about ITSP(“SIP trunks”) like flowroute or VoIP.ms

They are unlikely to support early media for people are not official network operators, as it allows for services that generate know revenue.

Thanks for your precious suggestion,

Actually I want to play a greeting message first then dialed the number. asterisk answered the call after user received. In this scenario only my cell phone and sip protocol of asterisk is there not any other operators. Then how it will depend on operators.

Also, It just look like when I am trying to call to invalid number then operator response me with some media that “you have trying to call an invalid number” and then it hangup the calls without answering it.
I just want to do it in the same way.

The operator is the cellular network (and if you are not using a GSM adapter with Asterisk, the PSTN company.