Strange issue with XMLin in asterisk agi script

Hi,

Im facing a strange problem while using XML::Simple module of Perl.

I am writing an Asterisk AGI script in perl where i am calling a function someSub() which uses curl to fetch XML from a cgi page into a variable $xmlstream.

I then use XMLin on $xmlstream. The code is something as shown below :

[code]
$xmlstream = someSub() ; #uses curl to fetch xml from a cgi page

$xmldata = XMLin($xmlstream, forcearray => 1, suppressempty => '');[/code]

This works . But,now later on in my program again, when i use the above two lines to fetch new data, the AGI script suddently terminates , while executing the 2nd line.

What could be the cause of this bug ?. Any help would be really appreciated.

Thank You

AGI uses STDIO/STDERR for it’s comm channels. Maybe your PERL script is throwing an error and writing to STDERR?

I would be on AGI DEBUG at the asterisk CLI

I would recommend using FastAGI for any AGI stuff.

voip-info.org/wiki/view/Asterisk+FastAGI