Mutliple call update events hitting in Freshcaller that interupts code

Hi Folks,

I am facing one issue in freshcaller there I am using call update event(serverless), for outgoing call answered- case, when a call was answered, when the first-time event hits, my functionality should work, but immediately hitting event within a fraction of seconds, interrupting first hit event functionality can anyone help me in this like this to proceed further, this is high priority app

Thanks in advance,
Tejasri

1 Like

Hi @Tejasri_Kalluri,

Each event triggers a separate Serverless function invocation which will not affect the previously invoked function execution.
Could you explain how the further invocation interrupts the previous execution?
What is the logic used here to detect the first-time event trigger?

Hello @Raviraj,

Thanks for your time,
LOGIC EXPlANATION-for an outgoing call answered, I am setting DB with call_id for checkpoint because in freshcaller in one call, call.update event occurs multiple times in a fraction of seconds, in DB creation success I am searching contact, get the contact info, creating activity in third party application, for second time DB will search call_id, already created so that multiple activities will not create in one call.
OUTPUT- As the event is hitting multiple times it’s interrupting the first triggered event and failing to create activity.

1 Like

I assume, due to multiple onCallUpdate events getting triggered for the same outgoing call, the $db record may not have created before multiple event handlers tried to create the activity in the third-party.
To avoid this, an additional parameter from the payload can be validated. For example, status can be checked from a particular value to another. It may vary depends on your use-case.

Regarding the interruption part, could you share logs to understand this pattern?

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.