Changeset 6168
- Timestamp:
- 07/24/08 20:32:12 (5 years ago)
- Files:
-
- modules/branches/2.5/core/etc/extensions.conf (modified) (1 diff)
- modules/branches/2.5/disa/functions.inc.php (modified) (3 diffs)
- modules/branches/2.5/disa/install.php (modified) (2 diffs)
- modules/branches/2.5/disa/page.disa.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.5/core/etc/extensions.conf
r6140 r6168 1110 1110 [disa-dial] 1111 1111 exten => _x.,1,Noop(called ${EXTEN} in ${DISACONTEXT} by ${DISA}) 1112 exten => _x.,n,Dial(Local/${EXTEN}@${DISACONTEXT},300, Hg)1112 exten => _x.,n,Dial(Local/${EXTEN}@${DISACONTEXT},300,${HANGUP}) 1113 1113 exten => _x.,n,Gosub(s-${DIALSTATUS},1) 1114 1114 exten => _x.,n,Goto(${DISA}) modules/branches/2.5/disa/functions.inc.php
r6141 r6168 76 76 $ext->add('disa', $item['disa_id'], '', new ext_setvar('RESCOUNT', '$[${RESCOUNT}+1]')); 77 77 $ext->add('disa', $item['disa_id'], '', new ext_gotoif('$["x${RRES}"="x"]', 'loop')); 78 } 79 $ext->add('disa', $item['disa_id'], '', new ext_setvar('__DISA', '"disa,'.$item['disa_id'].',1"')); 80 $ext->add('disa', $item['disa_id'], '', new ext_setvar('__DISACONTEXT', $thisitem['context'])); 81 $ext->add('disa', $item['disa_id'], '', new ext_setvar('__KEEPCID', 'TRUE')); 82 $ext->add('disa', $item['disa_id'], '', new ext_setvar('TIMEOUT(digit)', $thisitem['digittimeout'])); 78 } 79 $ext->add('disa', $item['disa_id'], '', new ext_setvar('_DISA', '"disa,'.$item['disa_id'].',1"')); 80 $ext->add('disa', $item['disa_id'], '', new ext_setvar('_DISACONTEXT', $thisitem['context'])); 81 $ext->add('disa', $item['disa_id'], '', new ext_setvar('_KEEPCID', 'TRUE')); 82 if ($thisitem['hangup'] == 'CHECKED') { 83 $ext->add('disa', $item['disa_id'], '', new ext_setvar('_HANGUP', 'Hg')); 84 } 85 $ext->add('disa', $item['disa_id'], '', new ext_setvar('TIMEOUT(digit)', $thisitem['digittimeout'])); 83 86 $ext->add('disa', $item['disa_id'], '', new ext_setvar('TIMEOUT(response)', $thisitem['resptimeout'])); 84 87 … … 136 139 $needconf = ''; 137 140 if(empty($displayname)) $displayname = "unnamed"; 138 $results = sql("INSERT INTO disa (displayname,pin,cid,context,resptimeout,digittimeout,needconf ) values (\"".str_replace("\"", "\"\"",$displayname)."\",\"".$pin."\",\"".str_replace("\"", "\"\"", $cid)."\",\"".$context."\", \"$resptimeout\", \"$digittimeout\", \"$needconf\")");141 $results = sql("INSERT INTO disa (displayname,pin,cid,context,resptimeout,digittimeout,needconf,hangup) values (\"".str_replace("\"", "\"\"",$displayname)."\",\"".$pin."\",\"".str_replace("\"", "\"\"", $cid)."\",\"".$context."\", \"$resptimeout\", \"$digittimeout\", \"$needconf\", \"$hangup\")"); 139 142 } 140 143 … … 151 154 $needconf = ''; 152 155 if(empty($displayname)) $displayname = "unnamed"; 153 $results = sql("UPDATE disa set displayname = \"".str_replace("\"", "\"\"",$displayname)."\", pin = \"$pin\", cid = \"".str_replace("\"", "\"\"",$cid)."\", context = \"$context\", resptimeout = \"$resptimeout\", digittimeout = \"$digittimeout\", needconf = \"$needconf\" where disa_id = \"$id\"");156 $results = sql("UPDATE disa set displayname = \"".str_replace("\"", "\"\"",$displayname)."\", pin = \"$pin\", cid = \"".str_replace("\"", "\"\"",$cid)."\", context = \"$context\", resptimeout = \"$resptimeout\", digittimeout = \"$digittimeout\", needconf = \"$needconf\", hangup = \"$hangup\" where disa_id = \"$id\""); 154 157 } 155 158 ?> modules/branches/2.5/disa/install.php
r5888 r6168 15 15 resptimeout INTEGER, 16 16 needconf VARCHAR( 10 ) 17 hangup VARCHAR( 10 ) 17 18 );"; 18 19 … … 22 23 } 23 24 25 //update to 2.5, add hangup 26 // ALTER TABLE `disa` CHANGE `hangup` `hangup` VARCHAR( 10 ) 24 27 28 $sql = "SELECT hangup FROM disa"; 29 $check = $db->getRow($sql, DB_FETCHMODE_ASSOC); 30 if(DB::IsError($check)) { 31 $sql = 'ALTER TABLE `disa` CHANGE `hangup` `hangup` VARCHAR( 10 )'; 32 $result = $db->query($sql); 33 if(DB::IsError($result)) { 34 die_freepbx($result->getDebugInfo()); 35 } 36 } 37 25 38 // Manage upgrade from DISA 1.0 26 39 // r2.0 Add Timeouts and add wait for confirmation modules/branches/2.5/disa/page.disa.php
r5972 r6168 116 116 <td><input type="text" name="context" value="<?php echo htmlspecialchars(isset($thisItem['context']) ? $thisItem['context'] : 'from-internal'); ?>" tabindex="<?php echo ++$tabindex;?>"></td> 117 117 </tr> 118 <tr> 119 <td><a href="#" class="info"><?php echo _("Allow Hangup"); ?><span><?php echo _("Allow the current call to be ended and return the caller to the dial tone by presseing the Hangup feature code"); ?></span></a></td> 120 <td><input type="checkbox" name="hangup" value="CHECKED" <?php echo $thisItem['hangup'] ?> tabindex="<?php echo ++$tabindex;?>"/></td> 121 </tr> 118 122 <tr> 119 123 <td colspan="2"><br><h6><input name="Submit" type="submit" value="<?php echo _("Submit Changes")?>" tabindex="<?php echo ++$tabindex;?>"></h6></td>
