Closed matiasgarciaisaia closed 2 years ago
Some notes (as I read the documentation and the bugs):
Looking at AfT's documentation, they don't define values for callSessionState
. It's probably an enum string, but :shrug:
AfT documents that callSessionState
is only sent with the final notification, and they even emphasize it, that would mean that its presence or absence could be used to determine if a call is ongoing or done. Hence the initial match to proceed when undefined
.
It was noticed in #894 that AfT broke their notification API: callSessionState
seems to be always sent. That was taken care of in #895 to proceed unless Completed
. Yet, we still don't know all the possible values, and we now have this issue, where callSessionState
can be NotAnswered
, and we can only guess there are (or will be) some other values :sob:
Ideas:
We should be able to use isActive
to determine whether a session is active (1
) or completed (0
). It's documented and present in both example JSON here and in #894 :tada:
Maybe we can close the session when hangupClause
is present? We have all possible values, and can even determine whether the user hang up, the call failed, or the call is impossible. It isn't documented to be only in the final notification, but :shrug:
ping @matiasgarciaisaia
I agree with using isActive
.
It seems that some time ago AfT used to only send callSessionState
when the call was finished - that's why we were assuming a finished called without checking. But they must have changed that, and now what defines a 100% surely finished call seems to be the isActive
value - so I'd go with that 👌
Verboice is generating lots of
timeout
errors waiting for Africa's Talking to send it a callback - only the callback has already arrived, but is being mishandled.The call in Verboice is this one: https://verboice.surveda-africa.org/calls/548
See https://developers.africastalking.com/docs/voice/notifications for AfT's official docs. See #894 for the previous issue, and #895 for an incomplete attempt to fix it.