cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
497
Views
0
Helpful
4
Replies

Extension Mobility

john.ettedgui
Level 1
Level 1

Hello, i am new to this world, and i am having pretty much trouble getting the extension mobility work with the CM 4.0 .

I am trying to retrieve the device name used from the user id, but i cannot get it to work.

i have found many urls to post it to get the EM answer, but i do not know which one is the right one.

This is my code for the moment, any help / links appreciated (all i found interesting was this : http://www.cisco.com/en/US/partner/products/sw/voicesw/ps556/products_programming_reference_guide_chapter09186a00801ede59.html)

var result;

var callManager = "10.0.1.15";

var pushUserId = "xxxx";

var pushPassword = "xxxx";

var authstring = text2base64(pushUserId+":"+pushPassword);

// jtapi:cisco

//Extension Mobility : Find the device name associated to the UserID

function ExtensionMobility(UserID){

//Login - Password crypting process with text2base64.asp

//var authstring = text2base64(pushuserid+":"+pushpassword);

//SOAP AXL request buiding for query.asp

var pushxml = "<query><appInfo><appID>"+pushUserId+"</appID><appCertificate>"+pushPassword+"</appCertificate></appInfo><userDevicesQuery><userID>"+UserID+"</userID></userDevicesQuery></query>";

pushxml = "XML=" + Server.URLEncode(pushxml);

//Writing the header and sending of the message

var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

//xmlhttp.Open("POST", "http://"+callManager+"/emapp/EMAppServlet", false);

//xmlhttp.Open("POST", "http://"+callManager+"/LoginService/query.asp",false);

xmlhttp.Open("POST", "http://'+callManager"+/emservice/EMServiceServlet", false);

xmlhttp.setRequestHeader("Authorization", "Basic " + authstring);

xmlhttp.setRequestHeader("Connection", "close");

xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

xmlhttp.Send(pushxml);

//Extracting of the devicename

//In order to optimize the application, XML component objects aren't used

Response.write("Answer: "+xmlhttp.responseText);

var pos = xmlhttp.responseText.indexOf("deviceName>")

if(pos != -1 ){

//Extracting device name : SEP...

var device = xmlhttp.responseText.substr(pos + 11, 15);

return device

}

else return null;

}

Thanks

4 Replies 4

john.ettedgui
Level 1
Level 1

Hello,

when I try to reach this adress http://'+callManager"+/emservice/EMServiceServlet,

i get an apache / tomcat error (HTTP Status 500 - Internal Server Error) if i send something, or if i just try to reach it with IE (i never used tomcat so i really would'nt know, but for the moment i am trying to look at this possibility)..

Maybe something coming from this ?

Thanks,

http://www.cisco.com/en/US/products/sw/voicesw/ps556/products_administration_guide_chapter09186a00801ed113.html

Using the above link, I set up and am currently running Extension Mobility. There was very little programing that had to be done. I download the PDF. At the very least you should be able to see how various things are configured.

Hello,

thanks for the answer i have found my problems.

First the servlet is case sensitive, i used "XML=" that gave me many many errors while "xml=" just works fine.

As i found this, i found some little errors too.

Then i setuped EM with a new device profile, new user device profile and so on, and now everything is smooth.

Thanks for taking time to read me.

John

phampson
Level 1
Level 1

John, you mentioned in your post that you figured this out. I'm currently stumped be the "500" errors as well. I tried the "xml=" but I think I'm still missing something. Was there anything that you found?