Changeset 10152 for modules

Show
Ignore:
Timestamp:
07/14/10 23:46:58 (3 years ago)
Author:
GameGamer43
Message:

closes #4213 - thanks ip-rob for adding support for app-confbridge

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.9/conferences/functions.inc.php

    r10133 r10152  
    8888  global $version; 
    8989  global $amp_conf; 
     90  global $astman; 
     91   
     92  if ($astver === null) { 
     93    $engineinfo = engine_getinfo(); 
     94    $astver =  $engineinfo['version']; 
     95  } 
     96  $ast_ge_162 = version_compare($astver, '1.6.2', 'ge'); 
     97  // Default to conference meetme 
     98  $confapp = 'ext_meetme'; 
     99  if ($ast_ge_162 && $amp_conf['AMPENGINE'] == 'asterisk' && isset($astman) && $astman->connected()) { 
     100        //check for meetme application and fallback to confbridge if possible 
     101    $app = $astman->send_request('Command', array('Command' => 'module show like meetme')); 
     102        if (preg_match('/[1-9] modules loaded/', $app['data'])){ 
     103      $confapp='ext_meetme'; 
     104    } else { 
     105      $app = $astman->send_request('Command', array('Command' => 'module show like confbridge')); 
     106      if (preg_match('/[1-9] modules loaded/', $app['data'])){         
     107        $confapp='ext_confbridge'; 
     108      } 
     109    } 
     110  } 
     111   
    90112  switch($engine) { 
    91113    case "asterisk": 
     
    98120        $ext->add($contextname, 'STARTMEETME', '', new ext_setvar('GROUP(meetme)','${MEETME_ROOMNUM}')); 
    99121        $ext->add($contextname, 'STARTMEETME', '', new ext_gotoif('$[${MAX_PARTICIPANTS} > 0 && ${GROUP_COUNT(${MEETME_ROOMNUM}@meetme)}>${MAX_PARTICIPANTS}]','MEETMEFULL,1')); 
    100         $ext->add($contextname, 'STARTMEETME', '', new ext_meetme('${MEETME_ROOMNUM}','${MEETME_OPTS}','${PIN}')); 
     122        if ($confapp != 'ext_confbridge') { 
     123          $ext->add($contextname, 'STARTMEETME', '', new ext_meetme('${MEETME_ROOMNUM}','${MEETME_OPTS}','${PIN}')); 
     124        } else { 
     125          $ext->add($contextname, 'STARTMEETME', '', new ext_confbridge('${MEETME_ROOMNUM}','${MEETME_OPTS}','${PIN}')); 
     126        } 
    101127        $ext->add($contextname, 'STARTMEETME', '', new ext_hangup('')); 
    102128 
  • modules/branches/2.9/conferences/page.conferences.php

    r10133 r10152  
    5252      redirect_standard('extdisplay'); 
    5353    break; 
     54  } 
     55} 
     56 
     57//Check to see if conference application is only confbridge 
     58global $amp_conf; 
     59global $astman; 
     60if ($astver === null) { 
     61  $engineinfo = engine_getinfo(); 
     62  $astver =  $engineinfo['version']; 
     63} 
     64$ast_ge_162 = version_compare($astver, '1.6.2', 'ge'); 
     65// Default to conference meetme 
     66$confapp = 'ext_meetme'; 
     67if ($ast_ge_162 && $amp_conf['AMPENGINE'] == 'asterisk' && isset($astman) && $astman->connected()) { 
     68      //check for meetme application and fallback to confbridge if possible 
     69  $app = $astman->send_request('Command', array('Command' => 'module show like meetme')); 
     70      if (preg_match('/[1-9] modules loaded/', $app['data'])){ 
     71    $confapp='ext_meetme'; 
     72  } else { 
     73    $app = $astman->send_request('Command', array('Command' => 'module show like confbridge')); 
     74    if (preg_match('/[1-9] modules loaded/', $app['data'])){        $confapp='ext_confbridge'; 
     75    } 
    5476  } 
    5577} 
     
    197219$engineinfo = engine_getinfo(); 
    198220$astver =  $engineinfo['version']; 
    199 if (version_compare($astver, '1.4', 'ge')) { 
     221 
     222//If the application is confbridge remove options that aren't supported 
     223if ($confapp=='ext_confbridge') { 
     224  str_replace("o","",$options); 
     225  str_replace("T","",$options); 
     226
     227 
     228if (version_compare($astver, '1.4', 'ge') && $confapp=='ext_meetme') { 
    200229?> 
    201230  <tr> 
     
    257286    </td> 
    258287  </tr> 
     288  <?php 
     289    //If the application is confbridge remove options that aren't supported 
     290    if ($confapp=='ext_confbridge') { 
     291      str_replace("i","",$options); 
     292    } 
     293    if ($confapp=='ext_meetme') { 
     294  ?> 
    259295  <tr> 
    260296    <td><a href="#" class="info"><?php echo _("User join/leave:")?><span><?php echo _("Announce user join/leave")?></span></a></td> 
     
    269305    </td> 
    270306  </tr> 
     307  <?php } ?> 
    271308  <tr> 
    272309    <td><a href="#" class="info"><?php echo _("Music on Hold:")?><span><?php echo _("Enable Music On Hold when the conference has a single caller")?></span></a></td> 
     
    319356    </td> 
    320357  </tr> 
    321  
     358  <?php 
     359    //If the application is confbridge remove options that aren't supported 
     360    if ($confapp=='ext_confbridge') { 
     361      str_replace("r","",$options); 
     362    } 
     363    if ($confapp=='ext_meetme') { 
     364  ?> 
    322365  <tr> 
    323366    <td><a href="#" class="info"><?php echo _("Record Conference:")?><span><?php echo _("Record the conference call")?></span></a></td> 
     
    332375    </td> 
    333376  </tr> 
    334  
     377  <?php } ?> 
    335378  <?php //Begin Maximum Participants Code ?> 
    336379  <tr>