[Asterisk-Users] astcc: need partial pin code

Benchev bbench at mail.bg
Thu Apr 27 13:25:43 MST 2006


> >> Just to give you an idea
> >> I would suggest you to make two .agi files:
> >> astcc.agi and astcc-disa.agi
> >> In astcc.agi you'd leave everithing as it is, and enable
> >> PIN =YES through the astcc-admin.cgi.
> >> Thus you could dial without interogation:
> >> exten => _1NXXNXXXXXX,1,DeadAGI(astcc.agi,${CALLERIDNUM},${EXTEN},4)
> >>
> >> astcc-disa.agi is a copy of astcc.agi so
> >> # cp astcc.agi astcc-disa.agi.
> >> # pico astcc-disa.agi.
> >
> > pico astcc.agi.
> >
> >> Find the line:
> >> # At this point we have a valid card number.
> >> and coment out everything until:
> >> # At this point we have a valid card and pin number.
> >> You can dial from outside:
> >> exten => 1234567894,1,DeadAGI(astcc-disa.agi)
> >> and will de asked for cardnumber and pin.
> >>
> >> Some mobile phones support "w" inside of a dialstring i.e.
> >> 1234567894w123456789012#w159753# .Fist part is the
> >> DID you dial to enter * .
> >> * asks for a cardnumber and the mobile waits for you on "w"
> >> to push"Enter",
> >> * asks for a pin and phone waits for you on "w" to push "Enter"
> >> for the last string.
> >> After all that you would here:Please enter the number you wish to
> >> dial...
>
> How about this solution:
>
> 1. we make a sym link   instead of a copy. That avoids later update
> problems!!!
> ln -s astcc.agi astcc-disa.agi
>
> 2. instead of
> if ($config{'pinstatus'} eq "YES") {
>
> (please help me to write it, but what I want is:)
> if ("my called name is 'astcc-disa' ") {
Hi,
astcc is such a neat and stable piece that I would hardly dare to
to mess with it. 
My idea was 1) you need a PIN=YES because otherwise pins are 
not generated; 2)you need a PIN because most of the guys
use CALLERIDNUM as cardnumber, and that's open to see. I think it was JP Carballo suggested earlier to authenticate against another variable i.e.
as I do in one system of ours:
[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
and are set to show the person the call is forwarded to , who actually
is calling and NOT his own cardnumber, as well as to charge the appropriate CARDNO etc. But, briefly, that way you could skip usage of pins.
Although, PINS are good thing.
Excuse me, I am not playing clever, I just don't quite understand what you
wanted to do, so I am giving max information I can(maybe redundant)
hoping for an accidental hit. 
3)I think even if you use quiet=5 i.e.(astcc.agi,${CARDNO},${TEMP},5)
a PIN will be expected(if PIN=YES). That's way a soft link won't work 
because you need to comment out the pin validation snippet in your
inner .agi and leave it for you "disa" .agi

Out of curiosity to see what DBI is doing behind the scene:
I started: asterisk -vvvvgc
Found sub connect_db() in astcc.agi and change it to:
sub connect_db() {
	my $dsn = "DBI:mysql:database=$config{'dbname'};host=$config{'dbhost'}";
	$dbh->disconnect if $dbh;
	$dbh = DBI->connect($dsn, $config{'dbuser'}, $config{'dbpass'});
	$dbh -> trace(3, 'dbitrace.log' ); # this is the only change
}
Then I did cat dbitrace.log (the same directory I started
asterisk) and saw very interesting things. 

Hope I'm not waisting your time with already know  things, but I love to
discuss about asterisk :-)

Benchev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060427/b721e57f/attachment.htm


More information about the asterisk-users mailing list