Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion extensions/voice-call/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,24 @@ export class CallManager {
if (!call && event.direction === "inbound" && event.providerCallId) {
// Check if we should accept this inbound call
if (!this.shouldAcceptInbound(event.from)) {
// TODO: Could hang up the call here
if (this.provider) {
// Create record to track the rejected call
call = this.createInboundCall(
event.providerCallId,
event.from || "unknown",
event.to || this.config.fromNumber || "unknown",
);

// End it immediately
this.endCall(call.callId).then((result) => {
if (!result.success) {
console.error(
`[voice-call] Failed to hang up rejected call ${call?.callId}:`,
result.error,
);
}
});
}
return;
}

Expand Down