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
| Name | Type | Required | Description |
|---|---|---|---|
Peer | InputPhoneCall | yes | The call to accept |
GB | []byte | yes | Parameter for E2E encryption key exchange » |
Protocol | PhoneCallProtocol | yes | Phone call settings |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CALL_ALREADY_ACCEPTED | The call was already accepted. |
| 400 | CALL_ALREADY_DECLINED | The call was already declined. |
| 500 | CALL_OCCUPY_FAILED | The call failed because the user is already making another call. |
| 400 | CALL_PEER_INVALID | The provided call peer object is invalid. |
| 406 | CALL_PROTOCOL_COMPAT_LAYER_INVALID | The 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. |
| 400 | CALL_PROTOCOL_FLAGS_INVALID | Call protocol flags invalid. |
| 400 | CALL_PROTOCOL_LAYER_INVALID | The specified protocol layer version range is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
phone.acceptCall#3bd2b4a0