Using variable on Recording Location

Discussion in 'General' started by serralta, Nov 25, 2009.

  1. serralta

    Joined:
    Nov 25, 2009
    Messages:
    6
    Likes Received:
    0
    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?
     
  2. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    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.
     
  3. serralta

    Joined:
    Nov 25, 2009
    Messages:
    6
    Likes Received:
    0
    Genius !!!
    Will try.
    Thanks a lot.
     
  4. serralta

    Joined:
    Nov 25, 2009
    Messages:
    6
    Likes Received:
    0
    Well i tried but seems its not passing variables.
    On cli all variables are empty.
     
  5. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    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
     
  6. serralta

    Joined:
    Nov 25, 2009
    Messages:
    6
    Likes Received:
    0
    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
     
  7. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    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 ;)
     
  8. serralta

    Joined:
    Nov 25, 2009
    Messages:
    6
    Likes Received:
    0
    You are the man !!
    Thanks a lot Dicko.
     

Share This Page