Index: /freepbx/tags/2.5.0rc3/amp_conf/htdocs/admin/modules/infoservices/module.xml =================================================================== --- /freepbx/tags/2.5.0rc3/amp_conf/htdocs/admin/modules/infoservices/module.xml (revision 5728) +++ /freepbx/tags/2.5.0rc3/amp_conf/htdocs/admin/modules/infoservices/module.xml (revision 5728) @@ -0,0 +1,23 @@ + + infoservices + Info Services + 2.4.0.1 + no + no + setup + Internal Options & Configuration + Provides a number of applications accessable by feature codes: company directory, call trace (last call information), echo test, speaking clock, and speak current extension number. + + *2.4.0.1* #2731 fix press 0 for operator in directory + *2.4.0* bumped for 2.4 + *1.3.5.2* changed categories + *1.3.5.1* bump for rc1 + *1.3.5* #2145 add waitexten while waiting for user input, and make uninstallable + *1.3.4* changed ${CALLERID(number)} to ${AMPUSER} to accomodate CID number masquerading + *1.3.3* Fixed SpeakExtension - replaced depricated ${CALLERID} variable + *1.3.2* Fixed SpeakExtension - add macro-user-callerid + *1.3.1* Improved accuracy of speaking clock + + release/2.4/infoservices-2.4.0.1.tgz + 5059a43bf282d647b43ca702b3b55526 + Index: /freepbx/tags/2.5.0rc3/amp_conf/htdocs/admin/modules/infoservices/functions.inc.php =================================================================== --- /freepbx/tags/2.5.0rc3/amp_conf/htdocs/admin/modules/infoservices/functions.inc.php (revision 5727) +++ /freepbx/tags/2.5.0rc3/amp_conf/htdocs/admin/modules/infoservices/functions.inc.php (revision 5727) @@ -0,0 +1,155 @@ +getCodeActive(); + unset($fcc); + + if ($fc != '') + $fname($fc); + } else { + $ext->add('from-internal-additional', 'debug', '', new ext_noop($modulename.": No func $fname")); + var_dump($item); + } + } + } + break; + } +} + +function infoservices_directory($c) { + global $ext; + global $db; + + $oxtn = $db->getOne("SELECT value from globals where variable='OPERATOR_XTN'"); //this needs to be here! + + $id = "app-directory"; // The context to be included. This must be unique. + + // Start creating the dialplan + $ext->addInclude('from-internal-additional', $id); // Add the include from from-internal + // Build the context + $ext->add($id, $c, '', new ext_answer('')); + $ext->add($id, $c, '', new ext_wait('1')); // $cmd,1,Wait(1) + $ext->add($id, $c, '', new ext_agi('directory,${DIR-CONTEXT},from-did-direct,${DIRECTORY:0:1}${DIRECTORY_OPTS}'.($oxtn != '' ? 'o' : '') )); + $ext->add($id, $c, '', new ext_playback('vm-goodbye')); // $cmd,n,Playback(vm-goodbye) + $ext->add($id, $c, '', new ext_hangup('')); // hangup + if ($oxtn != '') { + $ext->add($id, 'o', '', new ext_goto('from-internal,${OPERATOR_XTN},1')); + } else { + $ext->add($id, 'i', '', new ext_playback('privacy-incorrect')); + } +} + +function infoservices_calltrace($c) { + global $ext; + + $id = "app-calltrace"; // The context to be included + + $ext->addInclude('from-internal-additional', $id); // Add the include from from-internal + + $ext->add($id, $c, '', new ext_goto('1', 's', 'app-calltrace-perform')); + + // Create the calltrace application, which we are doing a 'Goto' to above. + // I just reset these for ease of copying and pasting. + $id = 'app-calltrace-perform'; + $c = 's'; + $ext->add($id, $c, '', new ext_answer('')); + $ext->add($id, $c, '', new ext_wait('1')); + $ext->add($id, $c, '', new ext_macro('user-callerid')); + $ext->add($id, $c, '', new ext_playback('info-about-last-call&telephone-number')); + $ext->add($id, $c, '', new ext_setvar('lastcaller', '${DB(CALLTRACE/${AMPUSER})}')); + $ext->add($id, $c, '', new ext_gotoif('$[ $[ "${lastcaller}" = "" ] | $[ "${lastcaller}" = "unknown" ] ]', 'noinfo')); + $ext->add($id, $c, '', new ext_saydigits('${lastcaller}')); + $ext->add($id, $c, '', new ext_setvar('TIMEOUT(digit)', '3')); + $ext->add($id, $c, '', new ext_setvar('TIMEOUT(response)', '7')); + $ext->add($id, $c, '', new ext_background('to-call-this-number&press-1')); + $ext->add($id, $c, '', new ext_goto('fin')); + $ext->add($id, $c, 'noinfo', new ext_playback('from-unknown-caller')); + $ext->add($id, $c, '', new ext_macro('hangupcall')); + $ext->add($id, $c, 'fin', new ext_noop('Waiting for input')); + $ext->add($id, $c, '', new ext_waitexten(60)); + $ext->add($id, $c, '', new ext_Playback('sorry-youre-having-problems&goodbye')); + $ext->add($id, '1', '', new ext_goto('1', '${lastcaller}', 'from-internal')); + $ext->add($id, 'i', '', new ext_playback('vm-goodbye')); + $ext->add($id, 'i', '', new ext_macro('hangupcall')); + $ext->add($id, 't', '', new ext_playback('vm-goodbye')); + $ext->add($id, 't', '', new ext_macro('hangupcall')); + +} + +function infoservices_echotest($c) { + global $ext; + + $id = "app-echo-test"; // The context to be included + + $ext->addInclude('from-internal-additional', $id); // Add the include from from-internal + + $ext->add($id, $c, '', new ext_answer('')); // $cmd,1,Answer + $ext->add($id, $c, '', new ext_wait('1')); // $cmd,n,Wait(1) + $ext->add($id, $c, '', new ext_playback('demo-echotest')); // $cmd,n,Macro(user-callerid) + $ext->add($id, $c, '', new ext_echo('')); + $ext->add($id, $c, '', new ext_playback('demo-echodone')); // $cmd,n,Playback(...) + $ext->add($id, $c, '', new ext_hangup('')); // $cmd,n,Macro(user-callerid) +} + +function infoservices_speakingclock($c) { + global $ext; + + $id = "app-speakingclock"; // The context to be included + + $ext->addInclude('from-internal-additional', $id); // Add the include from from-internal + + $ext->add($id, $c, '', new ext_answer('')); // $cmd,1,Answer + $ext->add($id, $c, '', new ext_wait('1')); // $cmd,n,Wait(1) + $ext->add($id, $c, '', new ext_setvar('NumLoops','0')); + + $ext->add($id, $c, 'start', new ext_setvar('FutureTime','$[${EPOCH} + 11]')); // 10 seconds to try this out + $ext->add($id, $c, '', new ext_playback('at-tone-time-exactly')); + $ext->add($id, $c, '', new ext_gotoif('$["${TIMEFORMAT}" = "kM"]','hr24format')); + $ext->add($id, $c, '', new ext_sayunixtime('${FutureTime},,IM \\\'and\\\' S \\\'seconds\\\' p')); + $ext->add($id, $c, '', new ext_goto('waitloop')); + $ext->add($id, $c, 'hr24format', new ext_sayunixtime('${FutureTime},,kM \\\'and\\\' S \\\'seconds\\\'')); + $ext->add($id, $c, 'waitloop', new ext_set('TimeLeft', '$[${FutureTime} - ${EPOCH}]')); + $ext->add($id, $c, '', new ext_gotoif('$[${TimeLeft} < 1]','playbeep')); + //$ext->add($id, $c, '', new ext_saynumber('${TimeLeft}')); + $ext->add($id, $c, '', new ext_wait(1)); + $ext->add($id, $c, '', new ext_goto('waitloop')); + $ext->add($id, $c, 'playbeep', new ext_playback('beep')); + $ext->add($id, $c, '', new ext_wait(5)); + + $ext->add($id, $c, '', new ext_setvar('NumLoops','$[${NumLoops} + 1]')); + $ext->add($id, $c, '', new ext_gotoif('$[${NumLoops} < 5]','start')); // 5 is maximum number of times to repeat + $ext->add($id, $c, '', new ext_playback('goodbye')); + $ext->add($id, $c, '', new ext_hangup('')); +} + +function infoservices_speakextennum($c) { + global $ext; + + $id = "app-speakextennum"; + + $ext->addInclude('from-internal-additional', $id); // Add the include from from-internal + + $ext->add($id, $c, '', new ext_answer('')); // $cmd,1,Answer + $ext->add($id, $c, '', new ext_wait('1')); // $cmd,n,Wait(1) + $ext->add($id, $c, '', new ext_macro('user-callerid')); // $cmd,n,Macro(user-callerid) + $ext->add($id, $c, '', new ext_playback('your')); + $ext->add($id, $c, '', new ext_playback('extension')); + $ext->add($id, $c, '', new ext_playback('number')); + $ext->add($id, $c, '', new ext_playback('is')); + $ext->add($id, $c, '', new ext_saydigits('${AMPUSER}')); + $ext->add($id, $c, '', new ext_wait('2')); // $cmd,n,Wait(1) + $ext->add($id, $c, '', new ext_hangup('')); +} +?> Index: /freepbx/tags/2.5.0rc3/amp_conf/htdocs/admin/modules/infoservices/install.php =================================================================== --- /freepbx/tags/2.5.0rc3/amp_conf/htdocs/admin/modules/infoservices/install.php (revision 2130) +++ /freepbx/tags/2.5.0rc3/amp_conf/htdocs/admin/modules/infoservices/install.php (revision 2130) @@ -0,0 +1,33 @@ +setDescription('Directory'); +$fcc->setDefault('#'); +$fcc->update(); +unset($fcc); + +$fcc = new featurecode('infoservices', 'calltrace'); +$fcc->setDescription('Call Trace'); +$fcc->setDefault('*69'); +$fcc->update(); +unset($fcc); + +$fcc = new featurecode('infoservices', 'echotest'); +$fcc->setDescription('Echo Test'); +$fcc->setDefault('*43'); +$fcc->update(); +unset($fcc); + +$fcc = new featurecode('infoservices', 'speakingclock'); +$fcc->setDescription('Speaking Clock'); +$fcc->setDefault('*60'); +$fcc->update(); +unset($fcc); + +$fcc = new featurecode('infoservices', 'speakextennum'); +$fcc->setDescription('Speak Your Exten Number'); +$fcc->setDefault('*65'); +$fcc->update(); +unset($fcc); + +?>