Hi, I think you can do it but you have to dedicate time to understand node.js. With node.js you can create a server to attend request made from FreeSwtich, node.js will act as middleware and business logic. And there are several way to do it. The first come to my mind is using mod_xml_curl <https://wiki.freeswitch.org/wiki/Mod_xml_curl> in your dialplan to make request to node.js. Node.js will respond to FS as according to your business logic. The second way is with mod_curl <https://wiki.freeswitch.org/wiki/Mod_curl>. The third way, you can use event socket <https://wiki.freeswitch.org/wiki/Mod_event_socket>. So, in my opinion the most complex way could be event socket because almost all hard work would be in node.js side (in your app/development). With the two first options, is quite try to balance what things to do in FS and in Node. Well, good luck. On 06/05/2014 08:26 AM, Alex Lake wrote:
Thanks - I've seen this, but the examples are not at all representative of the sort of thing I want to be doing with freeswitch (which is mostly about handling calls in accordance with a dialplan, but with some complex stuff involving multi-legs). It makes me think I must be barking up the wrong tree....
These examples seem very much web-linked.
Let's consider an example:
If one wanted a very simple dynamic call mini-conference service - call comes in from a PSTN gateway, the code hits an HTML server (eg. using RESTful protocols) which returns a comma-separated list of destinations and then the system bridges to these destinations. Perhaps plays them a little fanfare and then links them all together in a conference.
I could do that with simple dialplan and Lua easy enough, but how would I do it in node.js?
I have done some experimenting with NodeJs and FSW with the event socket library. This far it has worked fine and I am about to continue the integration of Node and FSW.
Take a look at https://github.com/englercj/node-esl for a lib and examples.
On Thu, Jun 5, 2014 at 10:19 AM, Alex Lake <alex@digitalmail.com <mailto:alex@digitalmail.com>> wrote:
I'm interested in using node.js to write scripts to control Freeswitch-based telephony apps. This is partly because some of the apps we've been writing seem to be stretching the dialplan/Lua way of doing things - or at least my comprehension of the model - beyond what is commercially viable. What I mean is that writing and extending our apps (particularly when working with multiple call legs with complex inter-related state) is too expensive. It seems from reading around, that externalising the choreography of sessions is the choice of the fs cognoscenti.
However, there seems to be very little by the way of documentation and example non-trivial "cookbook" style apps around - or maybe I've just not been looking in the right places.
I get the strong impression that there are plenty of people here who've been there, done that and have the t-shirt. Just wondering what the chances are of a bit of sharing (obviously I'm happy to invest time into publishing my findings and creating new examples, etc)
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Regards *Oscar Franzén */Developer/
*
**Advisa* oscar.franzen@advisa.se <mailto:oscar.franzen@advisa.se> Mobil: 070-720 45 81 Besöksadress: Kungsgatan 30, Stockholm www.advisa.se <http://www.advisa.se/>
------------------------------------------------------ Informationen i detta meddelande är konfidentiell och endast avsedd för den/de angivna mottagarna. Om Du inte är en avsedd mottagare, ber vi Dig att inte läsa, kopiera eller använda informationen i meddelandet samt att inte heller vidaresända informationen eller delge den till annan. Vi ber Dig även att omedelbart meddela avsändaren att Du erhållit meddelandet felaktigt samt att därefter genast radera det från Ditt system. Advisa ansvarar inte för eventuella personliga åsikter eller värderingar i detta meddelande.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2014.0.4570 / Virus Database: 3955/7623 - Release Date: 06/04/14
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Atentamente, *Dario García* Consultor. CCCT, Nivel C2, Sector Yarey, Mz, Ofc. MZ03a. Caracas-Venezuela. Teléfono: +58 212 9081842 Cel: +58 412 2221515 dgarcia@anew.com.ve http://www.anew.com.ve