Open dauheeIRL opened 3 years ago
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)
I face the same problem using the ALSA version modified for incoming calls. The call never terminate and the alsa is left busy.
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
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)