Blogs

Check out the new content on the Cisco Developer Network reflecting the New & Enhanced features in Cisco Unified Communication Manager 9.1.

See the 9.1 XML Developer Guide ...Read More

 

The Unified Communications 9.0 Partner Bundle packages Cisco’s Collaboration application software for our Collaboration partner community to leverage for their internal lab or demonstration systems. The 9.0 version is now available for order. Learn More >> ...Read More

 

Cisco Routing Rule Developers:

Check out the new content on the Cisco Developer Network reflecting the New & Enhanced features in Cisco Unified Communication Manager 9.0(1).

Click here to find the ...Read More

 

Developer Partners,

Cisco announces the availability of our 2012 Developer Partner presentations shared at CiscoLive San Diego.

Please log into the Cisco Developer Network using your Partner UserID to download this content.

Access these presentations here: http://developer.cisco.com/web/cdc/devforumpreso PARTNER LOGIN REQUIRED
...Read More

 

Developer Partners,

Cisco announces the availability of our 2012 Developer Partner presentations shared at CiscoLive London.

Please log into the Cisco Developer Network using your Partner UserID to download this content.

Access these presentations here: http://developer.cisco.com/web/cdc/devforumpreso PARTNER LOGIN REQUIRED
...Read More

 

Showing 1 - 5 of 16 results.
Items per Page 5
of 4

Forums

« Back to Routing Rules API Questions

Cannot get XACML to parse using PHP

Combination View Flat View Tree View
Threads [ Previous | Next ]
I am unable to get PHP to work with XAXML/ECP profiles. I read a previous post from Stefan and tried to correct my issues using the info in that post but was not successful. I am able to get the python app to work. Would strongly prefer to use PHP.  
 
I simply copied the python message and substitude some hard coded values.
 
//********************
 
$response = '<?xml encoding="UTF-8" version="1.0"?><Response><Result><Decision>Permit</Decision><Status></Status><Obligations><Obligation FulfillOn="Permit" ObligationId="urn:cisco:xacml:policy-attribute"><AttributeAssignment AttributeId="Policy:simplecontinue"><AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">&lt;cixml ver="1.0"&gt;&lt;continue&gt;&lt;modify callingnumber="3688" callednumber="3689"/&gt;&lt;/continue&gt; &lt;/cixml&gt;</AttributeValue></AttributeAssignment></Obligation></Obligations></Result></Response>';
echo $response;
 
//*************************  
 
 
Here is the wireshark capture of the request/response between my Apache server and the CUCM POST
 
POST /speeddial/ecp.php HTTP/1.1

Host: *****:8090

Accept: */*

Content-type: text/xml; charset=ISO-8859-1

methodName: isRoleAccessAllowed

User-Agent: CiscoUCM-HttpClient/1.0

Connection:Keep-Alive

Content-Length: 1682



<?xml version="1.0" encoding="UTF-8"?>
<Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os">
<Subject SubjectCategory="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:role-id"
DataType="http://www.w3.org/2001/XMLSchema#string" Issuer="requestor">
<AttributeValue>CISCO:UC:UCMPolicy</AttributeValue>
</Attribute>
<Attribute AttributeId="urn:Cisco:uc:1.0:callingnumber"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>3654</AttributeValue>
</Attribute>
<Attribute AttributeId="urn:Cisco:uc:1.0:callednumber"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>**63654</AttributeValue>
</Attribute>
<Attribute AttributeId="urn:Cisco:uc:1.0:transformedcgpn"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>3654</AttributeValue>
</Attribute>
<Attribute AttributeId="urn:Cisco:uc:1.0:transformedcdpn"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>6000</AttributeValue>
</Attribute>
</Subject>
<Resource>
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
DataType="http://www.w3.org/2001/XMLSchema#anyURI">
<AttributeValue>CISCO:UCemoticonoiceOrVideoCall</AttributeValue>
</Attribute>
</Resource>
<Action>
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"
DataType="http://www.w3.org/2001/XMLSchema#anyURI">
<AttributeValue>any</AttributeValue>
</Attribute>
</Action>
<Environment>
<Attribute AttributeId="urn:Cisco:uc:1.0:triggerpointtype"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>translationpattern</AttributeValue>
</Attribute>
</Environment>
</Request>
HTTP/1.1 200 OK

Date: Mon, 04 Mar 2013 18:50:56 GMT

Server: Apache

Content-Length: 525

Content-type: text/xml; charset="utf-8"

Keep-Alive: timeout=15, max=100

Connection: Keep-Alive

<?xml encoding="UTF-8" version="1.0"?><Response><Result><Decision>Permit</Decision><Status></Status><Obligations><Obligation FulfillOn="Permit" ObligationId="urn:cisco:xacml:policy-attribute"><AttributeAssignment AttributeId="Policy:simplecontinue"><AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">&lt;cixml ver="1.0"&gt;&lt;continue&gt;&lt;modify callingnumber="3688" callednumber="3689"/&gt;&lt;/continue&gt; &lt;/cixml&gt;</AttributeValue></AttributeAssignment></Obligation></Obligations></Result></Response>HEAD /speeddial/ecp.php HTTP/1.1


//*********
Here is a wireshark for my Python server
 
POST /ecp.py HTTP/1.1

Host: *******:8080

Accept: */*

