Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call.from_number and call.to_number missing #107

Open
seven1240 opened this issue May 15, 2024 · 1 comment
Open

call.from_number and call.to_number missing #107

seven1240 opened this issue May 15, 2024 · 1 comment

Comments

@seven1240
Copy link

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.

@seven1240
Copy link
Author

It's from a SIP call, seems it should be from and to but not handled in https://github.com/signalwire/signalwire-python/blob/master/signalwire/relay/calling/call.py#L47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant