I am using the PHP Client Library for Switchvox Extend. I correctly send the requests and Switchvox correctly executes the request.
But the response is not parsed as an XML document.
Below you can see the request issued:
- Code: Select all
<?php
require_once("SwitchvoxRequest.php");
$request = new SwitchvoxRequest("10.10.10.10", "admin", "admin");
$requestParams = array( 'dial_first' => array ('801'), 'dial_second' => array ('00XXXXXXXXXXXX'), 'dial_as_account_id' => array ('1101') );
$response = $request->send("switchvox.call", $requestParams);
print_r($response);
?>
And the response it is parsed as below:
- Code: Select all
ArraySwitchvoxResponse Object ( [apiStatus:SwitchvoxResponse:private] => success [apiErrors:SwitchvoxResponse:private] => Array ( ) [apiResult:SwitchvoxResponse:private] => Array ( [call_info] => Array ( [dialed_first] => 801 [dialed_second] => 00XXXXXXXXXXXX [variables] => ) ) [rawXML:SwitchvoxResponse:private] => )
While it should be parsed like this:
- Code: Select all
<response method="switchvox.call">
<result>
<call_info dialed_first="801" dialed_second="00XXXXXXXXXXXX" >
</call_info>
</result>
</response>
Is there any way to correctly parse the response using the PHP API library?
Thank you for your time.
Best regards,
Andi
