Ok, you can’t override, all you can really do is copy all of the inbound routes to the _custom config file.
Here’s what I did, maybe it’ll help someone in the future. I wrote a perl script to make these en masse, it just writes to standard output. Capture the stdout and shove it in a file, then put it in extension_custom.con in the ext-did-custom context.
Here’s the script:
# used for mass creation of inbound routes, meant for inclusion in the
# [ext-did-custom] context in extensions_custom.conf
#
# Written by Jason "KodaK" Balicki, April 10th, 2008
# [email protected]
use strict;
use warnings;
use Text::CSV;
use Switch;
# csv file format is:
# did,prefix,areacode,routedest
my $file = 'routelist.csv';
# create the csv instance
my $csv = Text::CSV->new();
open (CSV, "<", $file) or die $!;
while (<CSV>) {
if ($csv->parse($_)) {
# columns should be obvious
my @columns = $csv->fields();
my $did = $columns[0];
my $prefix = $columns[1];
my $areacode = $columns[2];
my $routedest = $columns[3];
# $confdest is the destination in the format required
# by the config files
my $confdest='timeconditions,1,1';
# These are my local time condition names, you may have to change
# up this section to suit your requirements
#
# ORDER MATTERS HERE. Since I'm just doing pattern matching,
# perl will match the WeekdayCalls in KCWeekdayCalls, so my
# quick and dirty solution is to match KCWeekdayCalls first.
# You may want to put some more thought into this.
switch ($routedest) {
case /KCWeekdayCalls/ { $confdest='timeconditions,3,1' }
case /WeekdayCalls/ { $confdest='timeconditions,1,1' }
}
# yeah, yeah, I know I can use EOF, but I started it this way, shut up
print "exten => " . $did . "\/_" . $areacode . "XXXXXXX,1,Set(__FROM_DID=\${EXTEN})\n";
print "exten => " . $did . "\/_" . $areacode . "XXXXXXX,n,Gosub(app-blacklist-check,s,1)\n";
print "exten => " . $did . "\/_" . $areacode . "XXXXXXX,n,GotoIf(\$[ \"\${CALLERID(name)}\" != \"\" ] ?cidok)\n";
print "exten => " . $did . "\/_" . $areacode . "XXXXXXX,n,Set(CALLERID(name)=\${CALLERID(num)})\n";
print "exten => " . $did . "\/_" . $areacode . "XXXXXXX,n(cidok),Noop(CallerID is \${CALLERID(all)})\n";
print "exten => " . $did . "\/_" . $areacode . "XXXXXXX,n,Set(_RGPREFIX=" . $prefix . ":)\n";
print "exten => " . $did . "\/_" . $areacode . "XXXXXXX,n,Set(CALLERID(name)=\${RGPREFIX}\${CALLERID(name)})\n";
print "exten => " . $did . "\/_" . $areacode . "XXXXXXX,n,Goto(" . $confdest . ")\n";
}
}
Yes, it’s quick and dirty.
CSV format is:
did,prefix,areacode,destination
So, example:
2900,STL,314,WeekdayCalls
6670,KC,913,KCWeekdayCalls
Things I could do better: put in some logic to make just DID routes or just CID routes easier.
Hope this helps someone.