// getInboundCall returns the inbound call on this context or nil.
326071
func getInboundCall(ctx context.Context) (*InboundCall, bool) {
	call, ok := ctx.Value(inboundCallKey{}).(*InboundCall)
	return call, ok
}
1296469
func newInbound(t *Transport, listener net.Listener, options ...InboundOption) *Inbound {
	return &Inbound{
		once:     lifecycle.NewOnce(),
		t:        t,
		listener: listener,
		options:  newInboundOptions(options),
	}
}
232133
func InitiateCall(client *messagebird.Client, source, destination string, callflow CallFlow, webhook *Webhook) (*Call, error) {
	body := struct {
		Source      string   `json:"source"`
		Destination string   `json:"destination"`
		Callflow    CallFlow `json:"callflow"`
		Webhook     struct {
			URL   string `json:"url,omitempty"`
			Token string `json:"token,omitempty"`
		}
	}{
		Source:      source,
		Destination: destination,
		Callflow:    callflow,
	}
	if webhook != nil {
		body.Webhook.URL = webhook.URL
		body.Webhook.Token = webhook.Token
	}
	var resp struct {
		Data []Call `json:"data"`
	}
	if err := client.Request(&resp, http.MethodPost, apiRoot+"/calls", body); err != nil {
		return nil, err
	}
	return &resp.Data[0], nil
}
212804
func (t *precompilationTypeChecker) AcceptCall(v tree.Call) {
	t.result = fmt.Errorf("no calls allowed - this is probably a programmer error: %s", tree.ExpressionString(v))
}
114544
func (fc facadeCaller) FacadeCall(request string, params, response interface{}) error {
	return fc.caller.APICall(
		fc.facadeName, fc.bestVersion, "",
		request, params, response)
}
233713
func (s *TelephonySettings) SetInboundCalling(v bool) *TelephonySettings {
	s.InboundCalling = &v
	return s
}
251855
func GetDialer() TabletDialer {
	td, ok := dialers[*TabletProtocol]
	if !ok {
		log.Exitf("No dialer registered for tablet protocol %s", *TabletProtocol)
	}
	return td
}
159848
func Call(ctx context.Context, request Request, response interface{}, opts ...CallOption) error {
	return DefaultClient.Call(ctx, request, response, opts...)
}
665019
func findCaller() *CallerInfo {
	for i := 3; ; i++ {
		pc, filepath, line, ok := runtime.Caller(i)
		if !ok {
			return UnknownCallerInfo
		}
		parts := strings.Split(filepath, "/")
		dir := parts[len(parts)-2]
		file := parts[len(parts)-1]
		if (dir != thisPackageName) || (file != thisFileName) {
			funcName := runtime.FuncForPC(pc).Name()
			return &CallerInfo{
				PathName: filepath,
				FileName: file,
				LineNo:   uint32(line),
				FuncName: funcName,
			}
		}
	}
}
1210179
func (client *lockRESTClient) restCall(call string, args dsync.LockArgs) (reply bool, err error) {

	reader := bytes.NewBuffer(make([]byte, 0, 2048))
	err = gob.NewEncoder(reader).Encode(args)
	if err != nil {
		return false, err
	}
	respBody, err := client.call(call, nil, reader, -1)
	if err != nil {
		return false, err
	}

	var resp lockResponse
	defer http.DrainBody(respBody)
	err = gob.NewDecoder(respBody).Decode(&resp)

	if err != nil || !resp.Success {
		reqInfo := &logger.ReqInfo{}
		reqInfo.AppendTags("resource", args.Resource)
		reqInfo.AppendTags("serveraddress", args.ServerAddr)
		reqInfo.AppendTags("serviceendpoint", args.ServiceEndpoint)
		reqInfo.AppendTags("source", args.Source)
		reqInfo.AppendTags("uid", args.UID)
		ctx := logger.SetReqInfo(context.Background(), reqInfo)
		logger.LogIf(ctx, err)
	}
	return resp.Success, err
}
563514
func (l *State) ProtectedCallWithContinuation(argCount, resultCount, errorFunction, context int, continuation Function) (err error) {
	if apiCheck && continuation != nil && l.callInfo.isLua() {
		panic("cannot use continuations inside hooks")
	}
	l.checkElementCount(argCount + 1)
	if apiCheck && l.shouldYield {
		panic("cannot do calls on non-normal thread")
	}
	l.checkResults(argCount, resultCount)
	if errorFunction != 0 {
		apiCheckStackIndex(errorFunction, l.indexToValue(errorFunction))
		errorFunction = l.AbsIndex(errorFunction)
	}

	f := l.top - (argCount + 1)

	if continuation == nil || l.nonYieldableCallCount > 0 {
		err = l.protectedCall(func() { l.call(f, resultCount, false) }, f, errorFunction)
	} else {
		c := l.callInfo
		c.continuation, c.context, c.extra, c.oldAllowHook, c.oldErrorFunction = continuation, context, f, l.allowHook, l.errorFunction
		l.errorFunction = errorFunction
		l.callInfo.setCallStatus(callStatusYieldableProtected)
		l.call(f, resultCount, true)
		l.callInfo.clearCallStatus(callStatusYieldableProtected)
		l.errorFunction = c.oldErrorFunction
	}
	l.adjustResults(resultCount)
	return
}
550770
func (mr *MockRPCClientMockRecorder) RemoteCall(contextID, methodName, req, resp interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoteCall", reflect.TypeOf((*MockRPCClient)(nil).RemoteCall), contextID, methodName, req, resp)
}
1148050
func (w *clientWrapper) Call(
	ctx context.Context,
	req client.Request,
	rsp interface{},
	opts ...client.CallOption) (err error) {
	t := newRequestTracker(req, ClientProfile)
	ctx = t.start(ctx, true)

	defer func() { t.end(ctx, err) }()

	ctx = injectTraceIntoCtx(ctx, t.span)

	err = w.Client.Call(ctx, req, rsp, opts...)
	return
}
76181
func retrieveCallInfo() *callInfo {
	pc, file, line, _ := runtime.Caller(3)
	_, fileName := path.Split(file)
	parts := strings.Split(runtime.FuncForPC(pc).Name(), ".")
	pl := len(parts)
	packageName := ""
	funcName := parts[pl-1]

	if parts[pl-2][0] == '(' {
		funcName = parts[pl-2] + "." + funcName
		packageName = strings.Join(parts[0:pl-2], ".")
	} else {
		packageName = strings.Join(parts[0:pl-1], ".")
	}

	packageParts := strings.Split(packageName, "/")
	packagePart := strings.ToUpper(packageParts[len(packageParts)-1])

	return &callInfo{
		packageName: packageName,
		packagePart: packagePart,
		fileName:    fileName,
		funcName:    funcName,
		line:        line,
	}
}
653086
func GetSyscall(name string) (uint32, bool) {
	res, ok := Syscalls[strings.ToLower(name)]
	return uint32(res), ok
}
351552
func WrapCall(cw ...CallWrapper) Option {
	return func(o *Options) {
		o.CallOptions.CallWrappers = append(o.CallOptions.CallWrappers, cw...)
	}
}
356860
func (v *evalVisitor) wasFuncCall(node *ast.Expression) bool {
	// check if expression was tagged as a function call
	return v.exprFunc[node]
}