Jump to content

PHP and sesssion CSTA not friend, see my code


antoine
 Share

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

 

<?

$db="test";

$pbxnsipdomainip[$db] ="192.168.1.5";

$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);}

fclose($dbhandle);

 

return($item);

 

}

 

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

<applicationInfo>

<applicationID>My App</applicationID>

<applicationSpecificInfo>

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

<tns:userName>40</tns:userName>

<tns:password>1234</tns:password>

<tns:domain>test.company.com</tns:domain>

<tns:sessionCleanupDelay>60</tns:sessionCleanupDelay>

</tns:SessionLoginInfo>

</applicationSpecificInfo>

</applicationInfo>

<requestedProtocolVersions>

<protocolVersion>http://www.ecma-international.org/standards/ecma-323/csta/ed3</protocolVersion>

<protocolVersion>http://www.ecma-international.org/standards/ecma-323/csta/ed4</protocolVersion>

<protocolVersion>http://www.ecma-international.org/standards/ecma-323/csta/ed5</protocolVersion>

</requestedProtocolVersions>

<requestedSessionDuration>180</requestedSessionDuration>

</StartApplicationSession>

';

 

$content=pbx_soap($soap);

return ($content);

 

}

print (session_csta());

?>

csta.php

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.

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

 Share

×
×
  • Create New...