Reputation: 97
Is it possible to execute a python script at the end of each call, so it could access billsec
variable and send them to my API? There is session.setHangupHook
method, but if i try to get billsec
variable there, it returns None
.
Upvotes: 0
Views: 731
Reputation: 51904
billsec
is not available until the handlers have exited and the call is disconnected. Instead, use api_hangup_hook
which is invoked after the call is complete.
<action application="set" data="session_in_hangup_hook=true"/>
<action application="set" data="api_hangup_hook=python script.py ${uuid}"/>
More info: https://freeswitch.org/confluence/display/FREESWITCH/api_hangup_hook
Upvotes: 1