Fix README.md
This commit is contained in:
@@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
This repository contains two server implementations for handling
|
This repository contains two server implementations for handling
|
||||||
the pinless dialin workflow in pipecat cloud. This is the companion to the
|
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
|
In addition you can use `/api/dial` to trigger dial-out, and
|
||||||
eventually, call-transfers.
|
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
|
A FastAPI implementation that handles PSTN (Public Switched Telephone
|
||||||
Network) and SIP (Session Initiation Protocol) calls using the Daily API.
|
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
|
A Next.js API implementation designed for deployment on Vercel's
|
||||||
serverless platform.
|
serverless platform.
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ Both implementations provide:
|
|||||||
### Environment Variables
|
### Environment Variables
|
||||||
|
|
||||||
Both implementations require similar 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
|
- `AGENT_NAME`: Your Daily agent name
|
||||||
- `PINLESS_HMAC_SECRET`: Your HMAC secret for request verification
|
- `PINLESS_HMAC_SECRET`: Your HMAC secret for request verification
|
||||||
- `LOG_LEVEL`: (Optional) Logging level (defaults to 'info')
|
- `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
|
See the individual README files in each implementation directory for
|
||||||
specific setup instructions.
|
specific setup instructions.
|
||||||
|
|
||||||
### ### Phone number setup
|
### Phone number setup
|
||||||
|
|
||||||
You can buy a phone number through the Pipecat Cloud Dashboard:
|
You can buy a phone number through the Pipecat Cloud Dashboard:
|
||||||
1. Go to `Settings` > `Telephony`
|
1. Go to `Settings` > `Telephony`
|
||||||
2. Follow the UI to purchase a phone number
|
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
|
Or purchase the number using Daily's
|
||||||
[PhoneNumbers API](https://docs.daily.co/reference/rest-api/phone-numbers).
|
[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
|
In the meantime, the server described below serves as the webhook
|
||||||
handler for the `room_creation_api`. Configure your pinless phone
|
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.
|
the actual server URL, append `/api/dial` to the webhook URL.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Examples curl commands
|
## Examples curl commands
|
||||||
|
|
||||||
Note: Replace `http://localhost:3000` with your actual server URL and
|
Note: Replace `http://localhost:3000` with your actual server URL and
|
||||||
|
|||||||
@@ -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.
|
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
|
## Setup
|
||||||
|
|
||||||
1. Clone the repository
|
1. Clone the repository
|
||||||
@@ -19,22 +9,23 @@ A FastAPI server that handles PSTN (Public Switched Telephone Network) and SIP (
|
|||||||
```bash
|
```bash
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
3. Copy `.env.example` to `.env`:
|
3. Copy `env.example` to `.env`:
|
||||||
```bash
|
```bash
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
```
|
```
|
||||||
4. Update `.env` with your credentials:
|
4. Update `.env` with your credentials:
|
||||||
- `AGENT_NAME`: Your Daily agent name
|
- `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
|
- `PINLESS_HMAC_SECRET`: Your HMAC secret for request verification
|
||||||
|
|
||||||
## Running the Server
|
## Running the Server
|
||||||
|
3. Copy `env.example` to `.env`:
|
||||||
Start the server with:
|
Start the server with:
|
||||||
```bash
|
```bash
|
||||||
python server.py
|
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
|
## API Endpoints
|
||||||
|
|
||||||
@@ -78,5 +69,7 @@ Returns a JSON object containing:
|
|||||||
|
|
||||||
## Error Handling
|
## Error Handling
|
||||||
- 401: Invalid signature
|
- 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)
|
- 500: Server errors (missing API key, network issues)
|
||||||
- Other status codes are passed through from the Daily API
|
- Other status codes are passed through from the Daily API
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Next.js API routes for handling Daily Pipecat requests.
|
|||||||
```
|
```
|
||||||
3. Create `.env.local` file with your credentials:
|
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
|
AGENT_NAME=my-first-agent
|
||||||
PINLESS_HMAC_SECRET=your_hmac_secret
|
PINLESS_HMAC_SECRET=your_hmac_secret
|
||||||
LOG_LEVEL=info
|
LOG_LEVEL=info
|
||||||
@@ -69,7 +69,7 @@ The application is configured for Vercel deployment:
|
|||||||
1. Push your code to a Git repository
|
1. Push your code to a Git repository
|
||||||
2. Import your project in Vercel dashboard
|
2. Import your project in Vercel dashboard
|
||||||
3. Configure environment variables:
|
3. Configure environment variables:
|
||||||
- `DAILY_API_KEY`
|
- `PIPECAT_CLOUD_API_KEY`
|
||||||
- `AGENT_NAME`
|
- `AGENT_NAME`
|
||||||
- `PINLESS_HMAC_SECRET`
|
- `PINLESS_HMAC_SECRET`
|
||||||
- `LOG_LEVEL` (optional, defaults to 'info')
|
- `LOG_LEVEL` (optional, defaults to 'info')
|
||||||
|
|||||||
Reference in New Issue
Block a user