aircall / aircall-everywhere

SDK to embed and communicate to Aircall phone in any web page
https://aircall.github.io/aircall-everywhere
25 stars 16 forks source link

Call object from Aircall API is not updated yet when call_end event (with added note) is invoked. #28

Closed williamlimianto closed 3 years ago

williamlimianto commented 3 years ago

Hi, so I think I found another issue but I'm not sure how to put it.

I was trying to observe the Call Object data by adding AJAX to the List of Call API using the call_id from callInfos at the call_ended event. (I added console.log to show data from ajax)

So, I performed the call (and answered by the other side) then end the call from Aircall Everywhere SDK UI, the call status from API is equals to 'done' (which is expected).

However, if I added Comment / Note from the Aircall Everywhere SDK UI and End the call from the agent side, the call status from API will be 'answered' with empty comment object.

My query for this case is: shouldn't the call status = 'done' and the comment object is populated right when the call_end is called?

Thanks!

eulbat commented 3 years ago

Hello @williamlimianto thank you for reaching out. The notes and tags added on the phone are saved when you leave the call ended view. This is why they are not present in the call ended payload.

williamlimianto commented 3 years ago

Hi eulbat, thank you for your feedback. Well noted for the notes and tags, However, how about the call_status? It should be 'completed' instead of still 'answered' right?

eulbat commented 3 years ago

Hi @williamlimianto Apologies for the delay.

So if I understand correctly:

And the status is not done if you've added comments or tags?

williamlimianto commented 3 years ago

Hi eulbat, Sorry for the delay as well. Yes, that is correct. Also, there is another flow that causing this issue. Try to perform outbound call, and then try to compare the api result between user ended the call and agent (I mean the user of Aircall Everywhere) ended the call.

Somehow the status is different too. (Status still answered)

Thanks.

eulbat commented 3 years ago

@williamlimianto There might be a slight delay between the event being received in aircall-everywhere and the data being up to date in the API. However, if you want to rely on events, you can check out the webhooks from our public api: https://developer.aircall.io/api-references/#webhook-usage

williamlimianto commented 3 years ago

Hi @eulbat, is there any alternative that I can take to keep using event from Aircall Everywhere combined with query to public API?

So for my case, I need to store log of the call status (From iniatiated until done) and link each of them with my project's transaction id.

If I use webhooks, perhaps I could store the log however I cannot pass my projects's transaction id with it.

Thanks.

eulbat commented 3 years ago

Hello @williamlimianto

Unfortunately, I don't think there's another solution.

I don't know your whole use case so I might be missing something, but would something like this be possible ?

williamlimianto commented 3 years ago

Hi @eulbat,

Sorry for the delay, I also tried the Aircall webhook as you mentioned. However when I tried to capture the result of call.ended event, I found the same issue.

Try to perform outbound calls using the SDK, and then try to store the result into a dummy file/database. I found different results between the user ended the call and the agent (I mean the user of Aircall Everywhere) ended the call. Somehow the status is still different and recording is still not available.

williamlimianto commented 3 years ago

Hi @eulbat , Is there any update regarding this case?

I just want to make sure because the Aircall Support team already set the ticket to "Resolved as Known Issue" due to the issue is handled here (Github) and not at the Aircall Support portal.

Thanks! Screenshot_4

eulbat commented 3 years ago

Hello @williamlimianto

I have not been able to reproduce the issue. I tried multiple cases:

In all these scenarios, when I receive the call.ended webhook, the status from the webhook payload (data.status) is done as expected.

williamlimianto commented 3 years ago

Hi @eulbat, sorry for the delay. I already retested every scenario above and somehow the call status is already correct. I'm not quite sure how.

However, I got another issue (hopefully this is last one) regarding calling to external. So here's how to reproduce the issue :

  1. I call the external using Aircall Everywhere SDK. Note: The external number is actually a phone number.
  2. Then, the external rejects the phone call / ignores the phone call.
  3. The provider from the external number response with "The person you're trying to call is currently busy" and so on.
  4. Notice the call.ended webhook, the status is done (which is expected), however the answered_at is filled.

My question is, why is the answered_at field still filled even though the external is not answering the call?

Thanks.

eulbat commented 3 years ago

Hey @williamlimianto

This is not ideal but unfortunately it's normal. When calling a number that has a voicemail, if you hit that voicemail, that call is considered as "answered" because it is answered by the voicemail "robot". This is present throughout the product and isn't specific to aircall-everywhere.

williamlimianto commented 3 years ago

Hi @eulbat, Ah well noted, then I guess this issue is resolved by using the Aircall Webhook :) Thank you so much for your time and your help.