PHPAGI Play audio without answering

I can play audio from AGI script (I used phpagi) after answering a call. But I need to play audio without answering a call, and using AGI & PHP.

I know it’s possible, because I tested the following

exten => 500,1,Progress()
  same => n,Wait(1)
  same => n,Playback(custom/no-account-configured,noanswer)
  same => n,Hangup()

I tried AGI::stream_file() without success. That only works after answering a call.

I need to know how to achieve that in php and AGI. Can anyone please instruct me?

Thanks in advanced.

It seems your connection doesn’t support early media you might need Progress for that. Playback, by default, answers the call.

Also Before running any application that has sound playback (Playback, Background, VoiceMailMain2, etc.) it would be wise to execute an Answer first.

Also, you should not be tempted to avoid call charging all together by playing prompts and not answering the call. Telcos will generally not connect 2-way audio until you answer, and in any case will view this as not “playing fair” with them, subjecting you to service disconnection.

Check the following links for references

voip-info.org/wiki/view/Aste … e-playback

viewtopic.php?f=1&t=96130&start=0&hilit=early+media

He’s overridden the default answer in Playback by using the noanswer parameter, although I suppose he could have done that wrongly, somehow.

I checked those but I want to pay a message to the caller first because my system deals with overseas calls and don’t want user to waste money just for hearing those message.

If you are not a licensed network operator, you can’t transmit early media ; it is open to abuse for free of charge information calls

I was able to acquire that finally.
And everything is working fine.

How did you resolve your issue ?