[Asterisk-Dev] Callingcard - almost done. Now extensions.conf

Terence Parker terence at parker.com.hk
Thu May 13 17:42:08 MST 2004


I'm finally done with the PHP side of my calling card app - works nicely,
and quite highly configurable/flexible. I've just got a few questions
regarding the actual 'payment deduction' process though.

My extensions.conf (relevant part) is currently :
(actual dial string is pseudo only... bits need chopping off)

exten => _007.,1,Answer
exten => _007.,2,agi,prepaid.php
exten => _007.,3,SetVar(DIAL=${EXTEN})
exten => _007.,4,SetVar(EXTEN=[9999])
exten => _007.,5,Dial(SIP/${DIAL})
exten => _007.,4,Hangup

exten => T,1,Festival("Sorry - but you are out of credit. Your call will be
disconnected");
exten => T,2,Hangup

exten => h,1,agi,prepaid.php
exten => h,2,Hangup

- i'm sure though that this isn't the best way to do things. What I did was
assumed that upon hangup, my AGI would execute again sending the same
variable information that is usually sent - except this time with the
extension set to 9999. Can you even rewrite the extension like that? What I
have currently doesn't work - the PHP script doesn't appear to deduct any
money from my account... perhaps it's not getting the extension as 9999, or
something else is wrong, but I just want to check.

I would have thought a better way would be to create some variables as part
of the dial plan - but when the AGI is executed again, are these variables I
created passed to the PHP script too? Or just the standard bunch?

Any better suggestions on how to achieve this final bit?

Thanks,

Terence





More information about the asterisk-dev mailing list