zerobias / telegram-mtproto

Telegram client api (MTProto) library
MIT License
617 stars 136 forks source link

Receive phone call instead of SMS using allow_flashcall flag #204

Closed ArielS1 closed 5 years ago

ArielS1 commented 6 years ago

Hi,

I'm trying to call auth.sendCode method and getting a phone call instead of SMS without success. when i add to the parameters the allow_flashcall parameter assigned to true the request fails with INPUT_FETCH_ERROR.

this is how i send it:

  client('auth.sendCode', {
    phone_number: '441111111111',
    api_id: 1111,
    api_hash: 'dffddffdfdfd',
    allow_flashcall: true,
    current_number: true,
  });

Does the allow_flashcall value if not sent is default to true? then why don't i get a call? if not, then how can i use this parameter correctly? maybe am i doing something wrong because i saw in the schema that the parameter somehow belongs with "flags" and i need to send it with a different way. tried different variations like in: flags: { allow_flashcall: true } instead in the main object like on the example

julestechting commented 6 years ago

Hi, Not sure if you solved this issue. In case you haven't: I had the same problem on the dev server and couldn't use the 'allow_flashcall' option. But I found a workaround: after calling 'auth.sendCode', I run 'auth.resendCode' using the 'phone_code_hash' obtained by 'auth.sendCode' and I got the phone call with the code. auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode; Note: I haven't tried on the prod server.