[Asterisk-Dev] Callingcard - one last question
Terence Parker
terence at parker.com.hk
Fri May 14 08:20:28 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)
-- snip --
> Show application dial
>
> look at option L
>
> bkw
I typed 'show application dial' but didn't see 'L' listed anywhere - perhaps
it was not yet implemented in Asterisk-0.7.2 ?
Anyhow, I have now got it all to work... I didn't realise that the AGI
application run by the 'h' rules would have the extension set to 'h' - so
everyone can ignore what I said in my last e-mail! My script works just the
way I want it to now.... sourcecode to be published soon so that everybody
can tell me what a load of rubbish it is :-)
I do have one last question though regarding variables. Though I have got my
script to work, my current solution of storing the cost for the current call
in the users table seems rather inelegant. Basically I have two tables : one
with the charges for every country, the other with the users. On first run
it's easy to look up the country details (price etc...) and the user
details - but because the actual money deduction is done at hangup time,
it's not till the second run of the script that it needs to know what price
the call is. Problem is at this point - 'agi_extension' becomes 'h', set by
the hangup rules, so finding the right price from country code would be
impossible - therefore I made sure that on the first run the price for the
current call is temporarily stored in the users table.
Surely there is a better way? Can I not have Asterisk store this data as a
variable for that call? I know how to set variables in AGI - but how about
to retrieve them? I only know how to retrieve the basic AGI header
variables.....
Thanks for the help, much appreciated.
Terence
More information about the asterisk-dev
mailing list