<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:12pt;font-family:Bitstream Vera Sans">
<p>> >> Just to give you an idea</p>
<p>> >> I would suggest you to make two .agi files:</p>
<p>> >> astcc.agi and astcc-disa.agi</p>
<p>> >> In astcc.agi you'd leave everithing as it is, and enable</p>
<p>> >> PIN =YES through the astcc-admin.cgi.</p>
<p>> >> Thus you could dial without interogation:</p>
<p>> >> exten => _1NXXNXXXXXX,1,DeadAGI(astcc.agi,${CALLERIDNUM},${EXTEN},4)</p>
<p>> >></p>
<p>> >> astcc-disa.agi is a copy of astcc.agi so</p>
<p>> >> # cp astcc.agi astcc-disa.agi.</p>
<p>> >> # pico astcc-disa.agi.</p>
<p>> ></p>
<p>> > pico astcc.agi.</p>
<p>> ></p>
<p>> >> Find the line:</p>
<p>> >> # At this point we have a valid card number.</p>
<p>> >> and coment out everything until:</p>
<p>> >> # At this point we have a valid card and pin number.</p>
<p>> >> You can dial from outside:</p>
<p>> >> exten => 1234567894,1,DeadAGI(astcc-disa.agi)</p>
<p>> >> and will de asked for cardnumber and pin.</p>
<p>> >></p>
<p>> >> Some mobile phones support "w" inside of a dialstring i.e.</p>
<p>> >> 1234567894w123456789012#w159753# .Fist part is the</p>
<p>> >> DID you dial to enter * .</p>
<p>> >> * asks for a cardnumber and the mobile waits for you on "w"</p>
<p>> >> to push"Enter",</p>
<p>> >> * asks for a pin and phone waits for you on "w" to push "Enter"</p>
<p>> >> for the last string.</p>
<p>> >> After all that you would here:Please enter the number you wish to</p>
<p>> >> dial...</p>
<p>></p>
<p>> How about this solution:</p>
<p>></p>
<p>> 1. we make a sym link instead of a copy. That avoids later update</p>
<p>> problems!!!</p>
<p>> ln -s astcc.agi astcc-disa.agi</p>
<p>></p>
<p>> 2. instead of</p>
<p>> if ($config{'pinstatus'} eq "YES") {</p>
<p>></p>
<p>> (please help me to write it, but what I want is:)</p>
<p>> if ("my called name is 'astcc-disa' ") {</p>
<p>Hi,</p>
<p>astcc is such a neat and stable piece that I would hardly dare to</p>
<p>to mess with it. </p>
<p>My idea was 1) you need a PIN=YES because otherwise pins are </p>
<p>not generated; 2)you need a PIN because most of the guys</p>
<p>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.</p>
<p>as I do in one system of ours:</p>
<p>[paygo-forward]</p>
<p>exten => _1NXXNXXXXXX,1,Set(CALLERID(all)=${CALLING})</p>
<p>exten => _1NXXNXXXXXX,2,Playback(pls-hold-while-try)</p>
<p>exten => _1NXXNXXXXXX,3,DeadAGI(astcc.agi,${CARDNO},${TEMP},4)</p>
<p>exten => _1NXXNXXXXXX,4,Hangup</p>
<p>${CALLING},${CARDNO},${TEMP} are coming from an inbound context</p>
<p>and are set to show the person the call is forwarded to , who actually</p>
<p>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.</p>
<p>Although, PINS are good thing.</p>
<p>Excuse me, I am not playing clever, I just don't quite understand what you</p>
<p>wanted to do, so I am giving max information I can(maybe redundant)</p>
<p>hoping for an accidental hit. </p>
<p>3)I think even if you use quiet=5 i.e.(astcc.agi,${CARDNO},${TEMP},5)</p>
<p>a PIN will be expected(if PIN=YES). That's way a soft link won't work </p>
<p>because you need to comment out the pin validation snippet in your</p>
<p>inner .agi and leave it for you "disa" .agi</p>
<p></p>
<p>Out of curiosity to see what DBI is doing behind the scene:</p>
<p>I started: asterisk -vvvvgc</p>
<p>Found sub connect_db() in astcc.agi and change it to:</p>
<p>sub connect_db() {</p>
<p>        my $dsn = "DBI:mysql:database=$config{'dbname'};host=$config{'dbhost'}";</p>
<p>        $dbh->disconnect if $dbh;</p>
<p>        $dbh = DBI->connect($dsn, $config{'dbuser'}, $config{'dbpass'});</p>
<p>        $dbh -> trace(3, 'dbitrace.log' ); # this is the only change</p>
<p>}</p>
<p>Then I did cat dbitrace.log (the same directory I started</p>
<p>asterisk) and saw very interesting things. </p>
<p></p>
<p>Hope I'm not waisting your time with already know things, but I love to</p>
<p>discuss about asterisk :-)</p>
<p></p>
<p>Benchev</p>
<p></p>
<p></p>
</body></html>