Skip to main content

phone.requestCall

Start a telegram phone call, see here » for more info on the full flow.

func (c *Client) PhoneRequestCall(ctx context.Context, request *PhoneRequestCallRequest) (*PhonePhoneCall, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.PhoneRequestCall(ctx, &tg.PhoneRequestCallRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *PhonePhoneCall
return nil
})

Parameters

NameTypeRequiredDescription
VideoboolWhether to start a video call
UserIDInputUserClassyesDestination of the phone call
RandomIDintyesRandom ID to avoid resending the same object
GAHash[]byteyesParameter for E2E encryption key exchange »
ProtocolPhoneCallProtocolyesPhone call settings

Returns

*PhonePhoneCall

Possible errors

CodeTypeDescription
400CALL_PROTOCOL_FLAGS_INVALIDCall protocol flags invalid.
400CALL_PROTOCOL_LAYER_INVALIDThe specified protocol layer version range is invalid.
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
500PARTICIPANT_CALL_FAILED
400PARTICIPANT_VERSION_OUTDATEDThe other participant does not use an up to date telegram client with support for calls.
500RANDOM_ID_DUPLICATEYou provided a random ID that was already used.
400USER_ID_INVALIDThe provided user ID is invalid.
403USER_IS_BLOCKEDYou were blocked by this user.
403USER_PRIVACY_RESTRICTEDThe user's privacy settings do not allow you to do this.

References