cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
509
Views
0
Helpful
1
Replies

AXLAPI UpdateLine Problem with CSS

Hello everyone,

I have a Problem with my Script in PHP.

I will update callforward with API.

It runs put the Calling Search Space will delete imideatly by running the PHP Skript. I´ve tryed many constalations in my script but nothings run correct.

?php
require_once("include/connect_cucm.inc.php");


$pattern= "\+49" . $_GET['PT'];
$destination= $_GET['DES'];
$destinationempty = "";
$callingSearchSpaceName ="50650758-a276-7052-de87-37944067d9c3";
$routePartitionName="PT_Endgeraete";
$callForwardAll = array("callingSearchSpaceName"=>$callingSearchSpaceName,"destination"=>$destination);
$callForwardAllEmpty = array("callingSearchSpaceName"=>$callingSearchSpaceName,"destination"=>"");

$params = array('sql' => 'select lg.name as LineGroup, d.description As TName, n.dnorpattern, n.fkcallingsearchspace_cfb, dhd.hlog, cfd.cfadestination
      from linegroup as lg
      inner join linegroupnumplanmap as lgmap on lgmap.fklinegroup=lg.pkid inner join  numplan as n on lgmap.fknumplan = n.pkid
      inner join devicenumplanmap as dmap on dmap.fknumplan=n.pkid inner join  device as d on dmap.fkdevice=d.pkid
      inner join callforwarddynamic as cfd on cfd.fknumplan=n.pkid
      inner join devicehlogdynamic as dhd on dhd.fkdevice=d.pkid where n.dnorpattern="' . $pattern . '"');


$response = $client->executeSQLQuery($params);

#$CSS= array("callingSearchSpaceName"=>$LineGroup->fkcallingsearchspace_cfb);

if (empty($LineGroup->cfadestination)) {

$response = $client->updateLine(array("pattern"=>$pattern,"routePartitionName"=>$routePartitionName,"callForwardAll"=>$callForwardAllEmpty));
$response = $client->updateLine(array("pattern"=>$pattern,"routePartitionName"=>$routePartitionName,"callForwardAll"=>$callForwardAll));

}else {

$response = $client->updateLine(array("pattern"=>$pattern,"routePartitionName"=>$routePartitionName,"callForwardAll"=>$callForwardAll));

}
 
?>

First i´ve Search for a cfa.destiniation is set. if is set the code delete the callforwarding and set the new one.

But every time the css will delete too.

Many thanks

1 Reply 1

thedd
Level 1
Level 1

Could you provide the XMl you built to update the Line?

What exactly do you do with:

$response = $client->updateLine(array("pattern"=>$pattern,"routePartitionName"=>$routePartitionName,"callForwardAll"=>$callForwardAll));

Below you find how i built my XML and it works.

I can change every single Call Forward setting with this:

<pattern>$dn</pattern><routePartition>$partition</routePartition>

<callForwardAll>

    <forwardToVoiceMail>f</forwardToVoiceMail>

    <callingSearchSpace/><destination>$cfa</destination>

</callForwardAll>

<callForwardBusy>

    <forwardToVoiceMail>f</forwardToVoiceMail>

    <callingSearchSpace/><destination>$cfb</destination>

</callForwardBusy>

<callForwardBusy>

    <forwardToVoiceMail>f</forwardToVoiceMail>

    <callingSearchSpace/><destination></destination>

</callForwardBusy>

<callForwardBusyInt>

    <forwardToVoiceMail>f</forwardToVoiceMail>

    <callingSearchSpace/><destination>$cfbi</destination>

</callForwardBusyInt>

<callForwardNoAnswer>

    <forwardToVoiceMail>f</forwardToVoiceMail>

    <callingSearchSpace/><destination>$cfna</destination>

<duration>$cfnar</duration></callForwardNoAnswer>

<callForwardNoAnswer>

    <forwardToVoiceMail>f</forwardToVoiceMail>

    <callingSearchSpace/><destination></destination>

<duration>$cfnar</duration></callForwardNoAnswer>

<callForwardNoAnswerInt>

    <forwardToVoiceMail>f</forwardToVoiceMail>

    <callingSearchSpace/><destination>$cfnai</destination>

</callForwardNoAnswerInt>

<callForwardNoCoverage>

    <forwardToVoiceMail>f</forwardToVoiceMail>

    <callingSearchSpace/><destination>$cfnc</destination>

</callForwardNoCoverage>

<callForwardNoCoverageInt>

    <forwardToVoiceMail>f</forwardToVoiceMail>

    <callingSearchSpace/><destination>$cfnci</destination>

</callForwardNoCoverageInt>

<callForwardOnFailure>

    <forwardToVoiceMail>f</forwardToVoiceMail>

    <callingSearchSpace/><destination>$cfcti</destination>

</callForwardOnFailure>

<callForwardNotRegistered>

    <forwardToVoiceMail>f</forwardToVoiceMail>

    <callingSearchSpace/><destination>$cfu</destination>

</callForwardNotRegistered>

<callForwardNotRegisteredInt>

    <forwardToVoiceMail>f</forwardToVoiceMail>

    <callingSearchSpace/><destination>$cfui</destination>

</callForwardNotRegisteredInt>