Open source toolkit for voice services; with special focus to the needs of medium- and low-income countries, scalable services, and interacting with vulnerable populations
The active calls GC now perform callbacks to the callback URL. To accomplish this, now the call_logs are storing the callback_url and the js_context, which are needed to perform these callbacks.
The callback_url is defined in the prepare_session method of each session since it will have no changes along the state transitions. For the js_context, it needs to be updated each time that the FSM state of the session changes, then is updated in the notify_status_to_callback_url, that will be called with each change.
In the GC, before updating the call_logs table entries, a callback is performed establishing CallDuration=0 and CallStatus="failed" on an ad-hoc function called notify_failed_to_callback_url executed foreach active call active for too long.
This commit was tested against surveda calls, and the callback is performed. From surveda logs we can trace them:
Closes #913.
The active calls GC now perform callbacks to the callback URL. To accomplish this, now the
call_logs
are storing thecallback_url
and thejs_context
, which are needed to perform these callbacks.The
callback_url
is defined in theprepare_session
method of each session since it will have no changes along the state transitions. For thejs_context
, it needs to be updated each time that the FSM state of the session changes, then is updated in thenotify_status_to_callback_url
, that will be called with each change.In the GC, before updating the
call_logs
table entries, a callback is performed establishingCallDuration=0
andCallStatus="failed"
on an ad-hoc function callednotify_failed_to_callback_url
executed foreach active call active for too long.This commit was tested against surveda calls, and the callback is performed. From surveda logs we can trace them:
Then the callback was properly made.
A PR documenting the callbacks cycle will be made to close the twin issue in Surveda, 2085.