#!/usr/local/bin/perl
use CGI;
use Data::Dumper;

my $cgi = new CGI;

foreach my $c ($cgi->param()) {
  $F{$c} = $cgi->param($c);
}

open(O, ">>tmp.txt");
print O Dumper \%F;
close(O);

print qq#Content-Type: text/plain\n\n<?xml version="1.0"?>#;

if ($F{key_value} ne "post_load_modules.conf") {
  print qq#
<document type="freeswitch/xml">
  <section name="result">
    <result status="not found"/>
  </section>
</document>#;
  exit;
}

print qq#
<document type="freeswitch/xml">
  <section name="configuration">
    <configuration name="post_load_modules.conf" description="Modules">
      <modules>
        <load module="mod_dingaling"/>
      </modules>
    </configuration>
  </section>
</document>
#;