[Freeswitch-users] best FS interface for development

Michael Collins msc at freeswitch.org
Tue Sep 11 22:21:54 MSD 2012


These are all excellent questions. In fact, this is one of the reasons why
Dave Kompel is working on the "10,000 foot view" document that we'll be
publishing, hopefully soon. (Listen to last week's conference
call<http://wiki.freeswitch.org/wiki/FS_weekly_2012_09_05>for more
information.) Hopefully that will help you to mentally separate
things that may be unnecessarily jumbled together in your mind.

Here's an incomplete but hopefully helpful overview.  You can "control"
FreeSWITCH functionality in a few basic ways:
* Controlling call routing (where calls go, i.e. connecting party A to
party B)
* Controlling call actions (what calls actually do, i.e. IVRs)
* Controlling non-dialplan configuration, like users, conferences,
SIP/sofia, etc.

Then you have tools for accomplishing the control above.
* Static XML for everything
* Static XML for some things and dynamic for others (like dialplan,
directory, etc.)
** dialplan uses mod_xml_curl
** dialplan uses mod_httapi
** dialplan uses a scripting language to generate dialplan config
* Dynamic config of everything using mod_xml_curl
* Dynamic config with static "fall back" in case of mod_xml_curl lookup
failure

As a subset of "configuration" you have call control. Technically it can be
part of the FreeSWITCH "configuration" but it doesn't have to be. When I
say "call control" I don't mean "call routing." In this discussion "call
routing" is just getting a call from A to B and "call control" means
interacting with a call, usually with IVR-like functionality. Here are some
options:

Static XML for everything, i.e. XML dialplan for "call routing" and for
"call control"
Static XML for call routing, Lua/Perl/Python dialplan script for "call
control"
Static XML for call routing, socket-based ESL script for "call control"
Static XML for call routing, mod_httapi for "call control"
(You can also do dynamic XML in these cases :)

I hope the above information is useful in breaking things down a bit. So,
when someone says, "How can I control FreeSWITCH?" you understand why we
ask all of these follow up questions.

When someone asks, "What's the best way to do call control?" the correct
answer has been the same since the dawn of time: "It depends." There are
too many variables to give a simple answer. However, here are some rules of
thumb that might help you narrow it down:

