[Asterisk-Users] Manager API !!!!!!!!!
Bill Seddon
bill.seddon at lyquidity.com
Thu Jan 13 10:51:02 MST 2005
<< Has anyone had any success with the Manager API ?>>
Yes, lots of success. I think we found that tracking the status of an
extension is the most reliable way to monitor extension state. We do issue
a PeerStatus request at the beginning but that's pretty time and resource
intensive. Since the Manager is going issue status events anyway, we
monitor them and save the resources.
<< The second is anyone know what ActionID is ?>>
Yes, ActionID is a value you can use when issuing a command. It there so
that you can be sure you respond to your own responses not to someone else's
or that you respond to an response instance in the correct way. In a
multi-threaded app you might have several actions outstanding so you will
need to know what response corresponds to which command.
Bill Seddon
-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Simon
Sent: January 13, 2005 4:56 PM
To: asterisk-users at lists.digium.com
Subject: [Asterisk-Users] Manager API !!!!!!!!!
Hello all
Has anyone had any success with the Manager API ?
I am trying to check an extension status without too much luck I have
the following
<?php
$fp = fsockopen("127.0.0.1", 5038, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "Action: Login\r\n";
$out .= "UserName: simon\r\n";
$out .= "Secret: xxxxxx\r\n\r\n";
fwrite($fp, $out);
$in = "Action: ExtensionState\r\n";
$in .= "Exten: 4367\r\n\r\n";
$in .= "Context: office\r\n\r\n";
$in .= "ActionID: \r\n\r\n";
$in .= "Action: Logoff\r\n\r\n";
fwrite($fp,$in);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>
The first prob is it ignores the Context and just goes to default.
The second is anyone know what ActionID is ?
Best Regards
Simon
-----------------------------------------------
This message has been scanned for viruses and
dangerous content by OrbitalNet, and is
believed to be clean. If you have any concerns
with this message please email us,
support at orbital.net / http://www.orbital.net
-----------------------------------------------
_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
More information about the asterisk-users
mailing list