### Setup Twilio and LiveKit (Bash) Source: https://github.com/livekit-examples/livekit-sip-agent-example/blob/main/README.md Scripts to set up Twilio SIP trunking and LiveKit inbound SIP trunking, following LiveKit's documentation. ```bash npm run setup:twilio npm run setup:livekit ``` -------------------------------- ### Run the Agent (Bash) Source: https://github.com/livekit-examples/livekit-sip-agent-example/blob/main/README.md Starts the LiveKit SIP Agent, making it ready to receive incoming SIP calls via Twilio. ```bash npm run agent ``` -------------------------------- ### Clone and Install Dependencies (Bash) Source: https://github.com/livekit-examples/livekit-sip-agent-example/blob/main/README.md Clones the LiveKit SIP Agent example repository and installs the necessary Node.js dependencies. ```bash git clone https://github.com/livekit-examples/livekit-sip-agent-example.git cd livekit-sip-agent-example npm install ``` -------------------------------- ### Project Structure (Text) Source: https://github.com/livekit-examples/livekit-sip-agent-example/blob/main/README.md Illustrates the directory and file structure of the LiveKit SIP Agent example project. ```txt . ├── src/ │ ├── agent.ts # Main agent implementation │ ├── setup-livekit.ts # LiveKit setup script │ └── setup-twilio.ts # Twilio setup script ├── .env.example # Example environment variables, copy to .env.local and fill in your own values ``` -------------------------------- ### Configure Environment Variables (Bash) Source: https://github.com/livekit-examples/livekit-sip-agent-example/blob/main/README.md Copies the example environment file and lists the required variables for LiveKit, OpenAI, and Twilio configuration. ```bash cp .env.example .env.local # Configure variables in .env.local: # LIVEKIT_API_KEY, LIVEKIT_API_SECRET, LIVEKIT_URL, LIVEKIT_SIP_URI # OPENAI_API_KEY # TWILIO_PHONE_NUMBER, TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_SIP_USERNAME, TWILIO_SIP_PASSWORD ``` -------------------------------- ### Agent Functions (TypeScript) Source: https://github.com/livekit-examples/livekit-sip-agent-example/blob/main/README.md Defines core functions for the LiveKit agent to manage a game, including ending the game, tracking points, and reporting scores. ```typescript // Ends the game and deletes the room after a 20-second delay gameEnd() // Tracks when the caller earns a point and updates their score userPoints() // Tracks when the agent earns a point and updates its score systemPoints() // Provides the current score status when requested by the caller pointsStatus() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.