1
votes

I want to send the recorded file of the call session to a REST API once the call is terminated. I read through the Freeswitch docs and am able to record a call and save it to a .wav file. Now I want to POST the file to a REST API on a remote server, I think the Post Processing Recordings in the Dialplan and mod_curl will be of some help to me but I am unable to understand how I can make the two work together to achieve what I want. I am new to Freeswitch, these are the links that I am following:

https://freeswitch.org/confluence/display/FREESWITCH/mod_dptools%3A+record_session

https://freeswitch.org/confluence/display/FREESWITCH/mod_curl

1

1 Answers

2
votes

Several approaches:

1 Write lua dualplan. Here is how to read file in lua: https://stackoverflow.com/a/11204889/827704

Then you can use mod_curl to send file from lua dialplan

2 Write service, to send file You can create simple backend service, located on the same machine as freeswitch, with API for freeswitch.

Then you call method of this local service with record name from freeswitch.

Then this new backend service processes this request loading file then calling method of target api.

so

  1. freeswitch - POST filename -> local service API
  2. local service: load file from shared with freeswitch folder
  3. local service - POST file -> target API