Skip to main content

phone.acceptCall

Accept incoming call, see here » for more info on the full flow.

func (c *Client) PhoneAcceptCall(ctx context.Context, request *PhoneAcceptCallRequest) (*PhonePhoneCall, error)

Calling this method

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

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

Parameters

NameTypeRequiredDescription
PeerInputPhoneCallyesThe call to accept
GB[]byteyesParameter for E2E encryption key exchange »
ProtocolPhoneCallProtocolyesPhone call settings

Returns

*PhonePhoneCall

Possible errors

CodeTypeDescription
400CALL_ALREADY_ACCEPTEDThe call was already accepted.
400CALL_ALREADY_DECLINEDThe call was already declined.
500CALL_OCCUPY_FAILEDThe call failed because the user is already making another call.
400CALL_PEER_INVALIDThe provided call peer object is invalid.
406CALL_PROTOCOL_COMPAT_LAYER_INVALIDThe other side of the call does not support any of the VoIP protocols supported by the local client, as specified by the protocol.layer and protocol.library_versions fields.
400CALL_PROTOCOL_FLAGS_INVALIDCall protocol flags invalid.
400CALL_PROTOCOL_LAYER_INVALIDThe specified protocol layer version range is invalid.

References