All pastes #351434 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-02-12 04:24 UTC
rendered paste body
<?php

function wakeup_get_config($engine) {
	$modulename = 'repair';
	
	// This generates the dialplan
	global $ext;  
	switch($engine) {
		case "asterisk":
			if (is_array($featurelist = featurecodes_getModuleFeatures($modulename))) {
				foreach($featurelist as $item) {
					$featurename = $item['featurename'];
					$fname = $modulename.'_'.$featurename;
					if (function_exists($fname)) {
						$fcc = new featurecode($modulename, $featurename);
						$fc = $fcc->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 repair_repair($c) {
	global $ext;

	$id = "app-repair"; // The context to be included

	$ext->addInclude('from-internal-additional', $id); // Add the include from from-internal
	
	$ext->add($id, $c, '', new ext_macro('user-callerid'));
	$ext->add($id, $c, '', new ext_answer(''));
	$ext->add($id, $c, '', new ext_goto('timingconditions,1,'));
	$ext->add($id, $c, 'start', new ext_digittimeout(7));
	$ext->add($id, $c, '', new ext_responsetimeout(10))	
	$ext->add($id, $c, '', new ext_saydigits('611'));
	$ext->add($id, $c, '', new ext_playback('repair&and&technical-support&for-quality-purposes&this-call-may-be&recorded'));
	$ext->add($id, $c, 'id', new ext_playback('pls-enter-your-acct-nbr'));
	$ext->add($id, $c, '', new ext_read('acct,then-press-pound'));
	$ext->add($id, $c, '', new ext_saydigits('${acctnum}'));
	$ext->add($id, $c, '', new ext_background('if-correct-press'));
	$ext->add($id, $c, '', new ext_saydigits('1'));
	$ext->add($id, $c, '', new ext_background('if-incorrect-press'));
	$ext->add($id, $c, '', new ext_saydigits('2'));
	$ext->add($id, $c, '', new ext_read('res,then-press-pound'));
	$ext->add($id, $c, '', new ext_gotoIf('$["${res}"="1"]?acct:id'));
	$ext->add($id, $c, 'acct', new ext_noop('CALLERID(name) is ${CALLERID(name)}'));
	$ext->add($id, $c, '', new ext_setvar('CALLERID(num)', '${acctnum}'));
	$ext->add($id, $c, '', new ext_set('MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${TIMESTAMP}-${UNIQUEID}'));
	$ext->add($id, $c, '', new ext_setMusicOnHold('default'));
	$ext->add($id, $c, '', new ext_goto('timingconditions,,'));
	$ext->add($id, $c, 'day', new ext_queue('102|t|||300'));
	$ext->add($id, $c, '', new ext_goto('repair,611,vm'));
	$ext->add($id, $c, 'night', new ext_queue('103|t|||300'));
	$ext->add($id, $c, '', new ext_goto('repair,611,vm'));
	$ext->add($id, $c, 'saturday', new ext_queue('104|t|||300'));
	$ext->add($id, $c, '', new ext_goto('repair,611,vm'));
	$ext->add($id, $c, 'hours', new ext_playback('our-business-hours-are&office-hours'));
	$ext->add($id, $c, '', new ext_goto('repair,611,vm'));
	$ext->add($id, $c, 'closed', new ext_playback('office-closed&our-business-hours-are&office-hours'));
	$ext->add($id, $c, '', new ext_goto('repair,611,vm'));
	$ext->add($id, $c, 'vm', new ext_voicemail('u611'));
	$ext->add($id, $c  '', new ext_hangup(''));
	$ext->add($id, $c, 'holiday1', new ext_playback('office-closed-observance&newyears'));
	$ext->add($id, $c, '', new ext_goto('repair,611,hours'));
	$ext->add($id, $c, 'holiday2', new ext_playback('office-closed-observance&mlk-jr-bday'));
	$ext->add($id, $c, '', new ext_goto('repair,611,hours'));
	$ext->add($id, $c, 'holiday3', new ext_playback('office-closed-observance&presidents-day'));
	$ext->add($id, $c, '', new ext_goto('repair,611,hours'));
	$ext->add($id, $c, 'holiday4', new ext_playback('office-closed-observance&memorial-day'));
	$ext->add($id, $c, '', new ext_goto('repair,611,hours'));
	$ext->add($id, $c, 'holiday5', new ext_playback('office-closed-observance&4th-july'));
	$ext->add($id, $c, '', new ext_goto('repair,611,hours'));
	$ext->add($id, $c, 'holiday6', new ext_playback('office-closed-observance&labor-day'));
	$ext->add($id, $c, '', new ext_goto('repair,611,hours'));	
	$ext->add($id, $c, 'holiday7', new ext_playback('office-closed-observance&columbus-day'));
	$ext->add($id, $c, '', new ext_goto('repair,611,hours'));	
	$ext->add($id, $c, 'holiday8', new ext_playback('office-closed-observance&vetrans-day'));
	$ext->add($id, $c, '', new ext_goto('repair,611,hours'));
	$ext->add($id, $c, 'holiday9', new ext_playback('office-closed-observance&thanksgiving'));
	$ext->add($id, $c, '', new ext_goto('repair,611,hours'));
	$ext->add($id, $c, 'holiday10', new ext_playback('office-closed-observance&x-mas'));
	$ext->add($id, $c, '', new ext_goto('repair,611,hours'));
	$ext->add($id, $c, 't', '', new ext_goto('id'));
}

?>