diff --git a/phpagi-asmanager.php b/phpagi-asmanager.php index 5f0382b..484c951 100644 --- a/phpagi-asmanager.php +++ b/phpagi-asmanager.php @@ -97,6 +97,11 @@ class AGI_AsteriskManager * @var boolean */ private $_logged_in = FALSE; + + public function setPagi(&$agi) + { + $this->pagi = $agi; + } /** * Constructor @@ -104,7 +109,7 @@ class AGI_AsteriskManager * @param string $config is the name of the config file to parse or a parent agi from which to read the config * @param array $optconfig is an array of configuration vars and vals, stuffed into $this->config['asmanager'] */ - function AGI_AsteriskManager($config=NULL, $optconfig=array()) + function __construct($config=NULL, $optconfig=array()) { // load config if(!is_null($config) && file_exists($config)) diff --git a/phpagi.php b/phpagi.php index 6d09c37..25468df 100644 --- a/phpagi.php +++ b/phpagi.php @@ -1550,7 +1550,7 @@ function say_punctuation($text, $escape_digits='', $frequency=8000) function &new_AsteriskManager() { $this->asm = new AGI_AsteriskManager(NULL, $this->config['asmanager']); - $this->asm->pagi =& $this; + $this->asm->setPagi($this); $this->config['asmanager'] =& $this->asm->config['asmanager']; return $this->asm; }