-
Notifications
You must be signed in to change notification settings - Fork 7
CALLHANDLER STUCK #43
Copy link
Copy link
Open
Description
my code gets stuck there everytime , the phone becomes online but wont call
import asyncio
from PySIP.sip_account import SipAccount , SipCall
from dotenv import load_dotenv
import os
Load environment variables
load_dotenv()
Initialize SIP account with credentials from .env file
account = SipAccount(
os.environ["SIP_USERNAME"],
os.environ["SIP_PASSWORD"],
os.environ["SIP_SERVER"],
)
@account.on_incoming_call
async def handle_incoming_call(call: SipCall):
await call.accept()
await call.call_handler.say("We have received your call successfully")
async def main():
# Register the SIP account
await account.register()
# Make a call to a test number (e.g., '111')
call = account.make_call("111")
call_task = asyncio.create_task(call.start())
# Wait for the call to complete, then unregister
await call_task
await account.unregister()
if name == "main":
asyncio.run(main())
Reactions are currently unavailable
