<div dir="ltr"><div><span style="font-size:12.8px">Hi Trever, </span></div><div><span style="font-size:12.8px"><br></span></div><div>I&#39;d love to try and help you with this, but I don&#39;t understand completely your use case, can you give a little more details on what the issue is and what exactly you need.</div><div><br></div><div>We use lua and python in hangup hooks and so far no issues.</div><div><br></div><div>Joel.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 2:19 AM, Trever L. Adams <span dir="ltr">&lt;<a 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">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>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.)<span class="HOEnZb"><font color="#888888"><br>
      <br>
      Trever</font></span><div><div class="h5"><br>
      <br>
      On 08/01/2016 10:46 AM, Joel Serrano wrote:<br>
    </div></div></div><div><div class="h5">
    <blockquote 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=&quot;set&quot;
            data=&quot;session_in_hangup_hook=<wbr>true&quot;/&gt;</div>
          <div>            &lt;action application=&quot;set&quot;
            data=&quot;api_hangup_hook=python script_name&quot;/&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 href="mailto:trever@middleearth.sapphiresunday.org" target="_blank">trever@middleearth.<wbr>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 href="https://wiki.freeswitch.org/wiki/Mod_python#Hangup_hook_.2B_SQLAlchemy_crashes_switch" rel="noreferrer" target="_blank">https://wiki.freeswitch.org/<wbr>wiki/Mod_python#Hangup_hook_.<wbr>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>
______________________________<wbr>______________________________<wbr>_____________<br>
            Professional FreeSWITCH Consulting Services:<br>
            <a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
            <a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br>
            <br>
            Official FreeSWITCH Sites<br>
            <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
            <a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.<wbr>org</a><br>
            <a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
            <br>
            FreeSWITCH-users mailing list<br>
            <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.<wbr>freeswitch.org</a><br>
            <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
            UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
            <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>______________________________<wbr>______________________________<wbr>_____________
Professional FreeSWITCH Consulting Services: 
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.<wbr>freeswitchsolutions.com</a>

Official FreeSWITCH Sites
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.<wbr>org</a>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.<wbr>freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></pre>
    </blockquote>
    <p><br>
    </p>
  </div></div></div>

<br>______________________________<wbr>______________________________<wbr>_____________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.<wbr>org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.<wbr>freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>