Cannot DELETE recording

Hi There,

I’m having difficulty trying to delete a recording that has been created and stored within /var/spool/asterisk/voicemail/{extension}

I can play the recording etc, but when I call the RESTful ws to delete, I get a 404 Not Found.

The URI that is being called is:


I’ve tried this using ari_py and the modules to connect to ARI.

I’ve tried the same using curl, and get the same result. I’m using Asterisk 16.2.1

Much appreciated for your help.

Is there anyone who can help on this point?

Do you actually have a space in the name of the extension?

Yes, for some bizarre reason, that’s what the api call created. Is that likely to be the issue?

That depends - is the underlying containing a space? If not, then it could certainly cause a 404 to get returned since it would not exist.

I followed the tutorial on asterisk website for the basic voicemail template. Basic recording and playing. The asterisk dialplan was something like this:

exten => _4XX,1,NoOp()
same => n,Stasis(vm-record, ${EXTEN})
same => n,Hangup()

and this is what’s been created on disk:

drwxr-xr-x 2 root root 4096 Sep 1 09:39 ’ 400’

Note that the recording part works, and the files are in the directory. So it looks to me like its a space. However, unsure where the space comes from.

Don’t include a space between the comma and the $.

Ok, I’ll try that. Thanks

Ok, so space removed now, however, still getting 404 not found:

HTTPError: 404 Client Error: Not Found for url:

Any ideas?

Have you examined the stored recording list to see what it returns and what is actually present? I’m also not sure of the impact of using additional directories/folders, not something I’ve seen - although could be fine.

seems to be the directory structure. If I copy the file to the root of recordings, all is okay. The issue I have is that asterisk documentation shows that this should work. Seems to be a bug I would say.

I’ve followed the tutorial to learn and this is how I found the error:

As you can see the python code indicates a concatenated vm_path

self .vm_path = os.path.join( 'voicemail' , mailbox, str (time.time()))

Any suggestions on how to proceed? Is this an asterisk bug potentially?

I believe stored recordings are meant to be treated as named things, not paths to files, which is likely why it doesn’t work. Having a “/” in the name likely messes up the routing of the request in some way. I don’t think that’s a bug in the code itself, it just wasn’t made to be used that way.

The posted wiki page is a guide, so it should likely be updated. You can leave a comment with the details.

ok, point taken. However that would be a nice addition to functionality as it would be useful to be able to create structures within the record directory

actually looking at the json, there is parameter called path. I will have a look at this :smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.