fixes review comments
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
PINLESS_HMAC_SECRET=your_hmac_secret
|
||||
DAILY_API_KEY=your_daily_api_key
|
||||
PIPECAT_CLOUD_API_KEY=your_daily_api_key
|
||||
AGENT_NAME=my-first-agent
|
||||
PORT=8000
|
||||
3595
examples/pcc-dialin-server/vercel/package-lock.json
generated
3595
examples/pcc-dialin-server/vercel/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -3,9 +3,9 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"dev": "next dev -p 7860",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"start": "next start -p 7860",
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { logger } from '../../lib/utils';
|
||||
import { logger } from '../../lib/utils';
|
||||
import axios from 'axios';
|
||||
import crypto from 'crypto';
|
||||
|
||||
const validateSignature = (body, signature, timestamp, secret) => {
|
||||
// Skip if any required fields are missing
|
||||
if (!signature || !timestamp || !secret) {
|
||||
logger.warn('Missing required fields for HMAC validation');
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -99,7 +100,7 @@ export default async function handler(req, res) {
|
||||
// Configure SIP if dialin settings are provided
|
||||
if (dialin_settings !== null) {
|
||||
const sip_config = {
|
||||
display_name: 'dialin',
|
||||
display_name: From,
|
||||
sip_mode: 'dial-in',
|
||||
num_endpoints: call_transfer !== null ? 2 : 1,
|
||||
};
|
||||
@@ -121,16 +122,16 @@ export default async function handler(req, res) {
|
||||
logger.debug(`Daily room properties: ${JSON.stringify(daily_room_properties)}`);
|
||||
|
||||
// Get Daily API key and agent name from environment variables
|
||||
const dailyApiKey = process.env.DAILY_API_KEY;
|
||||
const pccApiKey = process.env.PIPECAT_CLOUD_API_KEY;
|
||||
const agentName = process.env.AGENT_NAME || 'my-first-agent';
|
||||
|
||||
if (!dailyApiKey) {
|
||||
throw new Error('DAILY_API_KEY environment variable is not set');
|
||||
if (!pccApiKey) {
|
||||
throw new Error('PIPECAT_CLOUD_API_KEY environment variable is not set');
|
||||
}
|
||||
|
||||
// Set up headers for Daily API call
|
||||
const headers = {
|
||||
'Authorization': `Bearer ${dailyApiKey}`,
|
||||
'Authorization': `Bearer ${pccApiKey}`,
|
||||
'Content-Type': 'application/json',
|
||||
};
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ import { logger } from '../../lib/utils';
|
||||
|
||||
export default function handler(req, res) {
|
||||
logger.info('Received request to /api');
|
||||
res.status(200).json({ message: 'Hello, World! from ฅ^•ﻌ•^ฅ ☁' });
|
||||
res.status(200).json({ message: 'Hello, World! from ᓚᘏᗢ' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user