Changeset 13486

Show
Ignore:
Timestamp:
02/20/12 17:39:43 (1 year ago)
Author:
p_lindheimer
Message:

closes #5115 different approach to supplied patch. See diff and comments to see how new languages can be introduced. Can also change the 'at-tone-time-exactly' sound file and or order as might be appropriate for a particular language. Can also use extensions_custom.conf to add langauges to the subroutine contexts, though any proper additions should be included into FreePBX

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.10/infoservices/functions.inc.php

    r13091 r13486  
    117117   
    118118  $ext->add($id, $c, 'start', new ext_setvar('FutureTime','$[${EPOCH} + 11]'));  // 10 seconds to try this out 
    119   $ext->add($id, $c, '', new ext_playback('at-tone-time-exactly')); 
    120   $ext->add($id, $c, '', new ext_gotoif('$["${TIMEFORMAT}" = "kM"]','hr24format')); 
    121   $ext->add($id, $c, '', new ext_sayunixtime('${FutureTime},,IM \\\'and\\\' S \\\'seconds\\\' p')); 
    122   $ext->add($id, $c, '', new ext_goto('waitloop')); 
    123   $ext->add($id, $c, 'hr24format', new ext_sayunixtime('${FutureTime},,kM \\\'and\\\' S \\\'seconds\\\'')); 
     119  $ext->add($id, $c, '', new ext_gosubif('$["${TIMEFORMAT}"="kM"]','sub-hr24format,s,1','sub-hr12format,s,1')); 
     120 
    124121  $ext->add($id, $c, 'waitloop', new ext_set('TimeLeft', '$[${FutureTime} - ${EPOCH}]')); 
    125122  $ext->add($id, $c, '', new ext_gotoif('$[${TimeLeft} < 1]','playbeep')); 
    126   //$ext->add($id, $c, '', new ext_saynumber('${TimeLeft}')); 
    127123  $ext->add($id, $c, '', new ext_wait(1)); 
    128124  $ext->add($id, $c, '', new ext_goto('waitloop')); 
    129125  $ext->add($id, $c, 'playbeep', new ext_playback('beep')); 
    130126  $ext->add($id, $c, '', new ext_wait(5)); 
    131    
    132127  $ext->add($id, $c, '', new ext_setvar('NumLoops','$[${NumLoops} + 1]')); 
    133128  $ext->add($id, $c, '', new ext_gotoif('$[${NumLoops} < 5]','start')); // 5 is maximum number of times to repeat 
    134129  $ext->add($id, $c, '', new ext_playback('goodbye')); 
    135130  $ext->add($id, $c, '', new ext_hangup('')); 
     131 
     132 
     133  // 24 hr format default if no language provided 
     134  // 
     135  $id = "sub-hr24format"; 
     136  $ex = 'i'; 
     137  $ext->add($id, $ex, '', new ext_playback('at-tone-time-exactly')); 
     138  $ext->add($id, 's', '', new ext_goto('1', '${CHANNEL(language)}')); 
     139  $ext->add($id, $ex, '', new ext_sayunixtime('${FutureTime},,kM \\\'and\\\' S \\\'seconds\\\'')); 
     140  $ext->add($id, $ex, '', new ext_return('')); 
     141 
     142  // German specific language format 
     143  $ex = 'de'; 
     144  $ext->add($id, $ex, '', new ext_playback('at-tone-time-exactly')); 
     145  $ext->add($id, $ex, '', new ext_sayunixtime('${FutureTime},,kMS')); 
     146  $ext->add($id, $ex, '', new ext_return('')); 
     147 
     148 
     149  // 12 hr format default if no language provided 
     150  // 
     151  $id = "sub-hr12format"; 
     152  $ex = 'i'; 
     153  $ext->add($id, 's', '', new ext_goto('1', '${CHANNEL(language)}')); 
     154  $ext->add($id, $ex, '', new ext_playback('at-tone-time-exactly')); 
     155  $ext->add($id, $ex, '', new ext_sayunixtime('${FutureTime},,IM \\\'and\\\' S \\\'seconds\\\' p')); 
     156  $ext->add($id, $ex, '', new ext_return('')); 
     157 
     158  // German specific language format 
     159  $ex = 'de'; 
     160  $ext->add($id, $ex, '', new ext_playback('at-tone-time-exactly')); 
     161  $ext->add($id, $ex, '', new ext_sayunixtime('${FutureTime},,IMSp')); 
     162  $ext->add($id, $ex, '', new ext_return('')); 
     163 
     164  // To add another language follow the pattern done for German. You should also be able to use 
     165  // extensions_custom.conf for this 
    136166} 
    137167