<?php

namespace App\Http\Controllers\Twilio;

use App\Actions\Communications\HandleInboundCallAction;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class InboundVoiceController extends Controller {
    public function __invoke(Request $request, HandleInboundCallAction $action) {
        return $action->handle(
            fromNumber: $request->string('From')->toString(),
            toNumber: $request->string('To')->toString(),
            payload: $request->all(),
        );
    }
}
