[cisco-voip] AXL Set CTI Controlled Device Profile for End User

Anthony Holloway avholloway+cisco-voip at gmail.com
Fri Nov 14 01:13:13 EST 2014


Assuming you mean to use this for End Users, the good news is, CUCM 9.1
through 10.5 has the same functionality for the updateUser request method.

https://developer.cisco.com/site/axl/develop-and-test/documentation/operations-by-release/

I wrote this in PHP for you, and I tested it against my lab system which is
10.0.  If you're writing in a different language, I probably cannot help
you convert this.  My programming language experience is pretty much
limited to PHP and Python.

Happy Coding!

<?php
	
	// Inputs
	$target_user = "aholloway";
	$target_profile = "SomeDeviceProfile";
	
	// SOAP Client
	$client = new SoapClient(
		'C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\projects\axl\AXLAPI.wsdl',
		array(
			'trace'=>true,
			'exceptions'=>true,
			'location'=>"https://10.1.1.10:8443/axl",
			'login'=>'ccmadmin',
			'password'=>'P at ssw0rd!',
			'features'=>SOAP_SINGLE_ELEMENT_ARRAYS
		)
	);
	
	// Query the user to get a list of existing profiles
	try {
		$response = $client->getUser(array(
			"userid" => $target_user
		));
	} catch (Exception $e) {
		die($e->getMessage());
	}
	
	// Iterate over each existing profile, building the input for the update method
	$cti = $response->return->user->ctiControlledDeviceProfiles;
	$profiles = array("profileName" => array());
	if (isset($cti->profileName)) {
		foreach ($cti->profileName as $profile) {
			if ($profile->_ == $target_profile)
				die("Profile exists, stopping.");
			$profiles["profileName"][] = array("_" => $profile->_);
		}
	}
	
	// Add in the new profile to the list of existing profiles
	$profiles["profileName"][] = array("_" => $target_profile);
	
	// Update the user with the new master list of profiles
	try {
		$response = $client->updateUser(array(
			"userid" => $target_user,
			"ctiControlledDeviceProfiles" => $profiles
		));
	} catch (Exception $e) {
		die($e->getMessage());
	}
	?>


On Thu Nov 13 2014 at 1:45:10 PM Reto Gassmann <voip at mrga.ch> wrote:

> Hello Group
>
> we have a UCM 9.1.2 and try to associate a CTI Controlled Device to a User
> with AXL.
> We were able to associate the Extension Mobility Profile and set the
> Default Profile to the user.
> We still use the standard schema, I think thats 7.1.
>
> Has anyone an idea how we could do that?
>
> Thanks a lot
> Regards Reto
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20141114/ca7e2709/attachment.html>


More information about the cisco-voip mailing list