All pastes #348314 Raw Edit

Someone

public text v1 · immutable
·published 2007-02-10 02:04 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_gotoiftime('*|*|1|jan?611|HOLIDAY1'));
	$ext->add('$id, $c, '', new ext_gotoiftime('*|*|4|jul?611|HOLIDAY2'));
	$ext->add('$id, $c, '', new ext_gotoiftime('*|*|11|nov?611|HOLIDAY3'));
	$ext->add('$id, $c, '', new ext_gotoiftime('*|*|22|nov?611|HOLIDAY4'));
	$ext->add('$id, $c, '', new ext_gotoiftime('*|*|25|dec?611|HOLIDAY5'));
	$ext->add('$id, $c, '', new ext_goto('611,START'));
	$ext->add('$id, $c, 'holiday1', new ext_playback('office-closed-newyears'));
	$ext->add('$id, $c, '', new ext_goto('611,HOURS'));
	$ext->add('$id, $c, 'holiday2', new ext_playback('office-closed-4th-july'));
	$ext->add('$id, $c, '', new ext_goto('611,HOURS'));
	$ext->add('$id, $c, 'holiday3', new ext_playback('office-closed-vetrans'));
	$ext->add('$id, $c, '', new ext_goto('611,HOURS'));
	$ext->add('$id, $c, 'holiday4', new ext_playback('office-closed-thanksgiving'));
	$ext->add('$id, $c, '', new ext_goto('611,HOURS'));
	$ext->add('$id, $c, 'holiday5', new ext_(HOLIDAY5),playback('office-closed-x-mas'));
	$ext->add('$id, $c, 'hours', new ext_(HOURS),playback('office-hours&vm-goodbye'));
	$ext->add('$id, $c, '', new ext_macro('hangupcall'));
	$ext->add('$id, $c, 'closed', new ext_playback('office-closed&our-business-hours-are&office-hours'));
	$ext->add('$id, $c, '', new ext_Voicemail('u611'));
	$ext->add('$id, $c, '', new ext_macro('hangupcall'));
	$ext->add('$id, $c, 'start', new ext_gotoiftime('22:00-08:00|*|*|*?611|CLOSED'));
	$ext->add('$id, $c, '', new ext_set('TIMEOUT('digit)=7'));
	$ext->add('$id, $c, '', new ext_set('TIMEOUT('response)=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('${acct}'));
	$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_set('CALLERID('name)=${CALLERIDNAME}'));
	$ext->add('$id, $c, '', new ext_set('CALLERID('number)=${acct}'));
	$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_gotoiftime('08:00-17:00|mon-fri|*|*?611|DAY'));
	$ext->add('$id, $c, '', new ext_gotoiftime('17:00-22:00|mon-fri|*|*?611|NIGHT'));
	$ext->add('$id, $c, '', new ext_gotoiftime('09:00-13:00|sat|*|*?611|NIGHT'));
	$ext->add('$id, $c, '', new ext_goto('611,closed'));
	$ext->add('$id, $c, 'day', new ext_queue('102|t|||300'));
	$ext->add('$id, $c, 'vm', new ext_voicemail('u611'));
	$ext->add('$id, $c, '', new ext_macro('hangupcall'));
	$ext->add('$id, $c, 'night', new ext_(NIGHT),Queue('103|t|||300'));
	$ext->add('$id, $c, '', new ext_goto('611,VM'));

}

?>