[Freeswitch-users] Please give suggestion on determining if a DTMF is valid

Pete Kay petedao at gmail.com
Mon Apr 21 04:47:39 PDT 2008


Hi,

I have a need to extra a list of valid DTMF input from DB ( as it may
sometimes chang).  The way I would do it is to extract the list of valid
DTMF from DB before session.answer().  When the caller enters the DTMF when
the menu is played, I need to search to see if the input is within the the
resultset.  There are few ways that I can think of:

Option 1: Do a search query whenever the user enter the DTMF to check if it
is valide.

Option 2: Traverse the resultset (setting cursor to beginning of the
resultset) to see if the entered DTMF exists or not.

Option 3: Store the entire resultset into a hash table before playing the
menu.

>From the performance perspective, which one is better?  Is there a better
way to do it?

The problem is that I am already experience some delay when doing the first
DB call to get the entire list of valid DTMF from DB.  I just think further
delay is not good.

Is there any good way to search for an element within a resultset?

Thank you in advance for your input.

Regards,
Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080421/bf56622c/attachment-0002.html 


More information about the FreeSWITCH-users mailing list