cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3409
Views
0
Helpful
11
Replies

Associating a User to a Phone in a bidirectional manner

AR7
Level 1
Level 1

I am using Python to automate the User Device association, what I have achieved is making an association of device to a User using the following call:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">  
        <SOAP-ENV:Body>    
          <axl:updateUser xmlns:axl="http://www.cisco.com/AXL/API/1.0" sequence="12055">         
            <userid>ar</userid>         
           <associatedDevices>
              <device>SEP12334555D455</device>      
            </associatedDevices>    
          </axl:updateUser >
          </SOAP-ENV:Body>
        </SOAP-ENV:Envelope>

But now what I want to achieve is the association UserID in a Phone. is this possible with a single API call? What might the syntax of the XML be?

11 Replies 11

dstaudt
Cisco Employee
Cisco Employee

If you're referring to the 'Owner User ID' field in the phone config, this can be updated via <updatePhone> and the <ownerUserId> element.  Note that the user->device association and the Owner User ID field are used for somewhat different purposes (the latter is mainly an indicator for licensing.)

Want a clarification, when we do a user-device association using updateUser tag, the ownerid, in the Phone config is not set, will a call to UpdatePhone and updating the ownerid complete the process of association.

I am using the following call to associate the OwnerId in a Phone Config and change the Owner from anonymous to user. I am using Python to run the code, it's showing successful updation, but the changes are not reflected in the Call Manager. is there anything I am doing wrong:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">  
<SOAP-ENV:Body>    
  <axl:updatePhone xmlns:axl="http://www.cisco.com/AXL/API/1.0" sequence="12055">         
    <ownerUserId>john.doe</ownerUserId>
    <owner>User</owner>
    <name>SEP987654321098</name>
    
  </axl:updatePhone>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Hi,

The value of ownerUserId is uuid, not the name

I changed it as follows

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<axl:updatePhone xmlns:axl="http://www.cisco.com/AXL/API/1.0" sequence="12055">
<ownerUserId>User's Uuid</ownerUserId>
</axl:updatePhone>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

You need to get uuid of john.doe as in your sample.

 

Hope it would help you.

 

Regards,

T Doan

 

I am not able to get the uuid for my user, when I run the query select * from enduser where userid="john.doe".
Is uuid automatically assigned, or we have to feed it manually when adding a user.

Hi,

The uuid will be created automatically after adding a new user.

I used getUser to get the user's details as shown below

//

....

<ns:getUser sequence="1">
<userid>Agent001</userid>
<returnedTags><firstName/><lastName/><userid/>
</returnedTags>
</ns:getUser>

....

//getUserResponse

 

<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:getUserResponse xmlns:ns="http://www.cisco.com/AXL/API/10.0">
<return>
<user uuid="{33CF90D3-7E96-A544-7995-426828546118}">
<firstName>Jane</firstName>
<lastName>Doe</lastName>
<userid>Agent001</userid>
</user>
</return>
</ns:getUserResponse>
</soapenv:Body>
</soapenv:Envelope>

//

uuid is {33CF90D3-7E96-A544-7995-426828546118}. You will use this uuid for updatePhone.

 

Regards,

TDoan

 

Thanks for the reply. I was able to retrieve the uuid of the user using the syntax you sent earlier. But when I am running the following code, its still not updating in the Call manager. Is there something else, I am missing in the syntax.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">  
<SOAP-ENV:Body>    
  <axl:updatePhone xmlns:axl="http://www.cisco.com/AXL/API/1.0" sequence="12055">         
    <ownerUserId>5D32F080-AC28-294E-39E1-8EB80542667E</ownerUserId>
    <name>SEP987654321098</name>
    
  </axl:updatePhone>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Hi,

Yes. Please change ownUserId to ownerUserName as follow.

.... 

<ownerUserName>

    <uuid>{5D32F080-AC28-294E-39E1-8EB80542667E}</uuid>

</ownerUserName>

.... 

Regards,

TDoan

After Updating my XML below:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">  
<SOAP-ENV:Body>    
  <axl:updatePhone xmlns:axl="http://www.cisco.com/AXL/API/1.0" sequence="12055">         
    <ownerUserName>
    <uuid>{B2A75DFC-F05E-E12D-A820-164E4D9870A4}</uuid>
    
    </ownerUserName>
    <name>SEPE8B7480316D6</name>
    
  </axl:updatePhone>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I am getting the Error Message 

Item not valid: The specified User Id was not found 

The user is there in the CUCM, but this error message keeps coming, hope this time I am getting the syntax right. 

As a possible solution to my question, my problem got solved when I used the following syntax:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">  
<SOAP-ENV:Body>    
  <axl:updatePhone xmlns:axl="http://www.cisco.com/AXL/API/12.0" sequence="12055">         
    <ownerUserName>john.doe1</ownerUserName>
    <uuid>{2B46E9DC-D511-B47B-F1BF-27FB6DAC1ECE}</uuid>
    
  </axl:updatePhone>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

TDoan
Level 1
Level 1

Hi,

Would you like to display the UserID on the handset (Phone)?

 

If you want to show the Name on the handset, then you can use updatePhone (lines -> line -> label, lines -> line -> display) and updateLine (alertingName, asciiAlertingName). And if not you can use updatePhone (ownerUserName - uuid) to update uuid of user as well.

 

Hope it would help you.

 

Regards,

Thuy Doan