06-09-2003 07:48 AM - edited 03-13-2019 12:14 AM
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
06-12-2003 06:09 AM
What version of callmanager are you developing against?
06-12-2003 06:26 AM
Call Manager version 3.2
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: