Changeset 6146

Show
Ignore:
Timestamp:
07/23/08 12:38:15 (1 month ago)
Author:
p_lindheimer
Message:

#2924, 257 set poll_voicemail=1 and pull vmcontext settings from the device setup

Files:

Legend:

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

    r6048 r6146  
    215215 
    216216if (table_exists($dbh,"devices")) { 
    217         $statement = "SELECT description,id,dial from devices"; 
     217        $statement = "SELECT description,id,dial,tech from devices"; 
    218218        $result = $dbh->selectall_arrayref($statement); 
    219219        @resultSet = @{$result}; 
     
    319319                my $id = @{ $row }[1]; 
    320320                my $dial = @{ $row }[2]; 
     321                 
     322                 
     323                # Support for real mailbox settings -    
     324                my $tech = @{ $row }[3]; 
     325                # some sensible defaults for voicemail ext and context 
     326                my $vmext = @{ $row }[1]; 
     327                my $vmcontext = "default"; 
     328                # database table name for iax2 is just iax but sip and zap are ok 
     329                if ($tech eq "iax2") {$tech = "iax";} 
     330                # get mailbox setting from relevant tech table and split into ext and content 
     331                if (table_exists($dbh,$tech)) { 
     332                        $statement = "SELECT data from $tech WHERE id = '$id' AND keyword = 'mailbox' "; 
     333                        $result = $dbh->selectall_arrayref($statement); 
     334                        @resultSet = @{$result}; 
     335                        if ( $#resultSet == -1 ) {print "Notice: no mailbox defined\n";} 
     336                        my $mailbox = $resultSet[0][0];  
     337                        my @values = split('@', $mailbox); 
     338                        if (exists($values[0])) {$vmext = $values[0];} 
     339                        if (exists($values[0])) {$vmcontext = $values[1];} 
     340                } else { print "Table does not exist: $tech\n"; } 
     341                # - Support for real mailbox settings 
     342                 
     343                 
     344                 
    321345#       #       next if ($account eq ""); 
    322346                $btn=get_next_btn($extenpos,$btn); 
    323347                $icon='4'; 
    324                 print EXTEN "[$dial]\nPosition=$btn\nLabel=\"$id : $description\"\nExtension=$id\nContext=from-internal\nIcon=$icon\nVoicemail_Context=default\nVoiceMailExt=*$id\@from-internal\nPanel_Context=$panelcontext\n"; 
     348                print EXTEN "[$dial]\nPosition=$btn\nLabel=\"$id : $description\"\nExtension=$id\nContext=from-internal\nIcon=$icon\nVoicemail_Context=$vmcontext\nVoiceMailExt=*$vmext\@from-internal\nPanel_Context=$panelcontext\n"; 
    325349        } 
    326350         
  • freepbx/trunk/amp_conf/htdocs_panel/op_server.cfg

    r5779 r6146  
    5555; Poll for voicemail status (only necesary when you access the 
    5656; voicemail directories outside asterisk itself - eg. web access) 
    57 poll_voicemail=0 
     57poll_voicemail=1 
    5858 
    5959; 1 Enable automatic hangup of zombies 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads