how can I recieve twillo detect voicemail message ...
# support
e
14:08:09:834 [LOG] Twilio detected "machine_end_other" in 5000ms
how can I receive this log through api
v
You can continue this conversation by mentioning me in the message.
@Ezra To receive logs like the one you mentioned through an API, you would typically need to set up a webhook or use an API endpoint provided by the service that generates the logs, in this case, Twilio. For Twilio, you can use their REST API to fetch call logs, which might include the "machine_end_other" event. You would need to authenticate with your Twilio credentials and make a GET request to the Calls endpoint. Here's a general outline of the steps you would take: 1. Authenticate with Twilio using your
Account SID
and
Auth Token
. 2. Make a GET request to the Calls endpoint of the Twilio API. 3. Filter the logs by the specific event "machine_end_other" if possible, or retrieve the logs and filter them client-side. The actual API call would look something like this (in pseudocode):
Copy code
pseudo
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls.json
Authorization: Basic {Base64Encoded(AccountSid:AuthToken)}
You can also specify query parameters such as
startTime
to filter the calls starting after a certain time, or
status
to get calls with a certain status. Please replace
{AccountSid}
and
{AuthToken}
with your actual Twilio Account SID and Auth Token. If you need to fetch logs with specific parameters like
createdAtGt
, you would include those in the query string of your request. If you need assistance with making an API call or setting up a webhook to receive logs in real-time, please provide more details or ask for support.
s
Hey @Ezra can you be more clear around
how can I receive this log through api
?
Make sure it includes your usage and purpose for it.
e
Hey @Shubham Bajaj, Thanks for replying. I want to know if this twillo detection message will be sent to my server-url through server events, like 'status-update' or 'end-of-call-report'
s
Yes status update server event, will have call end reason and status of the casll.
Do let me, know how it goes.
e
I spent some time looking for the server event and I don't think this twillo detection message is included in it. status update is enum value of ['queue', 'ringing', 'in-progress', 'forwarding', 'ended']. endedReason have a 'voicemail' but not detailed about what twillo has detected('machine_end_beep' or 'machine_end_silent' or 'machine_end_other') could you please sent twillo detected message in a server event when twillo detection update since we need the message to end call early and handle other situations when twillo detection failed like
[LOG] Twilio detected "unknown" in 5000ms
s
unknown
doesn't means fail, it means an unknown category is identified. With status-update event when call is ended you get the status ended and reason as voice mail detection, now for the detailed how you can raise the feature request https://vapi.canny.io
@Ezra I believe all of your doubts have been resolved, do let me know if I can close this ticket.
e
Yes, perfect. You can go ahead and close the ticket. Thank you for your help!
14 Views