<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi,<br>
      <br>
      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. <br>
      <br>
      The first come to my mind is using <a
        href="https://wiki.freeswitch.org/wiki/Mod_xml_curl">mod_xml_curl</a>
      in your dialplan to make request to node.js. Node.js will respond
      to FS as according to your business logic.<br>
      <br>
      The second way is with <a
        href="https://wiki.freeswitch.org/wiki/Mod_curl">mod_curl</a>.<br>
      <br>
      The third way, you can use <a
        href="https://wiki.freeswitch.org/wiki/Mod_event_socket">event
        socket</a>.<br>
      <br>
      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.<br>
      <br>
      Well, good luck.<br>
      <br>
      <br>
      On 06/05/2014 08:26 AM, Alex Lake wrote:<br>
    </div>
    <blockquote cite="mid:53906917.7080007@digitalmail.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">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....<br>
        <br>
        These examples seem very much web-linked.<br>
        <br>
        Let's consider an example:<br>
        <br>
        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.<br>
        <br>
        I could do that with simple dialplan and Lua easy enough, but
        how would I do it in node.js?<br>
        <br>
      </div>
      <blockquote
cite="mid:CAEho-ZOoDrmHxt=B-Rhobcg9Ba=5ZaeZBadkBK-0gWLgu9QBOw@mail.gmail.com"
        type="cite">
        <div dir="ltr">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.
          <div><br>
          </div>
          <div>Take a look at&nbsp;<a moz-do-not-send="true"
              href="https://github.com/englercj/node-esl">https://github.com/englercj/node-esl</a>
            for a lib and examples.</div>
        </div>
        <div class="gmail_extra"><br>
          <br>
          <div class="gmail_quote">On Thu, Jun 5, 2014 at 10:19 AM, Alex
            Lake <span dir="ltr">&lt;<a moz-do-not-send="true"
                href="mailto:alex@digitalmail.com" target="_blank">alex@digitalmail.com</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm
              interested in using node.js to write scripts to control<br>
              Freeswitch-based telephony apps.<br>
              This is partly because some of the apps we've been writing
              seem to be<br>
              stretching the dialplan/Lua way of doing things - or at
              least my<br>
              comprehension of the model - beyond what is commercially
              viable. What I<br>
              mean is that writing and extending our apps (particularly
              when working<br>
              with multiple call legs with complex inter-related state)
              is too<br>
              expensive. It seems from reading around, that
              externalising the<br>
              choreography of sessions is the choice of the fs
              cognoscenti.<br>
              <br>
              However, there seems to be very little by the way of
              documentation and<br>
              example non-trivial "cookbook" style apps around - or
              maybe I've just<br>
              not been looking in the right places.<br>
              <br>
              I get the strong impression that there are plenty of
              people here who've<br>
              been there, done that and have the t-shirt. Just wondering
              what the<br>
              chances are of a bit of sharing (obviously I'm happy to
              invest time into<br>
              publishing my findings and creating new examples, etc)<br>
              <br>
_________________________________________________________________________<br>
              Professional FreeSWITCH Consulting Services:<br>
              <a moz-do-not-send="true"
                href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
              <a moz-do-not-send="true"
                href="http://www.freeswitchsolutions.com"
                target="_blank">http://www.freeswitchsolutions.com</a><br>
              <br>
              FreeSWITCH-powered IP PBX: The CudaTel Communication
              Server<br>
              <a moz-do-not-send="true" href="http://www.cudatel.com"
                target="_blank">http://www.cudatel.com</a><br>
              <br>
              Official FreeSWITCH Sites<br>
              <a moz-do-not-send="true" href="http://www.freeswitch.org"
                target="_blank">http://www.freeswitch.org</a><br>
              <a moz-do-not-send="true"
                href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
              <a moz-do-not-send="true" href="http://www.cluecon.com"
                target="_blank">http://www.cluecon.com</a><br>
              <br>
              FreeSWITCH-users mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
              <a moz-do-not-send="true"
                href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
                target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
              UNSUBSCRIBE:<a moz-do-not-send="true"
                href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
                target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
              <a moz-do-not-send="true" href="http://www.freeswitch.org"
                target="_blank">http://www.freeswitch.org</a><br>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div dir="ltr">
            <div><font color="#000000" face="arial, helvetica,
                sans-serif">Regards</font></div>
            <font color="#000000" face="arial, helvetica, sans-serif"><b>Oscar

                Franz&eacute;n<br>
              </b></font><font color="#000000" face="arial, helvetica,
              sans-serif"><i>Developer</i><br>
              <br>
              <b><img moz-do-not-send="true"
                  src="https://advisa.se/img/logo/email-logo.png"><br>
                <br>
              </b><b>Advisa</b><br>
            </font>
            <div><font color="#000000" face="arial, helvetica,
                sans-serif"><a moz-do-not-send="true"
                  href="mailto:oscar.franzen@advisa.se"
                  style="color:rgb(17,85,204)" target="_blank">oscar.franzen@advisa.se</a><br>
                Mobil: 070-720 45 81<br>
                Bes&ouml;ksadress:&nbsp;</font>Kungsgatan 30, Stockholm</div>
            <div><font color="#000000"><font face="arial, helvetica,
                  sans-serif"><a moz-do-not-send="true"
                    href="http://www.advisa.se/"
                    style="color:rgb(17,85,204)" target="_blank">www.advisa.se</a></font></font></div>
            <div><font color="#000000"><br>
              </font></div>
            <div><span style="font-family:arial,helvetica,sans-serif"><font
                  color="#000000">&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;</font></span><br
                style="font-family:arial,helvetica,sans-serif">
              <span style="font-family:georgia,serif;font-size:x-small">Informationen

                i detta meddelande &auml;r konfidentiell och endast avsedd
                f&ouml;r den/de angivna mottagarna. Om Du inte &auml;r en avsedd
                mottagare, ber vi Dig att inte l&auml;sa, kopiera eller
                anv&auml;nda informationen i meddelandet&nbsp; samt att inte
                heller vidares&auml;nda informationen eller delge den till
                annan. Vi ber Dig &auml;ven att omedelbart meddela&nbsp;
                avs&auml;ndaren att Du erh&aring;llit meddelandet felaktigt samt
                att d&auml;refter genast radera det fr&aring;n Ditt system. Advisa
                ansvarar inte f&ouml;r eventuella personliga &aring;sikter eller
                v&auml;rderingar i detta meddelande.</span><br>
            </div>
          </div>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.cudatel.com">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
</pre>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <p class="" avgcert""="" color="#000000" align="left">No virus
          found in this message.<br>
          Checked by AVG - <a moz-do-not-send="true"
            href="http://www.avg.com">www.avg.com</a><br>
          Version: 2014.0.4570 / Virus Database: 3955/7623 - Release
          Date: 06/04/14</p>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a class="moz-txt-link-freetext" href="http://www.cudatel.com">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
</pre>
    </blockquote>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      Atentamente,
      <br>
      <b>Dario Garc&iacute;a</b>
      <br>
      Consultor.
      <br>
      <br>
      CCCT, Nivel C2, Sector Yarey, Mz, <br>
      Ofc. MZ03a. <br>
      Caracas-Venezuela.
      <br>
      Tel&eacute;fono: +58 212 9081842
      <br>
      Cel: +58 412 2221515
      <br>
      <a class="moz-txt-link-abbreviated" href="mailto:dgarcia@anew.com.ve">dgarcia@anew.com.ve</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://www.anew.com.ve">http://www.anew.com.ve</a></div>
  </body>
</html>