[Freeswitch-users] Questions on Building an application for FreeSWITCH

Michael Collins msc at freeswitch.org
Tue May 25 11:11:37 PDT 2010


On Tue, May 25, 2010 at 8:40 AM, Phone <phone.bytes at gmail.com> wrote:

> As I mentioned...I am a bit confused now...I guess your reply confirms
> that...sorry...I have been scouring the web to learn what route to
> take...I guess I should stay closer to the source.   I don't mean to ask
> stupid questions...I am just trying to build an app with this great tool
> FreeSWITCH...and it is new to me.
>
It's okay. You just happened to have picked an advanced project for someone
knew to FreeSWITCH and also relatively new to programming.


>
> My understanding is that I will need to use a threaded app. I am checkng
> a DB for pending calls, placing multiple calls
> simultaneously....watching for them to be answered and then take action
> based upon dtmf or other response.  Am I correct that I will use
> threading and events for this?
>
The term "threaded" might be misleading. Yes, a threaded app would probably
work, but depending on your needs it isn't strictly necessary. Perl's POE is
not a "threaded" app but it is an advanced event loop that allows many
things to be happening at once. (Strictly speaking it just quickly switches
between tasks.) You just need things to be asynchronous, aka "non-blocking"
so that your program doesn't do stuff like submit an originate and sit there
for 20 seconds doing nothing else while it waits for the originate to
succeed or fail. (That's why you use "bgapi" like I mentioned before.)


>
> Sounds like perl for a threaded app is not a good idea. I have not
> really got very far threading in perl. I was just wondering if it was a
> viable solution to build from the perl client example by expanding the
> event loop there or if I was way off and should be going a different
> direction.  What do you suggest?
>
We suggest you use ESL and whichever programming language you are most
comfortable with, assuming that you are comfortable with any of those that
support ESL. :)  Perl has POE. Python was Twisted (and the fiorix
framework). C has, of course, the ESL itself.


>
> Thanks again for your help...I will ask smarter questions when I get going.
>
My advice to you is to get out the pencil and paper and sketch this out if
you haven't already done so. Last year at ClueCon Tony talked about the
thinking process that he went through prior to coding a single line of
FreeSWITCH. He went of to a little Zen place and thought things through.
It's much easier to fix things that are broken before you start coding. The
next step for you is to familiarize yourself with the various tools at your
disposal. You have FreeSWITCH, ESL, a scripting language, a database, and
probably some sort of UI to interface with that database. Frankly, FS is the
least of your problems. Oh, and did I mention CDRs? :) You have to do
something with the call results, no? And will people want to know what
happened to all of those calls that were made? (Reporting.) Like Tony says,
make your mistakes while you are thinking things through - they will be much
easier to fix if you haven't started coding yet.

You've taken on an ambitious project. We are not trying to discourage you
from doing it - we just want to make sure that you know what you're getting
into.

-MC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100525/9678ecaf/attachment.html 


More information about the FreeSWITCH-users mailing list