Content-type: text/xml; charset=ISO-8859-1

methodName: isRoleAccessAllowed

User-Agent: CiscoUCM-HttpClient/1.0

Connection:Keep-Alive

Content-Length: 1682



<?xml version="1.0" encoding="UTF-8"?>
<Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os">
<Subject SubjectCategory="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:role-id"
DataType="http://www.w3.org/2001/XMLSchema#string" Issuer="requestor">
<AttributeValue>CISCO:UC:UCMPolicy</AttributeValue>
</Attribute>
<Attribute AttributeId="urn:Cisco:uc:1.0:callingnumber"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>3654</AttributeValue>
</Attribute>
<Attribute AttributeId="urn:Cisco:uc:1.0:callednumber"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>**53654</AttributeValue>
</Attribute>
<Attribute AttributeId="urn:Cisco:uc:1.0:transformedcgpn"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>3654</AttributeValue>
</Attribute>
<Attribute AttributeId="urn:Cisco:uc:1.0:transformedcdpn"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>6000</AttributeValue>
</Attribute>
</Subject>
<Resource>
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
DataType="http://www.w3.org/2001/XMLSchema#anyURI">
<AttributeValue>CISCO:UCemoticonoiceOrVideoCall</AttributeValue>
</Attribute>
</Resource>
<Action>
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"
DataType="http://www.w3.org/2001/XMLSchema#anyURI">
<AttributeValue>any</AttributeValue>
</Attribute>
</Action>
<Environment>
<Attribute AttributeId="urn:Cisco:uc:1.0:triggerpointtype"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>translationpattern</AttributeValue>
</Attribute>
</Environment>
</Request>
HTTP/1.0 200 OK

Server: BaseHTTP/0.3 Python/2.7.3

Date: Mon, 04 Mar 2013 18:52:17 GMT

Content-type: text/xml; charset="utf-8"

Content-Length: 529

Connection: Keep-Alive

Keep-Alive: timeout = 20000   max = 100



<?xml encoding="UTF-8" version="1.0"?><Response><Result><Decision>Permit</Decision><Status></Status><Obligations><Obligation FulfillOn="Permit" ObligationId="urn:cisco:xacml:policy-attribute"><AttributeAssignment AttributeId="Policy:simplecontinue"><AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">&lt;cixml ver="1.0"&gt;&lt;continue&gt;&lt;modify callingnumber="3688" callednumber="3689"/&gt;&lt;/continue&gt; &lt;/cixml&gt;</AttributeValue></AttributeAssignment></Obligation></Obligations></Result></Response>

The only difference I see in the responses is this "HEAD /speeddial/ecp.php HTTP/1.1". Guessing that this might just be remanent of your pasting.
Are you running Version 8.6 of CUCM? There is a defect (fixed in 9.0 and later) that impacts the changing of the application URL in the ECP profile. It will work when you first configure it, but when you change the URL of the profile, it doesn't get reloaded properly and your application will fail. You can work around it by restarting the CUCM service. You can also try having two profiles (one for the Python and another for the PHP) and switching between them.
There shouldn't be anything inherent in PHP that stops you.

Mark

Collateral


No files available