<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Thank you Joel. I was looking at that
      wondering if that would be the correct way. Some variables
      available in the lua event hooks are not available this way and
      vice versa. I am having some difficulty as each presents its own
      problems. What I hope for is to use the api_hangup_hook with lua.
      The problem that remains is that on outbound calls things get
      messed up if the internal user transfers to another internal user.
      (I need the call direction to be accurate or have a way to detect
      when I should flip it.)<br>
      <br>
      Trever<br>
      <br>
      On 08/01/2016 10:46 AM, Joel Serrano wrote:<br>
    </div>
    <blockquote
cite="mid:CAMtXxQ=EZRMgKPnyOTjY2mLAJ66oHV3XU9k71_301=ENYEE8FA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi, 
        <div><br>
        </div>
        <div>Have you tried something like:</div>
        <div><br>
        </div>
        <div>[...]</div>
        <div>
          <div>            &lt;action application="set"
            data="session_in_hangup_hook=true"/&gt;</div>
          <div>            &lt;action application="set"
            data="api_hangup_hook=python script_name"/&gt;</div>
        </div>
        <div>[...]</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>??</div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Aug 1, 2016 at 9:20 AM, Trever
          L. Adams <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:trever@middleearth.sapphiresunday.org"
              target="_blank">trever@middleearth.sapphiresunday.org</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">I am
            working on adding functionality to an external project that
            already<br>
            supports Asterisk. I have used hook events with lua to
            capture call data<br>
            on hangup and hangup complete before. Unfortunately, I need<br>
            authenticated json rpc or xmlrpc. The original code I am
            working from is<br>
            also in Python. Lua xml and json rpc modules do not seem to
            do<br>
            authenticated requests. Since I already have Python, it
            seems to be easier.<br>
            <br>
            <a moz-do-not-send="true"
href="https://wiki.freeswitch.org/wiki/Mod_python#Hangup_hook_.2B_SQLAlchemy_crashes_switch"
              rel="noreferrer" target="_blank">https://wiki.freeswitch.org/wiki/Mod_python#Hangup_hook_.2B_SQLAlchemy_crashes_switch</a>,<br>
            it says that hangup hooks are very buggy and should be
            avoided. Is this<br>
            still the case in the last year or so (recent versions)? If
            so, what is<br>
            the best way to do this? If not, can someone post a simple
            equivalent of<br>
            event:getHeader in a simple handler for hangups so that I
            can start<br>
            working on this?<br>
            <br>
            Do I use def fsapi(session, stream, env, args) or def
            handler(session,<br>
            args)?<br>
            <br>
            Thank you for help getting started,<br>
            <br>
            Trever<br>
            <br>
            <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" rel="noreferrer"
              target="_blank">http://www.freeswitchsolutions.com</a><br>
            <br>
            Official FreeSWITCH Sites<br>
            <a moz-do-not-send="true" href="http://www.freeswitch.org"
              rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
            <a moz-do-not-send="true"
              href="http://confluence.freeswitch.org" rel="noreferrer"
              target="_blank">http://confluence.freeswitch.org</a><br>
            <a moz-do-not-send="true" href="http://www.cluecon.com"
              rel="noreferrer" 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"
              rel="noreferrer" 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"
              rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
            <a moz-do-not-send="true" href="http://www.freeswitch.org"
              rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
          </blockquote>
        </div>
        <br>
      </div>
      <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>

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://confluence.freeswitch.org">http://confluence.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>
    <p><br>
    </p>
  </body>
</html>