I did this via the manager interface.

    $man_name  = "managername";
    $man_pword = "secret";

    $socket = fsockopen("127.0.0.1","5038", $errno, $errstr, $timeout);
// open a connection to the manager interface

    fputs($socket, "Action: Login\r\n");                    // login
    fputs($socket, "UserName: $man_name\r\n");                // send
username
    fputs($socket, "Secret: $man_pword\r\n\r\n");                // send
password

    fputs($socket, "Action: Command\r\n");                    // tell it a
command is coming
    fputs($socket, "Command: database show\r\n\r\n");            // ask for
the contents of the database
    fputs($socket, "Action: Logoff\r\n\r\n");                 // logoff

    while (!feof($socket)) {
        $dbentries .= fread($socket, 8192);                // read the
entire output into $dbentries
    }
    fclose($socket);                                // close the socket

    $array = preg_split("/\n/",$dbentries, -1, PREG_SPLIT_NO_EMPTY);    //
split $dbentries on newline characters and store in $array
    for ($i = 1; $i < 7; $i++) {
        array_shift($array);                            // get rid of 7
lines of useless garbage (need a test for this)
    }


On Thu, Apr 10, 2008 at 10:50 AM, Jaime Blaney <[EMAIL PROTECTED]>
wrote:

> Hi,
>
> I'm trying to get access to the Asterisk Database from a web interface
> using php, however I do not want to use the system function for it, my
> question is: Do I need to recompile php to configure it for have access to
> database? How do I do that?
>
> Regards,
>
> Jaime
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
>
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Astlinux-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/astlinux-users
>
> Donations to support AstLinux are graciously accepted via PayPal to
> [EMAIL PROTECTED]
>
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Astlinux-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to [EMAIL 
PROTECTED]

Reply via email to