[Freeswitch-users] Which module to use?

Stanislav Sinyagin ssinyagin at gmail.com
Fri Aug 5 11:31:17 MSD 2016


that will work, but keep in mind that your call, including its audio,
will freeze until the HTTP session finishes. So, the server should
answer quickly, and it should be reliable. Also it should sustain a
certain calls-per-second rate (FreeSWITCH has 30cps limit by default,
and it's tunable).



On Fri, Aug 5, 2016 at 7:41 AM, Don Hawkins <hawkins at hawkinsegroup.com> wrote:
> Thanks for your help Stainislav!
>
> I decided to go with the route below, sharing code for those that may run
> across this issue later.
>
> Get notified on certain events via HTTP post:
>
> <!-- Get a CURL post once call starts ringing (media begins) -->
> <execute application=\"export\" data=\"nolocal:execute_on_media=curl
> http://mysite.com/test3.php post
> event=Ringing&amp;\${uuid}&amp;state=\${state}&direction=\${direction}\"></execute>
>
> <!-- Get a CURL post once leg B answers -->
> <execute application=\"export\" data=\"nolocal:execute_on_answer=curl
> http://mysite.com/test3.php post
> event=Answered&amp;\${uuid}&amp;state=\${state}&direction=\${direction}\"></execute>
>
> (remove the \ slashes)
>
> On Thu, Aug 4, 2016 at 5:33 AM, Stanislav Sinyagin <ssinyagin at gmail.com>
> wrote:
>>
>> I think inbound ESL is what will work for you best.
>>
>> Lua scripts can be executed within FreeSWITCH process during the call
>> processing, but they are always synchronous, so your call will wait
>> until the HTTP request is processed.
>>
>>
>>
>> On Thu, Aug 4, 2016 at 11:05 AM, Don Hawkins <hawkins at hawkinsegroup.com>
>> wrote:
>> > Thanks!
>> >
>> > I've looked at ESL and the mod_event_socket but I'm not looking to
>> > control
>> > everything. I do see that it supports outbound so I tried it but it
>> > seems it
>> > won't allow me to just get notified on events but I'll also have to
>> > control
>> > the entire call. In other words, it wont allow JUST outbound.
>> >
>> > Looks like my next option is LUA (which I know nothing about as of yet)
>> > but
>> > it looks like it will allow event hooks. Is this a viable solution in
>> > your
>> > opinion?
>> >
>> > https://wiki.freeswitch.org/wiki/Mod_lua#Event_Hooks
>> >
>> >
>> > On Thu, Aug 4, 2016 at 1:34 AM, Stanislav Sinyagin <ssinyagin at gmail.com>
>> > wrote:
>> >>
>> >> the best approach is to have a separate daemon that connects to
>> >> FreeSWITCH and subscribes to events. Then you can asynchronously
>> >> process these events without affecting the call flow. There are
>> >> actually hundreds of example scripts, just search for keywords:
>> >> freeswitch, esl, event socket
>> >>
>> >> There are also implementations of ESL protocol in many programming
>> >> languages, and you can choose depending on your skills and
>> >> requirements. For example, Golang or Erlang would allow you to spin
>> >> off a new thread every time you need it, and do some background
>> >> processing in parallel. But for many tasks, single-threaded processing
>> >> is enough, so Perl or Python would work fine.
>> >>
>> >> You can also hand the call processing to such an external program --
>> >> for example, the XML dialplan executes park(), and your ESL program
>> >> picks up the control and performs what you need, like IVR, for
>> >> example.
>> >>
>> >>
>> >>
>> >>
>> >> On Thu, Aug 4, 2016 at 7:30 AM, Don Hawkins <hawkins at hawkinsegroup.com>
>> >> wrote:
>> >> > So curl is working fine but I'm unsure (and unable to find any
>> >> > examples)
>> >> > how
>> >> > to execute the curl application on specific events, primarily when
>> >> > the
>> >> > call
>> >> > has been bridged/answered. Can anyone assist?
>> >> >
>> >> > On Wed, Aug 3, 2016 at 11:16 PM, Don Hawkins
>> >> > <hawkins at hawkinsegroup.com>
>> >> > wrote:
>> >> >>
>> >> >> Figured it out, I sure did miss something, thank you for leading me
>> >> >> in
>> >> >> the
>> >> >> right direction.
>> >> >>
>> >> >> <execute application="bind_digit_action"
>> >> >> data="curl,*,exec:curl,http://myurl.com/mypage.cgi post
>> >> >>
>> >> >>
>> >> >> uuid=${uuid}&amp;state=${state}&direction=${direction},aleg,aleg"></execute>
>> >> >>
>> >> >>
>> >> >>
>> >> >> On Wed, Aug 3, 2016 at 10:23 PM, Don Hawkins
>> >> >> <hawkins at hawkinsegroup.com>
>> >> >> wrote:
>> >> >>>
>> >> >>> Thank you Abaci!
>> >> >>>
>> >> >>> I added
>> >> >>>
>> >> >>> <execute application="curl" data="http://myurl.com/whatever.php
>> >> >>> json"></execute>
>> >> >>>
>> >> >>> And it's for sure contacting my URL but it's not sending anything,
>> >> >>> there
>> >> >>> are no values... did I miss something?
>> >> >>>
>> >> >>>
>> >> >>> On Wed, Aug 3, 2016 at 8:09 PM, Abaci B <abaci64 at gmail.com> wrote:
>> >> >>>>
>> >> >>>> https://freeswitch.org/confluence/display/FREESWITCH/mod_curl
>> >> >>>>
>> >> >>>> On Wed, Aug 3, 2016 at 9:03 PM, Don Hawkins
>> >> >>>> <hawkins at hawkinsegroup.com>
>> >> >>>> wrote:
>> >> >>>>>
>> >> >>>>> Care to elaborate? Do you mean mod_xml_curl? I'm already using
>> >> >>>>> that
>> >> >>>>> for
>> >> >>>>> serving configs, don't see it working for this...maybe I'm wrong.
>> >> >>>>>
>> >> >>>>> Sincerely,
>> >> >>>>> Don Hawkins
>> >> >>>>>
>> >> >>>>> Sent from my NationPCS® Nexus 6.
>> >> >>>>>
>> >> >>>>>
>> >> >>>>> On Aug 3, 2016 7:57 PM, "Abaci B" <abaci64 at gmail.com> wrote:
>> >> >>>>>>
>> >> >>>>>> curl
>> >> >>>>>>
>> >> >>>>>> On Wed, Aug 3, 2016 at 8:27 PM, Don Hawkins
>> >> >>>>>> <hawkins at hawkinsegroup.com> wrote:
>> >> >>>>>>>
>> >> >>>>>>> Very simple situation...
>> >> >>>>>>>
>> >> >>>>>>> While on a call I want to press * to post to an external URL, I
>> >> >>>>>>> want
>> >> >>>>>>> to post global variables, ie. UUID.
>> >> >>>>>>>
>> >> >>>>>>> I have this working with httapi:
>> >> >>>>>>>
>> >> >>>>>>> <execute application="bind_digit_action"
>> >> >>>>>>>
>> >> >>>>>>> data="httapi,*,exec:httapi,http://myurl.com,aleg,aleg\"></execute>
>> >> >>>>>>>
>> >> >>>>>>> Only problem is, httapi expects XML to be returned and I don't
>> >> >>>>>>> actually want to return anything, I just want to send the
>> >> >>>>>>> information to the
>> >> >>>>>>> URL and for FreeSwitch to go on about it's business.
>> >> >>>>>>>
>> >> >>>>>>> What module is best for this job?
>> >> >>>>>>>
>> >> >>>>>>>
>> >> >>>>>>>
>> >> >>>>>>>
>> >> >>>>>>> _________________________________________________________________________
>> >> >>>>>>> Professional FreeSWITCH Consulting Services:
>> >> >>>>>>> consulting at freeswitch.org
>> >> >>>>>>> http://www.freeswitchsolutions.com
>> >> >>>>>>>
>> >> >>>>>>> Official FreeSWITCH Sites
>> >> >>>>>>> http://www.freeswitch.org
>> >> >>>>>>> http://confluence.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://confluence.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://confluence.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://confluence.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
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> --
>> >> >>> Sincerely,
>> >> >>> Don Hawkins
>> >> >>> CEO
>> >> >>> Hawkins Enterprise Group LLC
>> >> >>> http://hawkinsegroup.com
>> >> >>> Zello PTT: push2don
>> >> >>> P: 469-214-5044
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Sincerely,
>> >> >> Don Hawkins
>> >> >> CEO
>> >> >> Hawkins Enterprise Group LLC
>> >> >> http://hawkinsegroup.com
>> >> >> Zello PTT: push2don
>> >> >> P: 469-214-5044
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Sincerely,
>> >> > Don Hawkins
>> >> > CEO
>> >> > Hawkins Enterprise Group LLC
>> >> > http://hawkinsegroup.com
>> >> > Zello PTT: push2don
>> >> > P: 469-214-5044
>> >> >
>> >> >
>> >> >
>> >> > _________________________________________________________________________
>> >> > Professional FreeSWITCH Consulting Services:
>> >> > consulting at freeswitch.org
>> >> > http://www.freeswitchsolutions.com
>> >> >
>> >> > Official FreeSWITCH Sites
>> >> > http://www.freeswitch.org
>> >> > http://confluence.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://confluence.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
>> >
>> >
>> >
>> >
>> > --
>> > Sincerely,
>> > Don Hawkins
>> > CEO
>> > Hawkins Enterprise Group LLC
>> > http://hawkinsegroup.com
>> > Zello PTT: push2don
>> > P: 469-214-5044
>> >
>> >
>> > _________________________________________________________________________
>> > Professional FreeSWITCH Consulting Services:
>> > consulting at freeswitch.org
>> > http://www.freeswitchsolutions.com
>> >
>> > Official FreeSWITCH Sites
>> > http://www.freeswitch.org
>> > http://confluence.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://confluence.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
>
>
>
>
> --
> Sincerely,
> Don Hawkins
> CEO
> Hawkins Enterprise Group LLC
> http://hawkinsegroup.com
> Zello PTT: push2don
> P: 469-214-5044
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.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



Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list