Jump to content

PHP and sesssion CSTA not friend, see my code


Recommended Posts

Dear Friends,


I hope to work my code

This code is in PHP et the socket part was take on wiki.pbxnsip.com


thanks for your help




$pbxnsipdomainip[$db] ="";

$pbxnsipport[$db] ="80";

$pbxnsipdomain[$db] ="test.company.com";




function pbx_soap( $req ) {

global $debug,$pbxnsipdomain,$pbxnsipport,$pbxnsipdomainip,$db;

$dbhandle = fsockopen($pbxnsipdomainip[$db], $pbxnsipport[$db], $errno, $errstr);

if (!$dbhandle) { echo "<font color=red>$errstr ($errno)</font><br>\n"; }


//$request = "POST /soap.xml HTTP/1.0\r\n";

$request .= "Content-Type: text/xml\r\n";

$request .= "Content-Length: " . strlen($req) . "\r\n\r\n";

$request .= $req;



fwrite($dbhandle, $request);

//fwrite($fp, $header.$req);

while (!feof($dbhandle)) { $items .= fgets($dbhandle, 1024);}







function session_csta(){

GLOBAL $pbxServer,$pbxnsipdomain,$db;


$soap='<?xml version="1.0" encoding="UTF-8">

<StartApplicationSession xmlns="http://www.ecma-international.org/standards/ecma-354/appl_session/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


<applicationID>My App</applicationID>


<tns:SessionLoginInfo xmlns:tns="http:// www.pbxnsip.com/schemas/csta/login">


















return ($content);



print (session_csta());



Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...