The spool directory has more than just recordings in it, it’s where voicemail is stored as well as the outgoing and outgoing_done folders for processing call files.
You should be able to specify a full path when you start recording regardless of where the spool directory is set to.
Oh ok, so i will keep the spool dir as the default for now.
I am using ARI, so in my code I am sending the full path I want to save the file
i.e. /var/sc_recording/client_10/2017-12-21/recording_outbound_2134.ulaw
But when i try to locate the file generated, it is not in that path above, it is in the path below
/var/spool/asterisk/recording/var/sc_recording/client_10/2017-12-21/recording_outbound_2134.ulaw
So it is concatenating the path. What am I missing?
I believe the permissions are fine for that folder I mentioned.
I am using ARI, so I am not using MixMonitor, but instead I am sending a POST like below:
The problem is that it keeps sending the ulaw to that /var/spool/asterisk/recording/
As I wrote to John, I am sending the full path when starting recording, but it concatenates the paths.
I have while without use ARI, but reading the documentation I think that you cant specify the path on the POST request
“The location of stored recordings is in the /recording subdirectory of the configured astspooldir in asterisk.conf. By default, this places recordings in /var/spool/asterisk/recording.”
Yes, I also checked that link before.
In my POST I do send the full path I want to save the call record, but still it is concatenating with the default path.
I guess path need to be edited on asterisk.conf file, you cant do it on your POST request, it is not something im 100 % sure but based on the above link I guess that
Allowing remote users to create files in random locations on the server is generally a bad idea. The paths that you specify are all relative to /var/spool/asterisk/recording (or rather, the Asterisk recording directory).
Matt"
@mjordan, This afirmation on the link above really means I can’t define a location to a record not relative to /var/spool/asterisk/recording ? I am using ARI to record a channel and I tried different approaches but none of them worked.
Correct. Any path you specify is going to be relative to your Asterisk system’s recording directory.
It shouldn’t be to hard to think of why that’s the case. Allowing a remote system to have write file access to literally anywhere on your Asterisk system is a horrible idea. I don’t even want to contemplate the shenanigans that would happen to random systems if we allowed that.
You have a couple of rather easy options:
Change the location of your recording directory in asterisk.conf
Record the file in its default location, and have a cron job or other daemon copy/move the file to where you want it to be.
Keep in mind that if you want to play back those recordings at some point, you’ll need them in a place that ARI can find them. That doesn’t have to be the recording directory, but there are limitations in Asterisk on where it looks for files to play back as well (sounds directory, recording directories, etc.)
Yep, I understand your considerations.
in fact my system just need the recordings as call register. I won’t play them or manipulate them using asterisk. Those records will be available only in my system after converting the ulaws to mp4.
I started this post because as you stated:
Change the location of your recording directory in asterisk.conf
I also believed i could point the recording to a different location after changing the astspooldir. But it didn’t work at all. It kept saving those files to the “/var/spool/asterisk/recording” even though I was specifying the full path of the recordings to “/var/sc_recording/client_10/” for example.
And it was concatenating both paths.
I tried changing the astspooldir to “/var/sc_recording” but it didn’t work.
After changing the asterisk.conf, I did a “core reload” and also tried restarting asterisk service but none of them worked.
The only thing I noticed is that it was creating a temporary file on “/var/sc_recording” replacing the “/” for “_”.
Something like that: