[Freeswitch-users] how to: get session variable after api_hangup_hook

Dave R. Kompel drk at drkngs.net
Wed Jun 6 03:33:09 MSD 2012


Session is one of the parameters that get passed to API calls. If the API was invoked by a session, and not out of band, like form the console or event_socket, or any other way to invoke it, the argument will not be null. You can then get variables from the session handle just like you would do anywhere else.  
   
--Dave
      _____  

  From: cristian re [mailto:cristian.re.work at gmail.com]
To: freeswitch-users at lists.freeswitch.org
Sent: Tue, 05 Jun 2012 08:33:59 -0700
Subject: [Freeswitch-users] how to: get session variable after api_hangup_hook

  
  
  
Hello,  

  
I write a custom cpp module for freeswitch that exposes an API:  

  
SWITCH_ADD_API(commands_api_interface, "my_hangup", "my_hangup",  my_hangup_api , MY_HANGUP_USAGE);  

  
I want to call this api from dialplan (after bridge hangup) for reading the variable "billmsec".  
I put this into my dialplan:  

  
<action application="set" data="session_in_hangup_hook=true"/>  
<action application="set" data="api_hangup_hook=my_hangup_api"/>  

  
After hangup freeswitch call correctly my API but I have not figured out how to get the variable.  

  

  

  

  

      
   
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120605/c148a3b2/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list