rpc

package
v0.0.0-...-6e21e7b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PHONE_STATE_UNKNOWN = iota
	PHONE_STATE_REQUEST_CALL
)

Variables

This section is empty.

Functions

func NewCallConfigDataJSON

func NewCallConfigDataJSON() *callConfigDataJSON

TODO(@benqi): 写死配置

Types

type PhoneServiceImpl

type PhoneServiceImpl struct {
}

func (*PhoneServiceImpl) PhoneAcceptCall

func (s *PhoneServiceImpl) PhoneAcceptCall(ctx context.Context, request *mtproto.TLPhoneAcceptCall) (*mtproto.Phone_PhoneCall, error)

https://core.telegram.org/api/end-to-end/voice-calls

B accepts the call on one of their devices, stores the received value of g_a_hash for this instance of the voice call creation protocol, chooses a random value of b, 1 < b < p-1, computes g_b:=power(g,b) mod p, performs all the required security checks, and invokes the phone.acceptCall method, which has a g_b:bytes field (among others), to be filled with the value of g_b itself (not its hash).

The Server S sends an updatePhoneCall with the phoneCallDiscarded constructor to all other devices B has authorized, to prevent accepting the same call on any of the other devices. From this point on, the server S works only with that of B's devices which has invoked phone.acceptCall first.

phone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall;

func (*PhoneServiceImpl) PhoneConfirmCall

func (s *PhoneServiceImpl) PhoneConfirmCall(ctx context.Context, request *mtproto.TLPhoneConfirmCall) (*mtproto.Phone_PhoneCall, error)

phone.confirmCall#2efe1722 peer:InputPhoneCall g_a:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall;

func (*PhoneServiceImpl) PhoneDiscardCall

func (s *PhoneServiceImpl) PhoneDiscardCall(ctx context.Context, request *mtproto.TLPhoneDiscardCall) (*mtproto.Updates, error)

phone.discardCall#78d413a6 peer:InputPhoneCall duration:int reason:PhoneCallDiscardReason connection_id:long = Updates;

func (*PhoneServiceImpl) PhoneGetCallConfig

func (s *PhoneServiceImpl) PhoneGetCallConfig(ctx context.Context, request *mtproto.TLPhoneGetCallConfig) (*mtproto.DataJSON, error)

phone.getCallConfig#55451fa9 = DataJSON;

func (*PhoneServiceImpl) PhoneReceivedCall

func (s *PhoneServiceImpl) PhoneReceivedCall(ctx context.Context, request *mtproto.TLPhoneReceivedCall) (*mtproto.Bool, error)

phone.receivedCall#17d54f61 peer:InputPhoneCall = Bool;

func (*PhoneServiceImpl) PhoneRequestCall

func (s *PhoneServiceImpl) PhoneRequestCall(ctx context.Context, request *mtproto.TLPhoneRequestCall) (*mtproto.Phone_PhoneCall, error)

phone.requestCall#5b95b3d4 user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall;

func (*PhoneServiceImpl) PhoneSaveCallDebug

func (s *PhoneServiceImpl) PhoneSaveCallDebug(ctx context.Context, request *mtproto.TLPhoneSaveCallDebug) (*mtproto.Bool, error)

phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool;

func (*PhoneServiceImpl) PhoneSetCallRating

func (s *PhoneServiceImpl) PhoneSetCallRating(ctx context.Context, request *mtproto.TLPhoneSetCallRating) (*mtproto.Updates, error)

phone.setCallRating#1c536a34 peer:InputPhoneCall rating:int comment:string = Updates;

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL