cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2015
Views
0
Helpful
13
Replies

Associate a device with a DN using AXL API

laithabbas0
Level 1
Level 1

Hi guys,

I am trying to add a DN to an existing phone device using AXL API via Java. I keep getting this error:

Devices can only be associated with DNs, Route Patterns and Hunt Pilots.

I have two existing lines on this device which I added through call manager, but now I am trying to add a third one using AXL API. This is what I did to get this error and I am not sure why:

XDirn dn = new XDirn();

dn.setPattern("6340");

XPhoneLine phoneLine = new XPhoneLine();

phoneLine.setDirn(dn);

phoneLine.setAsciiLabel("TESTING - 6340");

phoneLine.setDisplay("TESTING - 6340");

phoneLine.setDisplayAscii("TESTING - 6340");

phoneLine.setLabel("TESTING - 6340");

phoneLine.setBusyTrigger("2");

phoneLine.setIndex("3");

phoneLine.setMaxNumCalls("4");

UpdatePhoneReq updatePhone = new UpdatePhoneReq();

updatePhone.setName("SEPD824BDBBCAF1");

UpdatePhoneReq.Lines newLine =  new UpdatePhoneReq.Lines();

newLine.getLine().add(phoneLine);

updatePhone.setLines(newLine);

port.updatePhone(updatePhone);

the error occurs at the last line when I try to push the update.

Thanks



13 Replies 13

paolo bevilacqua
Hall of Fame
Hall of Fame

It would be better to post API question on the appropriate forums of developers.cisco.com

Gergely Szabo
VIP Alumni
VIP Alumni

Also, can you paste the exception to here.

G.

I managed to get rid of the exception by taking out this line

newLine.getLine().add(phoneLine);

but I also told it that I want to add at index "3" and it just deleted my first two lines and it did not add anything!

What's the difference between RPhone and XPhone?

Check the phone button template. How many lines do you see there.

G.

laithabbas0
Level 1
Level 1

There are many in there since I am working on a test alb that is backed up from the real thing.

I might just do it the hard way by sending the database sql commands and studying the data dictionary.

I can't beleive this API's poor documentation!

Hi,

please don't use SQL there. AXL was created to hide the internals of the CUCM. Just imagine, what if Cisco changes the database tables. Or they add a constraint so you actually update something in one table but you don't do it in another. AXL gives you a configuration layer regardless of the underlying tables so you shoud stick to using it.

G.

laithabbas0
Level 1
Level 1

I agree with you, but I can't spend more time trying to get the API to work. I am basically guessing what I need to call and I keep debugging everything to see what kind of information is returned.

I hope somebody from cisco's staff sees this and start working on a proper documentation.

laithabbas0
Level 1
Level 1

I just tried to execute SQL commands through the API and that is not working well either. The Axlsoaptoolkit.java file works fine but not through the API. this what I have done:

ExecuteSQLQueryReq sqlReq = new ExecuteSQLQueryReq();

sqlReq.setSql("select * from device");

ExecuteSQLQueryRes sqlRes = port.executeSQLQuery(sqlReq);

System.out.println(sqlRes.getReturn().getRow().get(0));

System.out.println(sqlRes.getReturn().getRow().get(1));

System.out.println(sqlRes.getReturn().getRow().get(2));

This returns null on the first 3 rows where I have more than a 1500 entries in that table. I verified using the Axlsoaptoolkit.java app

Hi,

can you tell me the exact CUCM version you are trying to work with.

I want to prove you that AXL is not complicated, in fact, can be fun.

G.

laithabbas0
Level 1
Level 1

I am hoping that you would.

I am using 9.1

Hi,

oh, I see. I don't have that version yet, but I asked my Cisco contact. By the end of the week, I will have it.

In the meantime, I will try what I have (most likely 7.0, 8.0 or 8.5).

G.

laithabbas0
Level 1
Level 1

Sounds good, I started building my application top-to-bottom, if you can figure it out I will use the API otherwise I'll just do it using the database.

What I posted above have not been changed between 8.5 and 9.1.

btw what is the difference betwen Xphone and RPhone?

Alright.

Please, double check the phone button template of the phone you are working on. Adding a third line on a phone with no third line is a no-no.

The difference between XPhone and RPhone:

http://developer.cisco.com/axl/Files/AXLSoap_XPhone.html#LinkE5F

http://developer.cisco.com/axl/Files/AXLSoap_RPhone.html#LinkB80

Looks like they are both the representation of a phone, but each element is used by a different method (the methods are listed there).

G.