PHPAGI Play audio without answering

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

PHPAGI Play audio without answering

Postby sktanmoy » Wed Dec 30, 2015 6:53 am

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
Code: Select all
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.
sktanmoy
Newsterisk
 
Posts: 4
Joined: Sat Dec 12, 2015 8:38 pm

Re: PHPAGI Play audio without answering

Postby ambiorixg12 » Wed Dec 30, 2015 12:21 pm

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

http://www.voip-info.org/wiki/view/Aste ... e-playback

viewtopic.php?f=1&t=96130&start=0&hilit=early+media
ambiorixg12
Astmaster
 
Posts: 967
Joined: Sun Mar 04, 2007 9:32 pm
Location: Dominican Republic

Re: PHPAGI Play audio without answering

Postby david55 » Wed Dec 30, 2015 12:43 pm

He's overridden the default answer in Playback by using the noanswer parameter, although I suppose he could have done that wrongly, somehow.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: PHPAGI Play audio without answering

Postby sktanmoy » Wed Dec 30, 2015 6:46 pm

ambiorixg12 wrote:Check the following links for references
http://www.voip-info.org/wiki/view/Aste ... e-playback


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.
sktanmoy
Newsterisk
 
Posts: 4
Joined: Sat Dec 12, 2015 8:38 pm

Re: PHPAGI Play audio without answering

Postby ambiorixg12 » Wed Dec 30, 2015 6:50 pm

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
ambiorixg12
Astmaster
 
Posts: 967
Joined: Sun Mar 04, 2007 9:32 pm
Location: Dominican Republic


Return to Asterisk Support

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest