Ticket #2922: loopdisa.diff

File loopdisa.diff, 3.8 kB (added by lazytt, 5 months ago)
  • page.disa.php

    old new  
    115115               <td><a href="#" class="info"><?php echo _("Context"); ?><span><?php echo _("(Experts Only) Sets the context that calls will originate from. Leave this as from-internal unless you know what you're doing."); ?></span></a></td> 
    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 Additional Calls"); ?><span><?php echo _("Will \"loop\" the DISA so that you will be returned to the dialtone when the call is disconected. In order to force a hangup (and a return to the dial tone), set the appropreate options in the outbound dial options in general settings. "); ?></span></a></td> 
     120               <td><input type="checkbox" name="loopcall" value="CHECKED" <?php echo $thisItem['loopcall'] ?>  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> 
    120124        </tr> 
  • functions.inc.php

    old new  
    9090                                               $ext->add('disa', $item['disa_id'], '', new ext_disa('/etc/asterisk/disa-'.$item['disa_id'].'.conf')); 
    9191                                       } 
    9292 
     93                                       if ($thisitem['loopcall'] == 'CHECKED') { 
     94                                        $ext->add('disa', $item['disa_id'], '', new ext_setvar('__LOOPDISA', 'disa,'.$item['disa_id'].',1')); 
     95                                       } else { 
    9396                                       $ext->add('disa', $item['disa_id'], 'end', new ext_hangup('')); 
     97                                       } 
    9498                                } 
    9599                        } 
    96100                break; 
     
    133137       if (!isset($needconf)) 
    134138               $needconf = ''; 
    135139        if(empty($displayname)) $displayname = "unnamed"; 
    136         $results = sql("INSERT INTO disa (displayname,pin,cid,context,resptimeout,digittimeout,needconf) values (\"".str_replace("\"", "\"\"",$displayname)."\",\"".$pin."\",\"".str_replace("\"", "\"\"", $cid)."\",\"".$context."\", \"$resptimeout\", \"$digittimeout\", \"$needconf\")"); 
     140        $results = sql("INSERT INTO disa (displayname,pin,cid,context,resptimeout,digittimeout,needconf,loopcall) values (\"".str_replace("\"", "\"\"",$displayname)."\",\"".$pin."\",\"".str_replace("\"", "\"\"", $cid)."\",\"".$context."\", \"$resptimeout\", \"$digittimeout\", \"$needconf\", \"$loopcall\")"); 
    137141} 
    138142 
    139143function disa_del($id) { 
     
    148152       if (!isset($needconf)) 
    149153               $needconf = ''; 
    150154        if(empty($displayname)) $displayname = "unnamed"; 
    151         $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\""); 
     155        $results = sql("UPDATE disa  set displayname = \"".str_replace("\"", "\"\"",$displayname)."\", pin = \"$pin\", cid = \"".str_replace("\"", "\"\"",$cid)."\", context = \"$context\", resptimeout = \"$resptimeout\", digittimeout = \"$digittimeout\", needconf = \"$needconf\", loopcall = \"$loopcall\" where disa_id = \"$id\""); 
    152156} 
    153157?> 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads