diff --git a/conf/conference.conf.xml b/conf/conference.conf.xml
index a5a3744a14..c5d05dabdb 100644
--- a/conf/conference.conf.xml
+++ b/conf/conference.conf.xml
@@ -1,8 +1,8 @@
-
+
-
+
@@ -29,7 +29,7 @@
-
+
@@ -81,9 +81,9 @@
-
+
-
+
diff --git a/conf/default_context.xml b/conf/default_context.xml
index 3b450196cd..047d2c3637 100644
--- a/conf/default_context.xml
+++ b/conf/default_context.xml
@@ -29,7 +29,7 @@
-
+
@@ -53,7 +53,7 @@
-
+
@@ -67,7 +67,7 @@
-
+
diff --git a/conf/dingaling.conf.xml b/conf/dingaling.conf.xml
index de4f699df3..b7b0ae0fc5 100644
--- a/conf/dingaling.conf.xml
+++ b/conf/dingaling.conf.xml
@@ -8,12 +8,13 @@
-
+
-
+
+
@@ -23,9 +24,6 @@
-
-
-
@@ -37,11 +35,10 @@
-
-
+
-
+
diff --git a/conf/enum.conf.xml b/conf/enum.conf.xml
index db77758e7d..3ac7841aee 100644
--- a/conf/enum.conf.xml
+++ b/conf/enum.conf.xml
@@ -4,8 +4,8 @@
-
+
-
+
diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml
index 0d1fdd128b..2e0027a291 100644
--- a/conf/freeswitch.xml
+++ b/conf/freeswitch.xml
@@ -13,34 +13,115 @@
Don't modify it while freeswitch is running cos it is mem mapped in most cases =D
-->
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -48,6 +129,8 @@
+
+
@@ -66,3 +149,4 @@
+
diff --git a/conf/sofia.conf.xml b/conf/sofia.conf.xml
index 2b78fba146..afcfd6900c 100644
--- a/conf/sofia.conf.xml
+++ b/conf/sofia.conf.xml
@@ -1,6 +1,6 @@
-
+
@@ -28,12 +28,12 @@
-
+
-
-
+
+
@@ -60,9 +60,8 @@
-
-
-
+
+
diff --git a/scripts/combineconf.pl b/scripts/combineconf.pl
new file mode 100644
index 0000000000..3119d50bb9
--- /dev/null
+++ b/scripts/combineconf.pl
@@ -0,0 +1,49 @@
+#!/usr/bin/perl -w
+use strict;
+
+=head1 NAME
+
+combineconf.pl - expand #include PIs in a freeswitch conf file
+
+=head1 SYNOPSIS
+
+ # cd conf
+ # ../scripts/combineconf.pl freeswitch.xml > freeswitch_combined.xml
+
+=head1 DESCRIPTION
+
+This is recursive, and will take multiple input files on the command line.
+
+You need to run it from the working directory that the relative include paths
+except to be resolved from.
+
+=head1 AUTHOR
+
+Mark D. Anderson (mda@discerning.com)
+Released under same terms as Perl, or alternatively the MPL.
+
+=cut
+
+use IO::File;
+
+sub filter_file {
+ my ($f) = @_;
+ my $fh = $f eq '-' ? \*STDIN : IO::File->new($f, 'r');
+ die "ERROR: Can't open $f: $!\n" unless $fh;
+ while(<$fh>) {
+ if (m/