Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difficulties on how to use. Namespace? #19

Open
Terumi opened this issue Nov 6, 2018 · 1 comment
Open

Difficulties on how to use. Namespace? #19

Terumi opened this issue Nov 6, 2018 · 1 comment

Comments

@Terumi
Copy link

Terumi commented Nov 6, 2018

Hello people.
I'm trying to use this project (having loaded through composer) but I cannot reference the classes properly as they do not have a namespace. I'm I doing something wrong?

@Warmbellycat
Copy link

Hello @Terumi!
Just use:

require_once './vendor/autoload.php';
$agi = new \Agi($yourConfigFileName);
//or $agi = new \Agi(null, $configArray);
//or $ami = new \AGI_AsteriskManager($yourConfigFileNam);
//or $ami = new \AGI_AsteriskManager(null, $configArray);

You can find configuration file example in phpagi/docs folder. If you want to use configuration array - parameters must have same names as in config file.

$configArray = [
    'server'=>'hostname or ip of your asterisk server', 
    'port'=>5038, /*asterisk manager port, integer*/
    'username'=>'your_asterisk_manager_username',
    'secret'=>'your_asterisk_manager_password'
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants