feat: telephony call transfer (#155)

* transfer call

* fix: ignore completed call status

* chore: refactor telephony

* chore: refactor pipecat engine custom tools and other telephony services

* chore: code refactor

* chore: put back office ambient sound files

* chore: remove transport from engine

* fix: fix alembic revision

* chore: remove set_transferring_call from engine

* fix: send OutputAudio frame and let transport chunk it

* fix: reinstate docker compose

* chore: remove unused transfer-twmil route for caller

* chore: update pipecat submodule

---------

Co-authored-by: Abhishek Kumar <abhishek@a6k.me>
This commit is contained in:
Sabiha Khan 2026-02-16 14:33:33 +05:30 committed by GitHub
parent 5d14d17ceb
commit c711920165
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 1965 additions and 128 deletions

View file

@ -309,3 +309,46 @@ class TelephonyProvider(ABC):
Tuple of (Response, media_type) - Response object and content type
"""
pass
# ======== CALL TRANSFER METHODS ========
@abstractmethod
async def transfer_call(
self,
destination: str,
transfer_id: str,
conference_name: str,
timeout: int = 30,
**kwargs: Any,
) -> Dict[str, Any]:
"""
Initiate a call transfer to a destination number.
Args:
destination: The destination phone number (E.164 format)
transfer_id: Unique identifier for tracking this transfer
conference_name: Name of the conference to join the destination into
timeout: Transfer timeout in seconds
**kwargs: Provider-specific additional parameters
Returns:
Dict containing:
- call_sid: Provider's call identifier
- status: Transfer initiation status
- provider: Provider name
Raises:
NotImplementedError: If provider doesn't support transfers
ValueError: If provider configuration is invalid
"""
pass
@abstractmethod
def supports_transfers(self) -> bool:
"""
Check if this provider supports call transfers.
Returns:
True if provider supports call transfers, False otherwise
"""
pass