alexander-akhmetov/python-telegram

block parameter for call_method

ygazaryan opened this issue · 2 comments

I'm trying to make a voice call in sync mode but still get an async result.

Here is a piece of code:

json_request = {                                               
    'user_id': chat_id,                                       
    'is_video': False,                                        
    'protocol': {                                             
        'udp_p2p': True,                                      
        'udp_reflector': True,                                
        'min_layer': 65,                                      
        'max_layer': 65                                       
    }                                                         
}                                                             
                                                              
ring = tg.call_method('createCall', json_request, block=True) 

call_method completes but I see that call is still in progress :(

Also, there is an issue seems in TDLib when I receiving a voice call from telegram instance, sometimes call goes to background and I stop hearing my ringtone which is also a big trouble because my notification system unable to notify users for example in night hours. Probably, it's not an issue with python-telegram wrapper but maybe you have some experience about it and can suggest something :)

Hi! The block=True parameter only waits until the response is received from tdlib for the method call. I suspect that as soon as the call is created (or a request is received by tdlib), it returns, without waiting for the call to finish. It's possible that tdlib returns a call ID, which you could use to check the status of the call (this might be helpful, I'd also check what is inside ring.result). Sorry, I'm not familiar with calls in tdlib. :)

Hi! The block=True parameter only waits until the response is received from tdlib for the method call. I suspect that as soon as the call is created (or a request is received by tdlib), it returns, without waiting for the call to finish. It's possible that tdlib returns a call ID, which you could use to check the status of the call (this might be helpful, I'd also check what is inside ring.result). Sorry, I'm not familiar with calls in tdlib. :)

Thanks for explanation, in this way I will handle it my code and will update call manually if it's not successful in any pre-defined timeout.
Accoding to voice calls problem, it's seems that this is bug in iOS, calls from telegram instance to android works well. Also desktop client works as usual phone call. Seems that this is the new issue and comes from recent iOS telegram app updates.

I raised a bug to telegram:
https://bugs.telegram.org/c/26392

and will appreciate if anybody can test and confirm that the issue exist and left the comment about it.