Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Does anyone have documentation or tooling to help migrate from a config file based asterisk deployment to a database deployment?

share|improve this question

2 Answers 2

I don't have an automated migration script, but the gist is that you make with an extconfig.conf file that maps a traditional config file name to a table name (and set of MySQL or ODBC/DB credentials), and then a set of tables with slightly normalized (but nearly line-for-line) equivalents to what would be in a local config file. http://www.voip-info.org/wiki/view/Asterisk+RealTime has more.

Another way to do realtime database-backed call routing is using AGI or Fast AGI. We recommend AGI to our Asterisk hosting customers because it decouples call routing logic from phone/PBX functionality, something that's not at all true with an Asterisk dialplan (Asterisk RealTime or not). Your dialplan then uses the AGI command (with an agi:// URL) instead of calling embedded dialplan commands.

That also lets you write the call logic/routing in whatever programming language does the job best, which is rarely AEL. help.cloudvox.com has a bunch more AGI docs.

Troy

share|improve this answer

I was looking for the same thing and ended up writing my own quick and dirty script using Asterisk::config modules from CPAN, hope it saves sometime of somebody else:

#!/usr/bin/perl
use Asterisk::config;

my $rc = new Asterisk::config(file=>$ARGV[0]);
my $cols="";
my $vals="";


$parsed = $rc->fetch_sections_hashref();

foreach my $sec (sort keys %{$parsed})
{
    $cols="name";
    $vals="'$sec'";
    while ( my ($c, $v) = each(%{$parsed->{$sec}}) )
    {
        $cols.= ",$c";
        $vals.= ",'".join(',',@{$v})."'";
    }
    print "insert into mytable($cols) values($vals);\n";
}
print "\n\n";
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.