Eric, Do you really need a database to handle this? If the call volume is not extraordinarily high, how about something simple, for example...
Create an AGI... (see example: http://lonnie.abelbeck.com/astlinux/cnam-fix.agi.txt ) exten => s,n,AGI(db.agi) A code snippet of the bash AGI... -- db_time="$(grep "~${agi_callerid}$" /mnt/kd/db_file | tail -n1 | cut -d'~' -f1)" cur_time="$(date +%s)" timeout=180 # acceptable time in seconds since last call if [ -n "$db_time" ]; then if [ $(( $cur_time - $db_time )) -lt $timeout ]; then # politely hangup exit 0 fi fi # no action, add entry in db_file echo "${cur_time}~${agi_callerid}" >> /mnt/kd/db_file exit 0 -- The db_file will need to be trimmed on a regular basis. Lonnie PS: This code snippet is off the top of my head, not tested. On Jan 1, 2011, at 7:15 PM, Eric Kowalewski wrote: > Darrick, > > Without mysql I am faced with a dilemma. Maybe I just need a > paradigm shift. What I want to do is write something that detects if a > caller has called within the last few minutes and if so, send them right to > voicemail. In our business, in the event that there is a service outage, it > seems that certain customers are just relentless about calling over and over > until they get a person. With cdr_mysql I could just do something like this: > > THIS IS WHERE WE WOULD GRAB THE CALLERID AND SEE IF THEY'VE ALREADY LEFT A > MESSAGE. > exten => > s,1,Set(retVal=${CURL(http://10.255.255.2/asterisk.php?src=${CALLERID(num)})}) > > //retVal of 1 means they've already left a message > //politely hang up on them. > exten => s,2,GotoIf($["${retVal}" = "1"]?alreadyleftamessage|s|1) > > //retVal of 2 means they've called within the last three minutes. > //Send them to voicemail > exten => s,3,GotoIf($["${retVal}" = "2"]?open|s|7) > > Is there a nice astlinux way of doing this? > > Eric > > From: Darrick Hartman [mailto:[email protected]] > Sent: Saturday, January 01, 2011 1:54 PM > To: AstLinux Users Mailing List > Subject: Re: [Astlinux-users] Does Astlinux support cdr_mysql > > In 1.8, cdr_mysql is in the main download. We do not currently build that > because we would need to add some parts of mysql. > > "Eric Kowalewski" <[email protected]> wrote: > > >Hello All, > > > > > > > > Does Astlinux support cdr_mysql? I know the mysql support > >stuff is in the add-ons package. I just what to verify this before I > >spin > >my wheels troubleshooting. > > > > > > > > Thanks, > > > > Eric > > > >------------------------------------------------------------------------------ > >Learn how Oracle Real Application Clusters (RAC) One Node allows > >customers > >to consolidate database storage, standardize their database > >environment, and, > >should the need arise, upgrade to a full multi-node Oracle RAC database > > > >without downtime or disruption > >http://p.sf.net/sfu/oracle-sfdevnl_______________________________________________ > >Astlinux-users mailing list > >[email protected] > >https://lists.sourceforge.net/lists/listinfo/astlinux-users > > > >Donations to support AstLinux are graciously accepted via PayPal to > >[email protected]. > > -- > Sent from my Android phone with K-9 Mail. Please excuse my brevity. > > ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Astlinux-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/astlinux-users > > Donations to support AstLinux are graciously accepted via PayPal to > [email protected]. > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1191 / Virus Database: 1435/3352 - Release Date: 01/01/11 > > ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl_______________________________________________ > Astlinux-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/astlinux-users > > Donations to support AstLinux are graciously accepted via PayPal to > [email protected]. ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Astlinux-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/astlinux-users Donations to support AstLinux are graciously accepted via PayPal to [email protected].
