VAPI Log Error Codes:
[ERROR]
status-update Server URL Error: Request failed with status code 409
[ERROR]
end-of-call-report Server URL Error: Request failed with status code 409
In anther instance (before a couple code iterations):
end-of-call-report Server URL Error: Request failed with status code 500
I have a problem with pushing the messages from VAPI to trough the Server to my MongoDB. But this issue ONLY occurs when I use a different phone number then mine when trying to talk to an Assistant. So my data is captured, but any one elses numbers isnt. I guess it is always and only one phone number which has access, but I was not able to find the code error. Working on this for now nearly 8 hours. Tried 30 Promts with different LLMs, but no solution.
In my server I get the following error codes.
Duplicate key error: MongoServerError: E11000 duplicate key error collection: test.users index: phoneNumber_1 dup key: { phoneNumber: null }
errmsg: 'E11000 duplicate key error collection: test.users index: phoneNumber_1 dup key: { phoneNumber: null }',
How can I avoid this and store data from all callers?
I suppose there is an error in my code. Help me find it and let us get rid of this problem.
My Code is the following (it grew from 48 lines to 112 by now):
https://github.com/001100101/VAPIProblemSolution/blob/main/app.js