Changeset 13130
- Timestamp:
- 12/28/11 15:47:05 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/2.10/amp_conf/htdocs/admin/functions.inc.php
r13098 r13130 199 199 } 200 200 201 if (version_compare($version, '1.4', 'ge') && $amp_conf['AMPENGINE'] == 'asterisk') { 202 if ($amp_conf['ZAP2DAHDICOMPAT']) { 203 $ast_with_dahdi = true; 204 $chan_dahdi_loaded = true; 205 return true; 206 } else if (isset($astman) && $astman->connected()) { 207 // earlier revisions of 1.4 and dahdi loaded but still running as zap, so if ZapScan is present, we assume 208 // that is the mode it is running in. 209 $response = $astman->send_request('Command', array('Command' => 'show applications like ZapScan')); 210 if (!preg_match('/1 Applications Matching/', $response['data'])) { 211 $ast_with_dahdi = true; 212 $chan_dahdi_loaded = true; 213 return $ast_with_dahdi; 214 } else { 215 $chan_dahdi_loaded = false; 216 } 217 } 201 if ($amp_conf['ZAP2DAHDICOMPAT']) { 202 $ast_with_dahdi = true; 203 $chan_dahdi_loaded = true; 204 return true; 218 205 } 219 206 $ast_with_dahdi = false; modules/branches/2.10/core/functions.inc.php
r13091 r13130 1389 1389 // 1390 1390 if (!isset($chan_dahdi_loaded)) { 1391 if ($ast_ge_14 && isset($astman) && $astman->connected()) { 1392 $response = $astman->send_request('Command', array('Command' => 'module show like chan_dahdi')); 1393 $chan_dahdi_loaded = (preg_match('/1 modules loaded/', $response['data']) > 0); 1391 if (isset($astman) && $astman->connected()) { 1392 $chan_dahdi_loaded = $astman->mod_loaded('chan_dahdi'); 1394 1393 } 1395 1394 } … … 3956 3955 $ext->add($mcontext,$exten,'begin', new ext_set('THISDIAL', '${DB(DEVICE/${CUT(DEVICES,&,${ITER})}/dial)}')); 3957 3956 if ($chan_dahdi) { 3958 $ext->add($mcontext,$exten,'', new ext_gosubif('$["${ASTCHANDAHDI}" != ""]','zap2dahdi,1'));3957 $ext->add($mcontext,$exten,'', new ext_gosubif('$["${ASTCHANDAHDI}" = "1"]','zap2dahdi,1')); 3959 3958 } 3960 3959 $ext->add($mcontext,$exten,'', new ext_set('DSTRING', '${DSTRING}${THISDIAL}&'));