* Do simple stuff with XML dialplan (static, dynamic - that's up to you)
* Do more complex logic with a dialplan script (I prefer Lua)
* If you need absolute control of a call leg, and especially if you plan on
bridging that call leg to other calls legs that you wish to control then
avoid dialplan scripts! I prefer ESL in these cases.

Naturally there are other things to consider. For example, would mod_httapi
work for you? Its focus is more narrow than ESL but with that narrower
focus comes less complexity. Maybe that's what you want or need. In any
case, I hope this is good food for thought. I'm sure the substance of this
conversation will make it into the big picture document that we are trying
to create.

-MC


On Tue, Sep 11, 2012 at 9:00 AM, A E G <all.eforums at gmail.com> wrote:

> I like this discussion. Unfortunately I'm too inexperienced to fully
> understand why one method/interface would be used over the other. Is this a
> matter of "inbound" vs "outbound" interfaces? Or is this a matter of taking
> over the control of each call and making all decisions dynamically on
> behalf of FS as opposed to say doing a relatively "static" configuration of
> FS by sending it an XML on the fly to process as opposed to api commands
> over socket as you would in the case of mod_event_socket?
>
> Are they all variations for the same purpose and so the decision to use
> one or the other depends on your application and how it's able to interface
> with FS? or is there also another level of decision where one is clearly
> better/powerful/faster/efficient than the other, and that could infact
> drive the decision for your application development?
>
> Would it fair to compare the functionality and interface offered by
> mod_httapi to that of something like Plivo, in terms of abstraction of the
> most common functions required from FS by simply interacting with commands
> like say, speak, play, record etc? and that this is at a higher level than
> mod_xml_curl?
>
> Thanks (and apologies for the ignorance)
>
> On Mon, Sep 10, 2012 at 1:53 PM, Christopher Rienzo <cmrienzo at gmail.com>wrote:
>
>> Since the things that FS does (transcoding, tone detection, etc) can be
>> CPU intensive, you might want multiple servers to spread the load.  So, you
>> can have a pool of identically-configured FS servers load balanced by
>> something like opensips, with the (typically lighter-weight) application
>> logic handled outside of that pool of servers.  FS here just provides
>> resources for the application to use.
>>
>> In this type of setup, you can pick between an application that actively
>> controls the FS apps to execute (mod_event_socket, mod_erlang_event) or one
>> that feeds FS higher-level scripts to execute on demand (mod_httapi,
>> mod_xml_curl).
>>
>> Chris
>>
>> On Mon, Sep 10, 2012 at 10:32 AM, Brett Clark - Grasshopper <
>> bclark at grasshopper.com> wrote:
>>
>>> Hey Chris,****
>>>
>>> ** **
>>>
>>> Could you explain what you mean by clustering FS?  I get the idea of
>>> clustering, in general, but I what do you mean in this context?****
>>>
>>> ** **
>>>
>>> Thanks!****
>>>
>>> Brett****
>>>
>>> ** **
>>>
>>> ** **
>>>
>>> *From:* freeswitch-users-bounces at lists.freeswitch.org [mailto:
>>> freeswitch-users-bounces at lists.freeswitch.org] *On Behalf Of *Christopher
>>> Rienzo
>>> *Sent:* Friday, September 07, 2012 12:14 PM
>>>
>>> *To:* FreeSWITCH Users Help
>>> *Subject:* Re: [Freeswitch-users] best FS interface for development****
>>>
>>> ** **
>>>
>>> For arbitrarily large and complex systems, I'd keep FreeSWITCH as dumb
>>> as possible so that you can easily cluster them.  So, modules that allow
>>> external control (mod_event_socket, mod_erlang_event, mod_httapi,
>>> mod_xml_curl) are all good choices.
>>>
>>> Event socket is pretty popular; Plivo and Adhearsion both use it.  The
>>> 2600hz guys use mod_erlang_event.  And I've heard of plenty of people that
>>> use mod_xml_curl.
>>>
>>> Chris
>>>
>>>
>>> ****
>>>
>>> On Fri, Sep 7, 2012 at 9:43 AM, Brett Clark - Grasshopper <
>>> bclark at grasshopper.com> wrote:****
>>>
>>> There seems to be at least 4 general ways for customizing FS:****
>>>
>>> - Use the event socket and build an app to interface with it****
>>>
>>> - Use mod lua, or similar, to develop in a particular language****
>>>
>>> - Develop your own ‘module’ to interface directly with the core****
>>>
>>> - Use the XML interface to implement IVR, PBX, and voicemail type
>>> functionality and all the rest.****
>>>
>>>  ****
>>>
>>> How prevalent is each approach in the community?  It seems like everyone
>>> is doing a little of both, but maybe someone has a better handle of what
>>> the actual ratios are?  ****
>>>
>>>  ****
>>>
>>> Which is best suited for an arbitrarily large and complex application?
>>> I realize this isn’t a simple question—what I want is to understand the
>>> most evolved and featureful way to interface with FS?  I don’t want to
>>> adopt an approach which isn’t being actively maintained or is missing
>>> features.  As new stuff is added to FS, which approach will allow me to
>>> adopt those new features most easily?****
>>>
>>>  ****
>>>
>>> Thanks!
>>> Brett****
>>>
>>>  ****
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> 
>>> 
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://wiki.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>>
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> 
>> 
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>


-- 
Michael S Collins
Twitter: @mercutioviz
http://www.FreeSWITCH.org
http://www.ClueCon.com
http://www.OSTAG.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120911/e8dd467d/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list