I'm attempting to connect to an Asterisk manager interface, and I'm having a problem with the code blocking, as well as connection persistence. Below is what I have, followed by a description of what's going wrong:
/**
* The parameters for connecting to the server
*/
$params = array('server' => '192.168.1.100', 'port' => '5038');
/**
* Instantiate Asterisk object and connect to server
*/
$ast = new Net_AsteriskManager($params);
/**
* Connect to server
*/
try {
$ast->connect();
} catch (PEAR_Exception $e) {
echo $e;
}
/**
* Login to manager API
*/
try {
$ast->login('admin', 'abcdefghi');
} catch(PEAR_Exception $e) {
echo $e;
}
The above code works, as far as connecting. I'm able to fetch data through it.
The issue is sending a query is taking quite long time, and when I observe the server in realtime mode (console) I see that the user admin is getting log out from server after output is sent.
In other words, 'admin' is getting logged out even though I have not explicitly logged out in the code. How can I make this connection persistent?
And Tim can you please give me your Skype or email address i need to discuss few things with you that may help both of us. – Arham Ali Qureshi Mar 15 '12 at 19:01