[Asterisk-Users] Manager API !!!!!!!!!

Simon simon at orbital.net
Thu Jan 13 09:56:05 MST 2005


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
-----------------------------------------------




More information about the asterisk-users mailing list