What is the best way to POST JSON data to a URL after a call has ended?

Status
Not open for further replies.

mrbnet

New Member
Nov 1, 2022
10
0
1
41
I am trying to post a JSON payload to a URL after every call ends/hangs up. I am able to get somewhat close by making changes to: `/usr/share/freeswitch/scripts/app/hangup/index.lua` I would like my changes to persist after an update to that file via an upgrade.

My questions are:
1. What is the best way to call some custom hangup lua that will persist if an upstream update to app/hangup/index.lua is made?
2. I recieve an error calling curl from the hangup script. `switch_core_session.c:2752 sofia/internal/5555551212@123.123.123.123 Channel is hungup and application 'curl' does not have the zombie_exec flag.` Setting that flag does not work
3. Is there another hook that I should/could be using?

It seems like this type of question is covered in a number of different threads without a clear outcome.

TY
 

demonspork

New Member
May 30, 2018
19
1
3
34
The basics of a way to do it is to write a lua script that does what you want and register an event handler for the hangup event. Take a look at scripts like the feature event script or blf_subscribe, I think they start off with an example of registering for events.

As far as if you want to modify the hangup app, because all of this is in git you can resolve conflicts on edited files when you attempt to git pull. I am using a modified version of Fusionpbx in my own fork and I use that to update the /var/www/fusionpbx code, but when I update from the main project I just resolve any conflicts that occur at that moment and get my fork up to date, then I update fusionpbx.
 
Status
Not open for further replies.