Skip to content

call.from_number and call.to_number missing #107

Description

@seven1240
from signalwire.relay.consumer import Consumer
import os
import time

class CustomConsumer(Consumer):
  def setup(self):
    self.project = os.getenv("SW_PROJECT")
    self.token = os.getenv("SW_TOKEN")
    self.contexts = ['office']
    self.devices = [
    ]

  async def on_incoming_call(self, call):
    print(f"{time.strftime('%X')} received call {call.id} from {call.from_number} to {call.to_number}")

    result = await call.connect(device_list=[{
        'from_number': call.from_number,
        'to_number': call.to_number,
    }])
    if result.successful:
      remote_call = result.call
      # Wait until the remote leg is ended..
      await remote_call.wait_for_ended()
    await call.hangup()

consumer = CustomConsumer()
consumer.run()

the log shows none

00:34:57 received call f2ec5b83-72b1-487d-8be9-75945361f428 from None to None

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions