https://retellai.com/?utm_source=discord&utm_medium=seo logo
how do you know when a call has been complete eith...
# ❓・ai-evy-support
p
@AI Evy how do you know when a call has been complete either as success or failure?
a
Thanks for tagging me @PixelDrift42. I'll look through relevant sources and get back to you shortly.
### Answer You can determine if a call has been completed as success or failure through several methods: ## Webhook Events Retell AI provides webhook events that notify you when calls complete [(1) ]() . The
call_ended
event is triggered when a call completes, transfers, or encounters an error, and includes all fields from the call object except
call_analysis
. The
call_analyzed
event is triggered when call analysis is complete and includes the full call data including the
call_analysis
object . ## Call Status and Metrics For monitoring call completion, you can check the
disconnection_reason
field rather than relying solely on
call_successful
[(2) ]() . According to community guidance, you should treat
user_hangup
,
agent_hangup
, or
call_transfer
as answered calls to avoid unnecessary follow-ups . ## Batch Call Monitoring If you're using batch calls, you can monitor their progress through the Batch Call tab, which shows metrics including [(3) ]() : - **Sent**: Total calls sent from the batch - **Picked Up**: Number of calls answered by recipients - **Successful**: Calls successfully completed based on predefined criteria ## Performance Metrics For comprehensive call tracking, you can monitor several key metrics [(4) ]() : - **Call Pick Up Rate**: Percentage of calls successfully answered by the AI agent - **Call Successful**: Number of calls successfully handled by the AI agent - **Call Transfer Rate**: Frequency of calls transferred to human agents The webhook approach provides real-time notifications, while the dashboard monitoring gives you batch-level insights into call completion s
tatus.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Answered call logged as 'Unsuccessful'](https://discord.com/channels/1186424376300679209/1378930261760278558) [[3] Monitor batch calls](https://docs.retellai.com/deploy/monitor-batch-call) [[4] How to Measure and Track an AI Phone Agent's Performance | Retell AI](https://www.retellai.com/blog/how-to-measure-and-track-an-ai-phone-agents-performance) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
how do you use the sdk to do this?
@AI Evy @AI Evy
@AI Evy how do you use the sdk to do this?
@AI Evy how do you use the sdk to do this?
a
Thanks for the follow-up, @PixelDrift42. I'll get back to you soon.
### Answer Based on the available sources, I can show you how to use the SDK to detect call completion for web calls specifically. ## Using the Web SDK to Monitor Call Status For web calls, you can use the Retell Web SDK to listen for call completion events [(1) ]() :
Copy code
javascript
import { RetellWebClient } from "retell-client-js-sdk";
const retellWebClient = new RetellWebClient() ;
To monitor when a call ends, you can listen to the
call_ended
event :
Copy code
javascript
retellWebClient.on("call_ended", () => {
 console.log("call ended") ;
 setIsCallActive(false) ;
}) ;
You can also listen for error events to detect call failures :
Copy code
javascript
retellWebClient.on("error", (error) => {
 console.error("An error occurred:", error) ;
 // Stop the call
 retellWebClient.stopCall() ;
}) ;
## Additional Event Monitoring The Web SDK also provides other useful events for monitoring call status :
Copy code
javascript
retellWebClient.on("call_started", () => {
 console.log("call started") ;
}) ;

retellWebClient.on("update", (update) => {
 // console.log(update) ;
}) ;

retellWebClient.on("metadata", (metadata) => {
 // console.log(metadata) ;
}) ;
However, I don't have specific information in the available sources about using the Node.js or Python SDKs to monitor call completion status through webhooks or API polling. For comprehensive call monitoring across all call types (not just web calls) , you would likely need to implement webhook endpoints or use API calls to check call status, but those specific SDK examples aren't available in the current sources.
​ To learn more, see the sources I considered: [[1] Connect to web call](https://docs.retellai.com/deploy/web-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
@AI Evy can you use the python sdk
a
Thanks for the follow-up, @PixelDrift42. I'll get back to you soon.
### Answer ## Using the Python SDK to Monitor Call Status Based on the available sources, the Python SDK provides several methods to monitor call completion status. ### Retrieving Call Information You can use the
retrieve
method to get call status information [(1) ]() :
Copy code
python
client.call.retrieve(call_id) -> CallResponse
This method returns a
CallResponse
object that contains the call details and status . ### Listing Calls You can also list calls with filtering parameters :
Copy code
python
client.call.list(**params) -> CallListResponse
### Available Call Types The Python SDK supports different call response types :
Copy code
python
from retell.types import CallResponse, PhoneCallResponse, WebCallResponse, CallListResponse
### Enhanced Call Monitoring Features The platform provides comprehensive call monitoring capabilities including Call Completion Status, Task Completion Status, User Sentiment, Average End-to-End Latency, and Network Latency [(2) ]() . These metrics are accessible through the API . ### Webhook Verification For webhook-based call monitoring, the Python SDK includes webhook signature verification capabilities [(3) ]() . However, one user noted that the
verify
attribute may not be available in the
AsyncRetell
client . While the sources show the basic SDK methods for retrieving call information, I don't have specific code examples in the available sources showing how to implement real-time call status monitoring or webhook handling with the Python SDK. You would need to combine the
call.retrieve()
method with your own polling logic or implement webhook endpoints to receive call completion notifications.
​ To learn more, see the sources I considered: [[1] RetellAI/retell-python-sdk/api.md](https://github.com/RetellAI/retell-python-sdk/blob/main/api.md) [[2] Latest Features (Call Analysis, Backchanneling) And Python Custom LLM Update](https://www.retellai.com/changelog/latest-features-call-analysis-backchanneling-and-python-custom-llm-update) [[3] Discord message from @micheldenizob on 2024-11-27](https://discord.com/channels/1186424376300679209/1186462578310910112/1311452651002658837) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.