[Amportal-devel] Moving more things to the AstDB from mysql

ok, this is frustrating. Either sf.net doesn’t like email from my OS X Mail, or this email will get sent 3 times
eventually. Response follows:

On 6-May-06, at 11:48 AM, p_lindheimer wrote:

[quote] I want to kick off another discussion which I create a wiki page
for. Others have discussed this so this would be a good place to
concentrate some discussion. The wiki page I posted is here:


I’ll repeat it hear to kick off and we can discuss it here, and as
appropriate add to the page above:

We should consider moving some more parameters to the AstDB to
better facilitate the development of user portals or the addition
of features in existing portals like ARI. For example, take the
generation of a ringgroup or Follow Me functionality. The guts look
something like this today, depending on the options:

exten => 200,n,Set(CALLERID(name)=${RGPREFIX}${CALLERID(name)})
exten => 200,n,Set(RecordMethod=Group)
exten => 200,n,Macro(record-enable,${MACRO_EXTEN},${RecordMethod})
exten => 200,n,Set(RingGroupMethod=ringall)
exten => 200,n(DIALGRP),Macro(dial,27,${DIAL_OPTIONS},200-7737341234#)
exten => 200,n,Set(RingGroupMethod=)
exten => 200,n,Goto(ext-group,1,1)

By moving several of the settings into the AstDB, the generated
dialplan might look something like the following:

exten => 200,n,Set(CALLERID(name)=${RGPREFIX}${CALLERID(name)})
exten => 200,n,Set(RecordMethod=Group)
exten => 200,n,Macro(record-enable,${MACRO_EXTEN},${RecordMethod})
exten => 200,n,Set(RingGroupMethod=${DB(AMPUSER/200/FOLLOW/RGSTRAT)})
exten => 200,n(DIALGRP),Macro(dial,${DB(AMPUSER/200/FOLLOW/RTIME)},$
exten => 200,n,Set(RingGroupMethod=)
exten => 200,n,Goto(ext-group,1,1)

By doing this, we are in a position to do updates from both FreePBX
but also dynamically or form a portal. The examples in this case
are, PRE (CID prefix), RGSTRAT (ring strategy), RTIME (ring time)
and NUMS (numbers to ring in the apporpirate format). Freepbx would
generate the initial dialplan and store these values (in this
example) in the AstDB instead of in the mysql database. It would of
course fetch them from there as well. Now you could easily add the
ability from within ARI, for example, to change any of these
settings, letting users change their own settings.
Yes, I agree that doing this is a good idea. One thing that I
struggled with when writing the current Device/User stuff is deciding
where to store the options. MySQL is easily modified from the PHP
admin, but it would be slow to access from the dialplan. AstDB is
obviously very quick and light-weight, but the PHP’s need to access
it through the * manager API.

Being cautious, I stored user/device settings in both AstDB and
MySQL. I don’t like this much. AstDB is a good persistent store,
and IMHO there is no need to duplicate these type of settings in
MySQL as well.

One thing I’d like to explore is accessing *'s Berkley DB1 directly
with PHP. A quick google shows that some classes do exist out
there. I’d be interested to see how * behaves when an external
program modifies the DB values.


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo

Amportal-devel mailing list
[email protected]

Post generated using Mail2Forum (http://www.mail2forum.com)