cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
360
Views
0
Helpful
2
Replies

Help Needed--Extension Mobility API

shyamalbhowmik
Level 1
Level 1

I have written a small perl script to make a query to the Call Manager for finding out the MAC address using User-Device Query to find out the Device to which the user is currently logged in.

#!/usr/local/bin/perl

use LWP::UserAgent;

use URI;

$xml1=qq(<?xml version="1.0"?>\n);

$xml2=qq(<!DOCTYPE query SYSTEM "http://<serverip>/LoginService/LoginQuery.dtd">\n);

$xml3="<query>\n<appInfo>\n<appID>administrator</appID>\n<appCertificate>####</appCertificate>\n</appInfo>\n<userDevicesQuery>\n<userID>shyamalb</userID>\n</userDevicesQuery>\n</query>";

$xml=$xml1.$xml2.$xml3;

print $xml,"\n";

$ua = LWP::UserAgent->new;

$POSTURL = "http://<serverip>/LoginService/query.asp";

# Translate non-alpha chars into hex

$xml = URI::Escape::uri_escape("$xml");

my $request = new HTTP::Request POST => "$POSTURL";

#$request->authorization_basic($USER, $PASSWORD);

$request->content("xml=$xml");

my $response = $ua->request($request); # Send the POST

print $response->content;

When i run this script it gives an error as follows

<error code="0">SAX Parsing Error: The markup in the document preceding the root

element must be well-formed.

</error>

can anyone tell me where my script is going wrong?

Any help will be highly appreciated.

Thanks and regards

Shyamal

2 Replies 2

jshepard
Level 4
Level 4

What version of callmanager are you developing against?

Call Manager version 3.2