Changeset 8269

Show
Ignore:
Timestamp:
08/31/09 21:44:46 (2 years ago)
Author:
p_lindheimer
Message:

closes #3529 move macro-systemrecording from core to recording module and change tmp folder location to Asterisk spool directory

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.6/core/functions.inc.php

    r8263 r8269  
    19951995      //$ext->add($context, $exten, 'checkname', new ext_execif('$[ $[ "${CALLERID(number)}" = "${REALCALLERIDNUM}" ] & $[ "${CALLERID(name)}" = "" ] ]', 'Set', 'CALLERID(name)=${REALCALLERIDNAME}')); 
    19961996 
    1997        
    1998  
    1999       $context = 'macro-systemrecording'; 
    2000        
    2001       //exten => s,1,Set(RECFILE=${IF($["${ARG2}" = ""]?/tmp/${AMPUSER}-ivrrecording:${ARG2})}) 
    2002       $ext->add($context, 's', '', new ext_setvar('RECFILE','${IF($["${ARG2}" = ""]?/tmp/${AMPUSER}-ivrrecording:${ARG2})}')); 
    2003       $ext->add($context, 's', '', new ext_execif('$["${ARG3}" != ""]','Authenticate','${ARG3}')); 
    2004       $ext->add($context, 's', '', new ext_goto(1, '${ARG1}')); 
    2005        
    2006       $exten = 'dorecord'; 
    2007        
    2008       // Delete all versions of the current sound file (does not consider languages though 
    2009       // otherwise you might have some versions that are not re-recorded 
    2010       // 
    2011       $ext->add($context, $exten, '', new ext_system('rm ${ASTVARLIBDIR}/sounds/${RECFILE}.*')); 
    2012       $ext->add($context, $exten, '', new ext_record('${RECFILE}:wav')); 
    2013       $ext->add($context, $exten, '', new ext_wait(1)); 
    2014       $ext->add($context, $exten, '', new ext_goto(1, 'confmenu')); 
    2015  
    2016       $exten = 'docheck'; 
    2017        
    2018       $ext->add($context, $exten, '', new ext_playback('beep')); 
    2019       if ($ast_ge_14) { 
    2020         $ext->add($context, $exten, 'dc_start', new ext_background('${RECFILE},m,${CHANNEL(language)},macro-systemrecording')); 
    2021       } else { 
    2022         $ext->add($context, $exten, 'dc_start', new ext_background('${RECFILE},m,${LANGUAGE},macro-systemrecording')); 
    2023       } 
    2024       $ext->add($context, $exten, '', new ext_wait(1)); 
    2025       $ext->add($context, $exten, '', new ext_goto(1, 'confmenu')); 
    2026  
    2027       $exten = 'confmenu'; 
    2028       if ($ast_ge_14) { 
    2029         $ext->add($context, $exten, '', new ext_background('to-listen-to-it&press-1&to-rerecord-it&press-star&astcc-followed-by-pound,m,${CHANNEL(language)},macro-systemrecording')); 
    2030       } else { 
    2031         $ext->add($context, $exten, '', new ext_background('to-listen-to-it&press-1&to-rerecord-it&press-star&astcc-followed-by-pound,m,${LANGUAGE},macro-systemrecording')); 
    2032       } 
    2033       $ext->add($context, $exten, '', new ext_read('RECRESULT', '', 1, '', '', 4)); 
    2034       $ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x*"]', 'dorecord,1')); 
    2035       $ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x1"]', 'docheck,2')); 
    2036       $ext->add($context, $exten, '', new ext_goto(1)); 
    2037        
    2038       $ext->add($context, '1', '', new ext_goto('dc_start', 'docheck')); 
    2039       $ext->add($context, '*', '', new ext_goto(1, 'dorecord')); 
    2040        
    2041       $ext->add($context, 't', '', new ext_playback('goodbye')); 
    2042       $ext->add($context, 't', '', new ext_hangup()); 
    2043        
    2044       $ext->add($context, 'i', '', new ext_playback('pm-invalid-option')); 
    2045       $ext->add($context, 'i', '', new ext_goto(1, 'confmenu')); 
    2046  
    2047       $ext->add($context, 'h', '', new ext_hangup()); 
    2048  
    2049        
    20501997      $context = 'from-zaptel'; 
    20511998      $exten = '_X.'; 
  • modules/branches/2.6/core/module.xml

    r8266 r8269  
    44  <category>Basic</category> 
    55  <name>Core</name> 
    6   <version>2.6.0beta2.2</version> 
     6  <version>2.6.0beta2.3</version> 
    77  <publisher>FreePBX</publisher> 
    88  <license>GPLv2+</license> 
     
    1010  <canuninstall>no</canuninstall> 
    1111  <changelog> 
     12    *2.6.0beta2.3* #3529 
    1213    *2.6.0beta2.2* #3722, #3848, #3841, #3700 
    1314    *2.6.0beta2.1* #3844 (revert #3423), #3846, #3849 
  • modules/branches/2.6/recordings/functions.inc.php

    r6903 r8269  
    33// Source and Destination Dirctories for recording 
    44global $recordings_astsnd_path; // PHP5 needs extra convincing of a global 
    5 $recordings_save_path = "/tmp/"; 
     5global $amp_conf; 
     6$recordings_save_path = $amp_conf['ASTSPOOLDIR']."/tmp/"; 
    67$recordings_astsnd_path = isset($asterisk_conf['astvarlibdir'])?$asterisk_conf['astvarlibdir']:'/var/lib/asterisk'; 
    78$recordings_astsnd_path .= "/sounds/"; 
     
    1011  global $ext;  // is this the best way to pass this? 
    1112  global $recordings_save_path; 
     13  global $version; 
     14 
     15  $ast_ge_14 = version_compare($version, '1.4', 'ge'); 
    1216   
    1317  $modulename = "recordings"; 
     
    7175        } 
    7276      } 
     77 
     78      // moved from modules/core to modules/recordings 
     79      // since it really belongs here and not there 
     80      // also provides direct access to $recordings_save_path 
     81      // which removes a hard-coded value in the macro 
     82 
     83      $context = 'macro-systemrecording'; 
     84       
     85      $ext->add($context, 's', '', new ext_setvar('RECFILE','${IF($["${ARG2}" = ""]?'.$recordings_save_path.'${AMPUSER}-ivrrecording:${ARG2})}')); 
     86      $ext->add($context, 's', '', new ext_execif('$["${ARG3}" != ""]','Authenticate','${ARG3}')); 
     87      $ext->add($context, 's', '', new ext_goto(1, '${ARG1}')); 
     88       
     89      $exten = 'dorecord'; 
     90       
     91      // Delete all versions of the current sound file (does not consider languages though 
     92      // otherwise you might have some versions that are not re-recorded 
     93      // 
     94      $ext->add($context, $exten, '', new ext_system('rm ${ASTVARLIBDIR}/sounds/${RECFILE}.*')); 
     95      $ext->add($context, $exten, '', new ext_record('${RECFILE}:wav')); 
     96      $ext->add($context, $exten, '', new ext_wait(1)); 
     97      $ext->add($context, $exten, '', new ext_goto(1, 'confmenu')); 
     98 
     99      $exten = 'docheck'; 
     100       
     101      $ext->add($context, $exten, '', new ext_playback('beep')); 
     102      if ($ast_ge_14) { 
     103        $ext->add($context, $exten, 'dc_start', new ext_background('${RECFILE},m,${CHANNEL(language)},macro-systemrecording')); 
     104      } else { 
     105        $ext->add($context, $exten, 'dc_start', new ext_background('${RECFILE},m,${LANGUAGE},macro-systemrecording')); 
     106      } 
     107      $ext->add($context, $exten, '', new ext_wait(1)); 
     108      $ext->add($context, $exten, '', new ext_goto(1, 'confmenu')); 
     109 
     110      $exten = 'confmenu'; 
     111      if ($ast_ge_14) { 
     112        $ext->add($context, $exten, '', new ext_background('to-listen-to-it&press-1&to-rerecord-it&press-star&astcc-followed-by-pound,m,${CHANNEL(language)},macro-systemrecording')); 
     113      } else { 
     114        $ext->add($context, $exten, '', new ext_background('to-listen-to-it&press-1&to-rerecord-it&press-star&astcc-followed-by-pound,m,${LANGUAGE},macro-systemrecording')); 
     115      } 
     116      $ext->add($context, $exten, '', new ext_read('RECRESULT', '', 1, '', '', 4)); 
     117      $ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x*"]', 'dorecord,1')); 
     118      $ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x1"]', 'docheck,2')); 
     119      $ext->add($context, $exten, '', new ext_goto(1)); 
     120       
     121      $ext->add($context, '1', '', new ext_goto('dc_start', 'docheck')); 
     122      $ext->add($context, '*', '', new ext_goto(1, 'dorecord')); 
     123       
     124      $ext->add($context, 't', '', new ext_playback('goodbye')); 
     125      $ext->add($context, 't', '', new ext_hangup()); 
     126       
     127      $ext->add($context, 'i', '', new ext_playback('pm-invalid-option')); 
     128      $ext->add($context, 'i', '', new ext_goto(1, 'confmenu')); 
     129 
     130      $ext->add($context, 'h', '', new ext_hangup()); 
     131 
    73132    break; 
    74133  } 
  • modules/branches/2.6/recordings/module.xml

    r8231 r8269  
    22  <rawname>recordings</rawname> 
    33  <name>Recordings</name> 
    4   <version>3.3.9.2</version> 
     4  <version>3.3.9.3</version> 
    55  <publisher>FreePBX</publisher> 
    66  <license>GPLv2+</license> 
     
    1111  <description>Creates and manages system recordings, used by many other modules (eg, IVR).</description> 
    1212  <changelog> 
     13    *3.3.9.3* #3529 
    1314    *3.3.9.2* #3779 
    1415    *3.3.9.1* localizations, misc