From 18b56d4a100ed3a6a0dba33f1eeb799834c998dd Mon Sep 17 00:00:00 2001 From: Varun Singh <382354+vr000m@users.noreply.github.com> Date: Tue, 1 Apr 2025 23:32:50 -0700 Subject: [PATCH] Fix README.md --- examples/pcc-dialin-server/README.md | 16 ++++++------- .../pcc-dialin-server/simple-python/README.md | 23 +++++++------------ examples/pcc-dialin-server/vercel/readme.md | 4 ++-- 3 files changed, 17 insertions(+), 26 deletions(-) diff --git a/examples/pcc-dialin-server/README.md b/examples/pcc-dialin-server/README.md index 61dea4bf9..93181927f 100644 --- a/examples/pcc-dialin-server/README.md +++ b/examples/pcc-dialin-server/README.md @@ -2,15 +2,15 @@ This repository contains two server implementations for handling the pinless dialin workflow in pipecat cloud. This is the companion to the -[pstn/sip pcc starter images](https://github.com/daily-co/pipecat-cloud-images/tree/vr000m-starter-image-dial-in-out/pipecat-starters/pstn_sip). +Pipecat Cloud [pstn_sip starter image](https://github.com/daily-co/pipecat-cloud-images/tree/main/pipecat-starters/pstn_sip). In addition you can use `/api/dial` to trigger dial-out, and eventually, call-transfers. -1. [Simple Python Server](simple-python/README.md) - +1. [FastAPI Server](simple-python/README.md) - A FastAPI implementation that handles PSTN (Public Switched Telephone Network) and SIP (Session Initiation Protocol) calls using the Daily API. -2. [Vercel Serverless](vercel/readme.md) - +2. [Vercel Serverless](vercel/README.md) - A Next.js API implementation designed for deployment on Vercel's serverless platform. @@ -39,7 +39,7 @@ Both implementations provide: ### Environment Variables Both implementations require similar environment variables: -- `DAILY_API_KEY`: Your Daily API key +- `PIPECAT_CLOUD_API_KEY`: Pipecat Cloud API Key, begins with pk_* - `AGENT_NAME`: Your Daily agent name - `PINLESS_HMAC_SECRET`: Your HMAC secret for request verification - `LOG_LEVEL`: (Optional) Logging level (defaults to 'info') @@ -47,12 +47,12 @@ Both implementations require similar environment variables: See the individual README files in each implementation directory for specific setup instructions. -### ### Phone number setup +### Phone number setup You can buy a phone number through the Pipecat Cloud Dashboard: 1. Go to `Settings` > `Telephony` 2. Follow the UI to purchase a phone number -3. Configure the webhook URL to receive incoming calls +3. Configure the webhook URL to receive incoming calls (e.g. `https://my-webhook-url.com/api/dial`) Or purchase the number using Daily's [PhoneNumbers API](https://docs.daily.co/reference/rest-api/phone-numbers). @@ -86,11 +86,9 @@ to `{service}/start` that will manage this for you. In the meantime, the server described below serves as the webhook handler for the `room_creation_api`. Configure your pinless phone -number or sip interconnect to the `ngrok` tunnel or +number or SIP interconnect to the `ngrok` tunnel or the actual server URL, append `/api/dial` to the webhook URL. - - ## Examples curl commands Note: Replace `http://localhost:3000` with your actual server URL and diff --git a/examples/pcc-dialin-server/simple-python/README.md b/examples/pcc-dialin-server/simple-python/README.md index 1cb8114a7..53faa0ea8 100644 --- a/examples/pcc-dialin-server/simple-python/README.md +++ b/examples/pcc-dialin-server/simple-python/README.md @@ -1,17 +1,7 @@ -# Daily PSTN/SIP Server +# PSTN/SIP Webhook Handler A FastAPI server that handles PSTN (Public Switched Telephone Network) and SIP (Session Initiation Protocol) calls using the Daily API. -## Requirements - -- Python 3.8+ -- FastAPI -- Uvicorn -- Python-dotenv -- Requests -- Pydantic -- Loguru - ## Setup 1. Clone the repository @@ -19,22 +9,23 @@ A FastAPI server that handles PSTN (Public Switched Telephone Network) and SIP ( ```bash pip install -r requirements.txt ``` -3. Copy `.env.example` to `.env`: +3. Copy `env.example` to `.env`: ```bash cp .env.example .env ``` 4. Update `.env` with your credentials: - `AGENT_NAME`: Your Daily agent name - - `DAILY_API_KEY`: Your Daily API key + - `PIPECAT_CLOUD_API_KEY`: Your Daily API key - `PINLESS_HMAC_SECRET`: Your HMAC secret for request verification ## Running the Server - +3. Copy `env.example` to `.env`: Start the server with: ```bash python server.py ``` -The server will run on `http://localhost:3000` +The server will run on `http://localhost:3000` and you can expose it via ngrok for testing: +`ngrok http 3000` ## API Endpoints @@ -78,5 +69,7 @@ Returns a JSON object containing: ## Error Handling - 401: Invalid signature +- 400: Invalid authorization header (e.g. missing Daily API key in bot.py) +- 405: Method not allowed (e.g. incorrect route on the webhook URL) - 500: Server errors (missing API key, network issues) - Other status codes are passed through from the Daily API diff --git a/examples/pcc-dialin-server/vercel/readme.md b/examples/pcc-dialin-server/vercel/readme.md index 255569396..8a00d2b17 100644 --- a/examples/pcc-dialin-server/vercel/readme.md +++ b/examples/pcc-dialin-server/vercel/readme.md @@ -20,7 +20,7 @@ Next.js API routes for handling Daily Pipecat requests. ``` 3. Create `.env.local` file with your credentials: ``` - DAILY_API_KEY=your_daily_api_key + PIPECAT_CLOUD_API_KEY=pk_* AGENT_NAME=my-first-agent PINLESS_HMAC_SECRET=your_hmac_secret LOG_LEVEL=info @@ -69,7 +69,7 @@ The application is configured for Vercel deployment: 1. Push your code to a Git repository 2. Import your project in Vercel dashboard 3. Configure environment variables: - - `DAILY_API_KEY` + - `PIPECAT_CLOUD_API_KEY` - `AGENT_NAME` - `PINLESS_HMAC_SECRET` - `LOG_LEVEL` (optional, defaults to 'info')