Playback of a URI doesnt work

I made dial plan like this.

[out1]
exten=>.,1,Set(CALLERID(num)=${cid})
exten=>
.,n,Gosub(monitor,${EXTEN},1)
same=>n,Dial(SIP/${EXTEN}@${trunk})
same=>n,Playback(http://rxxxxxx.com/textvoice)

[monitor]
exten=>.,1,set(path=/var/www/html/rec/)
same=>n,Mixmonitor(${path}${STRFTIME(${EPOCH},%Y-%m-%d
%H-%M-%S)}-${EXTEN}${type}${src}.wav)
same=>n,return()

[out2]
exten=>.,1,ResetCDR()
exten=>
.,n,Set(CALLERID(num)=${cid})
exten=>.,n,Set(CALLERID(name)=${cidname})
exten=>
.,n,Playback(http://rxxxxxx.com/textvoice)
same=>n,Dial(SIP/${EXTEN}@${trunk})
same=>n,Playback(http://rxxxxxx.com/textvoice)
same=>n,hangup()

In past the playback path is local (like this – /var/www/html/test)
past path link works.
but after set the playack of url, I can not hear the audio.

what is problem?
what i have to do to solve this problem?

The docs say that the Playback() application plays sound prompts from a local disk. You cannot replace it with a URL.

Like most of the modules, the pseudo comments that generate the documentation are poorly written. That’s hinted at by the say and mix options.

I believe it does support URIs, but will require the full URI, and won’t try for a best match on the file extension.

If I were doing this in anger, I’d probably resort to experimentation, or reading the source code.

then what is this?

sorry. I dont understand what you say.
so is not possible?

hmm, have you tried to make sure that the uri end with “.wav”
have not tested this, just a guess

I had a look at: Asterisk 19 Application_Playback - Asterisk Project - Asterisk Project Wiki

Other docs say that the feature was introduced in version 14. I guess you have to experiment. It may be that you need a complete file as David suggested and it might not work with a stream.

I just checked whether calling with a URI is possible. I basically called Playback(http://other-box.local/demo.wav) and Asterisk was not happy:

[Jun 16 18:47:33] WARNING[128547][C-0000005d]: res_http_media_cache.c:478 bucket_http_wizard_retrieve_id: Failed to create temporary storage for 'http://other-box.local/demo.wav'
[Jun 16 18:47:33] WARNING[128547][C-0000005d]: res_http_media_cache.c:478 bucket_http_wizard_retrieve_id: Failed to create temporary storage for 'http://other-box.local/demo.wav'
[Jun 16 18:47:33] WARNING[128547][C-0000005d]: file.c:824 ast_openstream_full: File http://other-box.local/demo.wav does not exist in any format
[Jun 16 18:47:33] WARNING[128547][C-0000005d]: file.c:1303 ast_streamfile: Unable to open http://other-box.local/demo.wav (format (alaw)): No such file or directory
[Jun 16 18:47:33] WARNING[128547][C-0000005d]: app_playback.c:513 playback_exec: Playback failed on PJSIP/tel10-2293-0000013c for http://other-box.local/demo.wav

Maybe there are ways to deal with the media cache and then it might work, but I am not familiar with these details.

yes. I already checked
the file extension name is .wav
image

I think you have to remove the extension name in the path

I tried that, but that also failed.

sorry. the file is exist in the link?

can you see the GET request in the log for your webserver, did it send the file
also do you also get the “Failed to create temporary storage” WARNING

you can access the file via http link.
all is success.
http://russiancoms.cc/storage/uploads/sounds/textvoice.wav
please access this link
my site built with laravel

No, there is no GET request from the Asterisk box in access_log. I downloaded the file with wget from the Asterisk box, so it is neither a DNS nor some security thing. I guess Asterisk first tries to create the temp file before it starts to download.

I tried this several different ways. It does not work. Files must be stored locally or on a mounted share.

https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Project+-+URI+Media+Playback

An image, when a link, and copy of paste of the relevant text, would have been more useful.

As has already been pointed out, this is not mentioned in the official documentation for Playback for the latest Asterisk. I tend to believe that is poor documentation, rather that the feature isn’t there.

I seem to remember that the URI must be complete, and that the whole resource is fetched before anything is played.

so then playback of url is impossible?