Changeset 3481

Show
Ignore:
Timestamp:
01/02/07 06:25:59 (5 years ago)
Author:
qldrob
Message:

Apply more FOP fixes, supplied by James_Bennett, in #1484. Thanks!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/bin/retrieve_op_conf_from_mysql.pl

    r3191 r3481  
    7070      next; 
    7171    } 
     72 
     73                # check if trunk or extension 
     74                if($line =~ /^context=from-pstn/) { 
     75                        $istrunk=1; 
     76                        next; 
     77                } 
     78                if($line =~ /^context=from-zaptel/) { 
     79                        $istrunk=1; 
     80                        next; 
     81                } 
     82                if($line =~ /^context=from-internal/) { 
     83                        $istrunk=0; 
     84                        next; 
     85                } 
     86 
    7287    if($line =~ /^[b]?channel\s*=\s*[>]?\s*([\d\,-]+)\s*$/) { 
    7388      $ampwildcard and next; 
     
    8499          $newlabel=~s/\%n/$lastlabelnum/; 
    85100          $newlabel=~s/\%N/$lastlabelnum/; 
     101 
     102# only add if A) this is a trunk 
     103# and B) we haven't already defined any zaplines at the top of the file 
     104#        (I use this to customize it so instead of saying "Zap 1" it will 
     105#         say something more useful -- like the phone # of the line 
     106 
     107                                        if($istrunk) { 
     108                                                $inzaplines=0; 
     109                                                foreach my $row ( @zaplines ) { 
     110                                                        $tempvalue=@{$row}[0]; 
     111                                                        if($tempvalue eq "Zap/$c") { 
     112                                                                $inzaplines=1; 
     113                                                        } 
     114                                                } 
     115 
     116                                                if ($inzaplines==0) { 
     117                                                        @zaplines=(@zaplines,[ "Zap/$c","$newlabel" ]); 
     118                                                } 
     119                                        } 
     120 
    86121           
    87           @zaplines=(@zaplines,[ "Zap/$c","$newlabel" ]); 
    88122        } 
    89123