Skip to content

Commit

Permalink
Merge pull request #177 from pipecat-ai/aleix/dialin-ready-missing-si…
Browse files Browse the repository at this point in the history
…puri

transports(daily): fix dialin-ready event handling
  • Loading branch information
aconchillo authored May 23, 2024
2 parents b1a6229 + 2a6183a commit fa9f49f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to **pipecat** will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.23] - 2024-05-23

### Fixed

- Fixed an issue handling Daily transport `dialin-ready` event.

## [0.0.22] - 2024-05-23

### Added
Expand Down
4 changes: 2 additions & 2 deletions src/pipecat/services/elevenlabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]:

async with self._aiohttp_session.post(url, json=payload, headers=headers, params=querystring) as r:
if r.status != 200:
logger.error(f"Audio fetch status code: {r.status}, error: {r.text}")
yield ErrorFrame(f"Audio fetch status code: {r.status}, error: {r.text}")
logger.error(f"Error getting audio (status: {r.status}, error: {r.text()})")
yield ErrorFrame(f"Error getting audio (status: {r.status}, error: {r.text()})")
return

async for chunk in r.content:
Expand Down
7 changes: 4 additions & 3 deletions src/pipecat/transports/services/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,17 +735,18 @@ async def _handle_dialin_ready(self, sip_endpoint: str):
"Authorization": f"Bearer {self._params.api_key}",
"Content-Type": "application/x-www-form-urlencoded"
}
querystring = {
data = {
"callId": self._params.dialin_settings.call_id,
"callDomain": self._params.dialin_settings.call_domain,
"sipUri": sip_endpoint
}

url = f"{self._params.api_url}/dialin/pinlessCallUpdate"

async with session.post(url, headers=headers, params=querystring) as r:
async with session.post(url, headers=headers, data=data) as r:
if r.status != 200:
logger.error(
f"Unable to handle dialin-ready event (status: {r.status}, error: {r.text})")
f"Unable to handle dialin-ready event (status: {r.status}, error: {r.text()})")
return

logger.debug("dialin-ready event handled successfully")
Expand Down

0 comments on commit fa9f49f

Please sign in to comment.