Changeset 6595

Show
Ignore:
Timestamp:
09/07/08 13:42:10 (3 months ago)
Author:
pnlarsson
Message:

Fix for #3077 - DAHDI support, commit no 2 for core

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.5/amp_conf/bin/freepbx_engine

    r6244 r6595  
    9696        # Ensure that various hardware devices are owned correctly. 
    9797        [ -e /dev/zap ] && chown -R $AMPDEVUSER:$AMPDEVGROUP /dev/zap  
     98        [ -e /dev/dahdi ] && chown -R $AMPDEVUSER:$AMPDEVGROUP /dev/dahdi  
    9899        [ -e /dev/capi20 ] && chown -R $AMPDEVUSER:$AMPDEVGROUP /dev/capi20 
    99100        [ -e /dev/misdn ] && chown -R $AMPDEVUSER:$AMPDEVGROUP /dev/misdn 
  • freepbx/branches/2.5/amp_conf/bin/libfreepbx.confgen.php

    r5974 r6595  
    170170 
    171171function generate_configurations_zap($ast_version) { 
    172  
     172        global $chan_dahdi; 
    173173        global $amp_conf; 
    174174        global $db; 
     
    177177 
    178178        $zap_conf = $amp_conf['ASTETCDIR']."/zapata_additional.conf"; 
     179        $channel_name = 'ZAP'; 
     180        if ($chan_dahdi) { 
     181                $zap_conf = $amp_conf['ASTETCDIR']."/chan_dahdi_additional.conf"; 
     182                $channel_name = 'DAHDI'; 
     183        } 
    179184 
    180185        $table_name = "zap"; 
     
    184189        $zap_conf_fh = fopen($zap_conf,"w"); 
    185190        if ($zap_conf_fh === false) { 
    186                 fatal(_("Cannot write ZAP configurations"),sprintf(_("Failed creating/overwriting Zapata extensions file: %s"),$zap_conf)); 
     191                fatal(_("Cannot write $channel_name configurations"),sprintf(_("Failed creating/overwriting $channel_name extensions file: %s"),$zap_conf)); 
    187192        } 
    188193 
  • freepbx/branches/2.5/amp_conf/bin/retrieve_conf

    r6577 r6595  
    370370$engine = $engineinfo['engine']; 
    371371$version = $engineinfo['version']; 
     372$chan_dahdi = ast_with_dahdi(); 
    372373 
    373374// Check for and report any extension conflicts 
  • freepbx/branches/2.5/amp_conf/htdocs/admin/extensions.class.php

    r6549 r6595  
    929929class ext_zapbarge extends extension { 
    930930        function output() { 
    931                 return "ZapBarge(".$this->data.")"; 
     931                global $chan_dahdi; 
     932                 
     933                $command = 'ZapBarge'; 
     934                if ($chan_dahdi) { 
     935                        $command = 'DAHDIBarge'; 
     936                } 
     937                 
     938                return "$command(".$this->data.")"; 
    932939        } 
    933940} 
  • freepbx/branches/2.5/amp_conf/htdocs/admin/functions.inc.php

    r6591 r6595  
    729729        'AMPENABLEDEVELDEBUG'=> array('bool' , false), 
    730730        'AMPMPG123'      => array('bool' , true), 
     731        'ZAP2DAHDICOMPAT' => array('bool' , false), 
    731732); 
    732733 
     
    12731274        else 
    12741275                return false; 
     1276} 
     1277 
     1278/** 
     1279 * returns true if asterisk is running with chan_dahdi 
     1280 * 
     1281 * @return bool 
     1282 */ 
     1283function ast_with_dahdi() { 
     1284        global $version; 
     1285        global $astman; 
     1286        global $amp_conf; 
     1287         
     1288        if (!$amp_conf['ZAP2DAHDICOMPAT']) { 
     1289                return false; 
     1290        } 
     1291         
     1292        if (empty($version)) { 
     1293                $engine_info = engine_getinfo(); 
     1294                $version = $engine_info['version']; 
     1295        } 
     1296                 
     1297        if (version_compare($version, '1.4', 'ge') && $amp_conf['AMPENGINE'] == 'asterisk') {            
     1298                if (isset($astman) && $astman->connected()) { 
     1299                        $response = $astman->send_request('Command', array('Command' => 'module show like chan_dahdi')); 
     1300                        if (preg_match('/1 modules loaded/', $response['data'])) { 
     1301                                return true; 
     1302                        } 
     1303                } 
     1304        } 
     1305        return false; 
    12751306} 
    12761307 
  • freepbx/branches/2.5/amp_conf/htdocs/recordings/includes/main.conf.php

    r6505 r6595  
    263263$ASTERISK_PROTOCOLS['sip']['config_files'] = "/etc/asterisk/sip.conf;/etc/asterisk/sip_additional.conf"; 
    264264$ASTERISK_PROTOCOLS['zap']['table'] = "zap"; 
    265 $ASTERISK_PROTOCOLS['zap']['config_files'] = "/etc/asterisk/zapata.conf;/etc/asterisk/zapata_additional.conf"; 
     265$ASTERISK_PROTOCOLS['zap']['config_files'] = "/etc/asterisk/zapata.conf;/etc/asterisk/zapata_additional.conf;/etc/asterisk/chan_dahdi.conf;/etc/asterisk/chan_dahdi_additional.conf"; 
    266266 
    267267# Settings for Follow-Me Select Boxes in seconds 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads