He mate,
I search from log time how to make call faster with mISDN
I use the astcc-agi to call and all is ok if there is few calls and first channels are free but when call have to use last channel from database its very long, I’m not expert with perl but I think if I can try and take random channels with the code it could solve the problem
I have make my DB with mISDN1, mISDN2, mISDN3…
Here is the code
########FIRST it select and store data for a dialsting includig path
sub getphone() {
my ($number) = @_;
my $sth = $dbh->prepare(“SELECT * FROM routes WHERE " . $dbh->quote($number) . " RLIKE concat(’^’, pattern) ORDER BY LENGTH(pattern) DESC”);
$sth->execute;
$res = $sth->fetchrow_hashref;
$sth->finish;
return $res;
}
##########HERE it look on database for trunk information
sub trytrunk() {
my ($trunk, $phone, $maxtime) = @_;
my $sth;
my $res;
my $dialstr;
$sth = $dbh->prepare(“SELECT * FROM trunks WHERE name=” . $dbh->quote($trunk));
$sth->execute;
$res = $sth->fetchrow_hashref;
$sth->finish;
return “CHANUNAVAIL” unless $res;
###########HERE is the dial $res->{path} have informations mISDN1:mISDN2…
if ($res->{tech} eq “mISDN”) {
$dialstr = “mISDN/$res->{path}/$phone|90|HL(” . ($maxtime * 60 * 1000) . “:30000:30000)”;
$res = $AGI->exec(“DIAL $dialstr”);
I would like to have $res->{path} with random order mISDN3:mISDN1…
when I dial
If any perl expert here thank’s in advance !