Using variable on Recording Location

serralta

Joined
Nov 25, 2009
Messages
6
Likes
0
Points
0
#1
I need to store all my recordings on folders based on date.
Like this: /var/spool/asterisk/monitor/${DATE}/

Can i use an variable on Recording Location path?
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#2
the directory wouldn't necessarily exist so would fail but perhaps a one liner like ::

mkdir -p ^{MIXMON_DIR}/`date +%Y%m%d` && mv ^{MIXMON_DIR}/^{CALLFILENAME}.^{MIXMON_FORMAT} ^{MIXMON_DIR}/`date +%Y%m%d`

in the "Run after record" box in general settings and a specific "base" directory in "recording location" might work for you.

You might want to replace the mv with ln if you want the gui voicemail/monitor web pages to continue to work.
 

serralta

Joined
Nov 25, 2009
Messages
6
Likes
0
Points
0
#3
Genius !!!
Will try.
Thanks a lot.
 

serralta

Joined
Nov 25, 2009
Messages
6
Likes
0
Points
0
#4
Well i tried but seems its not passing variables.
On cli all variables are empty.
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#5
doing (almost) exactly as I posted:

Extracted from my log file:

[2009-11-25 11:20:44] VERBOSE[32704] logger.c: == Begin MixMonitor Recording SIP/611-b71433c8
[2009-11-25 11:21:04] VERBOSE[32704] logger.c: == MixMonitor close filestream
[2009-11-25 11:21:04] VERBOSE[32704] logger.c: == Executing [mkdir -p /var/spool/asterisk/monitor//`date +%Y%m%d` && ln /var/spool/asterisk/monitor//OUT611-20091125-112044-1259176844.2920.wav /var/spool/asterisk/monitor//`date +%Y%m%d`]


from a bash shell


[prompt]>ls -l /var/spool/asterisk/monitor/`date +%Y%m%d`
total 384
308 -rw------- 2 asterisk asterisk 308524 Nov 25 11:21 OUT611-20091125-112044-1259176844.2920.wav
I showed you mine, now show me yours
 

serralta

Joined
Nov 25, 2009
Messages
6
Likes
0
Points
0
#6
Here is what i get (just paste your code):

== Spawn extension (macro-dialout-trunk, s, 19) exited non-zero on 'SIP/200-b68161e0' in macro 'dialout-trunk'
== Spawn extension (from-internal, 040047777, 4) exited non-zero on 'SIP/200-b68161e0'
== MixMonitor close filestream
== Executing [mkdir -p /`date +%Y%m%d` && mv /OUT200-20091125-174013-1259178013.575.gsm /`date +%Y%m%d`]
== End MixMonitor Recording SIP/200-b68161e0
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#7
Then I guess you missed my:

. . .and a specific "base" directory in "recording location" . . .

in my original post.

With your permission, I will correct your statement to "one of the variables is empty, it's the one I cared to leave empty"

to clean up:

rmdir /`date +%Y%m%d` , before tomorrow ;)
 

serralta

Joined
Nov 25, 2009
Messages
6
Likes
0
Points
0
#8
You are the man !!
Thanks a lot Dicko.
 

Members online

Latest posts

Forum statistics

Threads
30,918
Messages
130,924
Members
17,601
Latest member
andrebr
Top