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

make_call.py, await pyrogram.idle() never reached #7

Open
dauheeIRL opened this issue Dec 31, 2020 · 3 comments
Open

make_call.py, await pyrogram.idle() never reached #7

dauheeIRL opened this issue Dec 31, 2020 · 3 comments

Comments

@dauheeIRL
Copy link

Hi, in make_call.py, await pyrogram.idle() is never reached and the program runs forever. What I did as a kludge was to put sys.exit() in end of async def call_ended(call)

@StefanoGiu
Copy link

StefanoGiu commented Jan 20, 2021

Same issue here....

I'm using this....

async def main():
    global in_call
    in_call = True
    await client.start()
    call = await voip_service.start_call('@XXX')
    call.play('input.raw')
    call.play_on_hold(['input.raw'])
    call.set_output_file('output.raw')
   @call.on_call_state_changed
    def state_changed(call, state):
        print('State changed:', call, state)

    @call.on_call_ended
    async def call_ended(call):
        print('Call Ended!!')
        await asyncio.sleep(5)
        await client.stop()
        global in_call
        in_call = False

    while in_call:
        await asyncio.sleep(1)

@supersuperfranz
Copy link

I face the same problem using the ALSA version modified for incoming calls.
The call never terminate and the alsa is left busy.

@joel122002
Copy link

pyrogram.idle() is meant to put the app in a state such that it only closes when a signal (i.e. Ctrl + C) is given. In order to change that behaviour you could use @StefanoGiu's answer

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

4 participants