[Freeswitch-users] Hangup hooks in Python

Trever L. Adams trever at middleearth.sapphiresunday.org
Mon Aug 15 13:19:45 MSD 2016


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.)

Trever

On 08/01/2016 10:46 AM, Joel Serrano wrote:
> Hi, 
>
> Have you tried something like:
>
> [...]
>             <action application="set" data="session_in_hangup_hook=true"/>
>             <action application="set" data="api_hangup_hook=python
> script_name"/>
> [...]
>
>
> ??
>
>
>
> On Mon, Aug 1, 2016 at 9:20 AM, Trever L. Adams
> <trever at middleearth.sapphiresunday.org
> <mailto:trever at middleearth.sapphiresunday.org>> wrote:
>
>     I am working on adding functionality to an external project that
>     already
>     supports Asterisk. I have used hook events with lua to capture
>     call data
>     on hangup and hangup complete before. Unfortunately, I need
>     authenticated json rpc or xmlrpc. The original code I am working
>     from is
>     also in Python. Lua xml and json rpc modules do not seem to do
>     authenticated requests. Since I already have Python, it seems to
>     be easier.
>
>     https://wiki.freeswitch.org/wiki/Mod_python#Hangup_hook_.2B_SQLAlchemy_crashes_switch,
>     it says that hangup hooks are very buggy and should be avoided. Is
>     this
>     still the case in the last year or so (recent versions)? If so,
>     what is
>     the best way to do this? If not, can someone post a simple
>     equivalent of
>     event:getHeader in a simple handler for hangups so that I can start
>     working on this?
>
>     Do I use def fsapi(session, stream, env, args) or def handler(session,
>     args)?
>
>     Thank you for help getting started,
>
>     Trever
>
>
>
>     _________________________________________________________________________
>     Professional FreeSWITCH Consulting Services:
>     consulting at freeswitch.org <mailto: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
>     <mailto: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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160815/2b7902c7/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 872 bytes
Desc: OpenPGP digital signature
Url : http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160815/2b7902c7/attachment.bin 


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