@@ -1619,7 +1619,7 @@ |
||
| 1619 | 1619 | function &new_AsteriskManager(): AGI_AsteriskManager { |
| 1620 | 1620 | $this->asm = new AGI_AsteriskManager(null, $this->config['asmanager']); |
| 1621 | 1621 | $this->asm->setPagi($this); |
| 1622 | - $this->config['asmanager'] =& $this->asm->config['asmanager']; |
|
| 1622 | + $this->config['asmanager'] = & $this->asm->config['asmanager']; |
|
| 1623 | 1623 | return $this->asm; |
| 1624 | 1624 | } |
| 1625 | 1625 | |
@@ -1293,9 +1293,10 @@ discard block |
||
| 1293 | 1293 | |
| 1294 | 1294 | // clean up old files |
| 1295 | 1295 | $delete = time() - 2592000; // 1 month |
| 1296 | - foreach (glob($this->config['phpagi']['tempdir'] . DIRECTORY_SEPARATOR . 'text2wav_*') as $file) |
|
| 1297 | - if (filemtime($file) < $delete) { |
|
| 1296 | + foreach (glob($this->config['phpagi']['tempdir'] . DIRECTORY_SEPARATOR . 'text2wav_*') as $file) { |
|
| 1297 | + if (filemtime($file) < $delete) { |
|
| 1298 | 1298 | unlink($file); |
| 1299 | + } |
|
| 1299 | 1300 | } |
| 1300 | 1301 | |
| 1301 | 1302 | return $ret; |
@@ -1344,9 +1345,10 @@ discard block |
||
| 1344 | 1345 | |
| 1345 | 1346 | // clean up old files |
| 1346 | 1347 | $delete = time() - 2592000; // 1 month |
| 1347 | - foreach (glob($this->config['phpagi']['tempdir'] . DIRECTORY_SEPARATOR . 'swift_*') as $file) |
|
| 1348 | - if (filemtime($file) < $delete) { |
|
| 1348 | + foreach (glob($this->config['phpagi']['tempdir'] . DIRECTORY_SEPARATOR . 'swift_*') as $file) { |
|
| 1349 | + if (filemtime($file) < $delete) { |
|
| 1349 | 1350 | unlink($file); |
| 1351 | + } |
|
| 1350 | 1352 | } |
| 1351 | 1353 | |
| 1352 | 1354 | return $ret; |
@@ -1666,9 +1668,11 @@ discard block |
||
| 1666 | 1668 | $ret['code'] = substr($str, 0, 3); |
| 1667 | 1669 | $str = trim(substr($str, 3)); |
| 1668 | 1670 | |
| 1669 | - if ($str[0] == '-') // we have a multiline response! |
|
| 1671 | + if ($str[0] == '-') { |
|
| 1672 | + // we have a multiline response! |
|
| 1670 | 1673 | { |
| 1671 | 1674 | $count = 0; |
| 1675 | + } |
|
| 1672 | 1676 | $str = substr($str, 1) . "\n"; |
| 1673 | 1677 | $line = fgets($this->in, 4096); |
| 1674 | 1678 | while (substr($line, 0, 3) != $ret['code'] && $count < 5) { |
@@ -1684,9 +1688,11 @@ discard block |
||
| 1684 | 1688 | |
| 1685 | 1689 | $ret['result'] = null; |
| 1686 | 1690 | $ret['data'] = ''; |
| 1687 | - if ($ret['code'] != AGIRES_OK) // some sort of error |
|
| 1691 | + if ($ret['code'] != AGIRES_OK) { |
|
| 1692 | + // some sort of error |
|
| 1688 | 1693 | { |
| 1689 | 1694 | $ret['data'] = $str; |
| 1695 | + } |
|
| 1690 | 1696 | $this->conlog(print_r($ret, true)); |
| 1691 | 1697 | } else { // normal AGIRES_OK response |
| 1692 | 1698 | $parse = explode(' ', trim($str)); |