[Asterisk-Users] astcc: need partial pin code

Benchev bbench at mail.bg
Fri Apr 28 00:17:29 MST 2006


> > [paygo-forward]
> > exten => _1NXXNXXXXXX,1,Set(CALLERID(all)=${CALLING})
> > exten => _1NXXNXXXXXX,2,Playback(pls-hold-while-try)
> > exten => _1NXXNXXXXXX,3,DeadAGI(astcc.agi,${CARDNO},${TEMP},4)
> > exten => _1NXXNXXXXXX,4,Hangup
> > ${CALLING},${CARDNO},${TEMP} are coming from an inbound context
>
> In my case they don't always. If it is an call from my system, local or
> remote phone, I have the caller-id, but if the user call into the system
> via PSTN, than I do not get the caller-id!
You can control then from the dialplan:
[from-pstn] ; full interrogation
exten => 1231231234,1,DeadAGI(astcc-disa.agi)
exten => 1231231234,2,Hangup
[from-internal-outbound]
exten => _1NXXNXXXXXX,1,DeadAGI(astcc.agi,${CALLERIDNUM},${EXTEN},4); or 5
exten => _1NXXNXXXXXX,2,Hangup
> My idea was not  to check if PIN=YES, but the name of the agi.
> if the astcc.agi is used, than treat it as PIN=NO
> if the astcc-disa is used, than treat it as PIN=YES
See above
> I have added in my astcc.agi different rates according to the card number.
> I would need to do this twice! My solution does not need me to make it
> twice.
In the astcc.agi I would use
my $sth = $dbh->prepare("SELECT * FROM routes WHERE " . 
$dbh->quote($number) . " RLIKE pattern ORDER BY LENGTH(pattern) DESC");
I'd create a table routes_special with the same scheme as routes
and put my special prices there.
Then in astcc-disa.agi
my $sth = $dbh->prepare("SELECT * FROM routes_special WHERE " . 
$dbh->quote($number) . " RLIKE pattern ORDER BY LENGTH(pattern) DESC");

Cheers,
Benchev



More information about the asterisk-users mailing list