Spaces:
Runtime error
Runtime error
| import { Controller, Post, Param, HttpCode, HttpStatus } from '@nestjs/common'; | |
| import { ApiTags, ApiOperation, ApiResponse, ApiParam } from '@nestjs/swagger'; | |
| import { CallService } from './call.service'; | |
| import { RequireRole } from '../auth/decorators/auth.decorators'; | |
| import { ApiKeyRole } from '../auth/entities/api-key.entity'; | |
| ('calls') | |
| ('sessions/:sessionId/calls') | |
| export class CallController { | |
| constructor(private readonly callService: CallService) {} | |
| (':callId/reject') | |
| (ApiKeyRole.OPERATOR) | |
| (HttpStatus.OK) | |
| ({ summary: 'Reject a ringing incoming call' }) | |
| ({ name: 'sessionId', description: 'Session ID' }) | |
| ({ name: 'callId', description: 'Call ID from the call.received event' }) | |
| ({ status: 200, description: 'Call rejected' }) | |
| ({ status: 400, description: 'Session is not started' }) | |
| ({ status: 404, description: 'Call not found or no longer ringing' }) | |
| async reject(('sessionId') sessionId: string, ('callId') callId: string) { | |
| await this.callService.rejectCall(sessionId, callId); | |
| return { success: true }; | |
| } | |
| } | |