Changeset 6168

Show
Ignore:
Timestamp:
07/24/08 20:32:12 (5 years ago)
Author:
mbrevda
Message:

#2922

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.5/core/etc/extensions.conf

    r6140 r6168  
    11101110[disa-dial] 
    11111111exten => _x.,1,Noop(called ${EXTEN} in ${DISACONTEXT} by ${DISA}) 
    1112 exten => _x.,n,Dial(Local/${EXTEN}@${DISACONTEXT},300,Hg
     1112exten => _x.,n,Dial(Local/${EXTEN}@${DISACONTEXT},300,${HANGUP}
    11131113exten => _x.,n,Gosub(s-${DIALSTATUS},1) 
    11141114exten => _x.,n,Goto(${DISA}) 
  • modules/branches/2.5/disa/functions.inc.php

    r6141 r6168  
    7676            $ext->add('disa', $item['disa_id'], '', new ext_setvar('RESCOUNT', '$[${RESCOUNT}+1]')); 
    7777            $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'])); 
    8386          $ext->add('disa', $item['disa_id'], '', new ext_setvar('TIMEOUT(response)', $thisitem['resptimeout'])); 
    8487           
     
    136139    $needconf = ''; 
    137140        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\")"); 
    139142} 
    140143 
     
    151154    $needconf = ''; 
    152155        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\""); 
    154157} 
    155158?> 
  • modules/branches/2.5/disa/install.php

    r5888 r6168  
    1515  resptimeout INTEGER,  
    1616  needconf VARCHAR( 10 )  
     17  hangup VARCHAR( 10 )  
    1718);"; 
    1819 
     
    2223} 
    2324 
     25//update to 2.5, add hangup 
     26//  ALTER TABLE `disa` CHANGE `hangup` `hangup` VARCHAR( 10 ) 
    2427 
     28$sql = "SELECT hangup FROM disa"; 
     29$check = $db->getRow($sql, DB_FETCHMODE_ASSOC); 
     30if(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   
    2538// Manage upgrade from DISA 1.0 
    2639// r2.0 Add Timeouts and add wait for confirmation 
  • modules/branches/2.5/disa/page.disa.php

    r5972 r6168  
    116116    <td><input type="text" name="context" value="<?php echo htmlspecialchars(isset($thisItem['context']) ? $thisItem['context'] : 'from-internal'); ?>" tabindex="<?php echo ++$tabindex;?>"></td> 
    117117  </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> 
    118122        <tr> 
    119123                <td colspan="2"><br><h6><input name="Submit" type="submit" value="<?php echo _("Submit Changes")?>" tabindex="<?php echo ++$tabindex;?>"></h6></td>