Skip to content

Commit

Permalink
Merge pull request #718 from vocodedev/main
Browse files Browse the repository at this point in the history
Update vocodehq-public
  • Loading branch information
vocode-petern authored Oct 10, 2024
2 parents 2c32288 + fb8e079 commit 3692c58
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions vocode/streaming/action/transfer_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ async def transfer_call(self, twilio_call_sid: str, to_phone: str):

payload = {"Twiml": twiml_data}

async with AsyncRequestor().get_session() as session:
async with session.post(url, data=payload, auth=twilio_client.auth) as response:
if response.status != 200:
logger.error(f"Failed to transfer call: {response.status} {response.reason}")
raise Exception("failed to update call")
else:
return await response.json()
async with AsyncRequestor().get_session().post(
url, data=payload, auth=twilio_client.auth
) as response:
if response.status != 200:
logger.error(f"Failed to transfer call: {response.status} {response.reason}")
raise Exception("failed to update call")
else:
return await response.json()

async def run(
self, action_input: ActionInput[TransferCallParameters]
Expand Down

0 comments on commit 3692c58

Please sign in to comment.