diff --git a/apps/web/app/react_ui_samples/sipIncoming/content.tsx b/apps/web/app/react_ui_samples/sipIncoming/content.tsx index 6d9b6fa..074b5b9 100644 --- a/apps/web/app/react_ui_samples/sipIncoming/content.tsx +++ b/apps/web/app/react_ui_samples/sipIncoming/content.tsx @@ -45,7 +45,7 @@ export default function PageContent({ callFrom, callWs, room, peer, token, recor }} > - + } diff --git a/packages/sdk-core/generate_protobuf.sh b/packages/sdk-core/generate_protobuf.sh index 87f7148..c90be27 100755 --- a/packages/sdk-core/generate_protobuf.sh +++ b/packages/sdk-core/generate_protobuf.sh @@ -5,5 +5,6 @@ PROTO_DIR=./src/generated/protobuf protoc -I=${PROTO_SRC} \ --plugin=node_modules/ts-proto/protoc-gen-ts_proto \ + --ts_proto_opt=esModuleInterop=true \ --ts_proto_out=${PROTO_DIR} \ ${PROTO_SRC}/*.proto diff --git a/packages/sdk-core/package.json b/packages/sdk-core/package.json index fa6da36..1aaa29a 100644 --- a/packages/sdk-core/package.json +++ b/packages/sdk-core/package.json @@ -1,6 +1,6 @@ { "name": "@atm0s-media-sdk/core", - "version": "1.0.0-alpha.7", + "version": "1.0.0-alpha.8", "main": "./dist/lib.js", "module": "./dist/lib.mjs", "types": "./dist/lib.d.ts", @@ -9,17 +9,18 @@ "src/*" ], "devDependencies": { + "@atm0s-media-sdk/eslint-config": "0.0.0", + "@atm0s-media-sdk/typescript-config": "0.0.0", "@turbo/gen": "^1.12.4", "@types/eslint": "^8.56.5", "@types/node": "^20.11.24", "eslint": "^8.57.0", "ts-proto": "^1.174.0", "tsup": "^8.1.0", - "typescript": "^5.3.3", - "@atm0s-media-sdk/typescript-config": "0.0.0", - "@atm0s-media-sdk/eslint-config": "0.0.0" + "typescript": "^5.3.3" }, "dependencies": { + "long": "^5.2.3", "protobufjs": "^7.3.0" }, "scripts": { diff --git a/packages/sdk-core/protobuf/sip_gateway.proto b/packages/sdk-core/protobuf/sip_gateway.proto index 1bb98d2..1a4f00d 100644 --- a/packages/sdk-core/protobuf/sip_gateway.proto +++ b/packages/sdk-core/protobuf/sip_gateway.proto @@ -3,222 +3,192 @@ syntax = "proto3"; package sip_gateway; message IncomingCallData { - message IncomingCallEvent { - message SipEvent { - message Cancelled { + message IncomingCallEvent { + message SipEvent { + message Cancelled {} - } + message Bye {} - message Bye { - - } + oneof event { + Cancelled cancelled = 1; + Bye bye = 2; + } + } - oneof event { - Cancelled cancelled = 1; - Bye bye = 2; - } - } + message Accepted {} - message Accepted { + message Rejected {} - } + message Ended {} - message Ended { + message Error { string message = 1; } - } + oneof event { + Error err = 10; + SipEvent sip = 11; + Accepted accepted = 12; + Ended ended = 13; + Rejected rejected = 14; + } + } - message Error { - string message = 1; - } + message IncomingCallRequest { + message Ring {} - oneof event { - Error err = 1; - SipEvent sip = 2; - Accepted accepted = 3; - Ended ended = 4; - } + message Accept { + string room = 1; + string peer = 2; + bool record = 3; } - message IncomingCallRequest { - message Ring { + message End {} - } + message Continue {} - message Accept { - string room = 1; - string peer = 2; - bool record = 3; - } + uint32 req_id = 1; - message Accept2 { + oneof action { + Ring ring = 10; + Accept accept = 11; + End end = 12; + Continue continue = 13; + } + } - } + message IncomingCallResponse { + message Ring {} - message End { + message Accept {} - } + message End {} - uint32 req_id = 1; - oneof action { - Ring ring = 10; - Accept accept = 11; - Accept2 accept2 = 12; - End end = 13; - } - } + message Continue {} + + message Error { string message = 1; } - message IncomingCallResponse { - message Ring { + uint32 req_id = 1; - } + oneof response { + Error error = 10; + Ring ring = 11; + Accept accept = 12; + End end = 13; + Continue continue = 14; + } + } - message Accept { + oneof data { + IncomingCallEvent event = 1; + IncomingCallRequest request = 2; + IncomingCallResponse response = 3; + } +} - } +message OutgoingCallData { + message OutgoingCallEvent { + message SipEvent { + message Provisional { uint32 code = 1; } - message Accept2 { - string room = 1; - string peer = 2; - string token = 3; - } + message Early { uint32 code = 1; } - message End { + message Accepted { uint32 code = 1; } - } + message Failure { uint32 code = 1; } - message Error { - string message = 1; - } + message Bye {} - uint32 req_id = 1; - oneof response { - Error error = 10; - Ring ring = 11; - Accept accept = 12; - Accept2 accept2 = 13; - End end = 14; - } + oneof event { + Provisional provisional = 1; + Early early = 2; + Accepted accepted = 3; + Failure failure = 4; + Bye bye = 5; + } } - oneof data { - IncomingCallEvent event = 1; - IncomingCallRequest request = 2; - IncomingCallResponse response = 3; - } -} + // user sent cancel + message Cancelled {} + // user sent bye + message Terminated {} -message OutgoingCallData { - message OutgoingCallEvent { - message SipEvent { - message Provisional { - uint32 code = 1; - } - - message Early { - uint32 code = 1; - } - - message Accepted { - uint32 code = 1; - } - - message Failure { - uint32 code = 1; - } - - message Bye { - - } - - oneof event { - Provisional provisional = 1; - Early early = 2; - Accepted accepted = 3; - Failure failure = 4; - Bye bye = 5; - } - } - - message Ended { - - } - - message Error { - string message = 1; - } - - oneof event { - Error err = 1; - SipEvent sip = 2; - Ended ended = 3; - } - } - - message OutgoingCallRequest { - message End { + message Ended {} - } + message Error { string message = 1; } - uint32 req_id = 1; - oneof action { - End end = 10; - } + oneof event { + Error err = 1; + SipEvent sip = 2; + Ended ended = 3; + Cancelled cancelled = 4; + Terminated terminated = 5; } + } - message OutgoingCallResponse { - message End { + message OutgoingCallRequest { + message End {} - } + uint32 req_id = 1; + oneof action { End end = 10; } + } - message Error { - string message = 1; - } + message OutgoingCallResponse { + message End {} - uint32 req_id = 1; - oneof response { - Error error = 10; - End end = 11; - } - } + message Error { string message = 1; } - oneof data { - OutgoingCallEvent event = 1; - OutgoingCallRequest request = 2; - OutgoingCallResponse response = 3; + uint32 req_id = 1; + oneof response { + Error error = 10; + End end = 11; } + } + + oneof data { + OutgoingCallEvent event = 1; + OutgoingCallRequest request = 2; + OutgoingCallResponse response = 3; + } } message IncomingCallNotify { - message CallArrived { - string call_token = 1; - string call_ws = 2; - string call_from = 3; - string call_to = 4; - } - - message CallCancelled { - string call_from = 3; - string call_to = 4; - } - - message CallAccepted { - string call_from = 3; - string call_to = 4; - } - - string call_id = 1; - oneof event { - CallArrived arrived = 10; - CallCancelled cancelled = 11; - CallAccepted accepted = 12; - } + message CallArrived { + string call_token = 1; + string call_ws = 2; + string call_from = 3; + string call_to = 4; + } + + message CallCancelled { + string call_from = 3; + string call_to = 4; + } + + message CallAccepted { + string call_from = 3; + string call_to = 4; + } + + message CallRejected { + string call_from = 3; + string call_to = 4; + } + + oneof event { + CallArrived arrived = 10; + CallCancelled cancelled = 11; + CallAccepted accepted = 12; + CallRejected rejected = 13; + } } message CallEvent { - oneof event { - IncomingCallNotify notify = 1; - OutgoingCallData.OutgoingCallEvent outgoing = 2; - IncomingCallData.IncomingCallEvent incoming = 3; - } + uint64 timestamp = 1; + string call_id = 2; + + oneof event { + IncomingCallNotify notify = 10; + OutgoingCallData.OutgoingCallEvent outgoing = 11; + IncomingCallData.IncomingCallEvent incoming = 12; + } } \ No newline at end of file diff --git a/packages/sdk-core/src/generated/protobuf/cluster_gateway.ts b/packages/sdk-core/src/generated/protobuf/cluster_gateway.ts index 934dcfd..04d0a70 100644 --- a/packages/sdk-core/src/generated/protobuf/cluster_gateway.ts +++ b/packages/sdk-core/src/generated/protobuf/cluster_gateway.ts @@ -1,11 +1,11 @@ // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v1.174.0 -// protoc v4.25.1 +// protoc v5.28.3 // source: cluster_gateway.proto /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; import { ConnectRequest, ConnectResponse } from "./gateway"; export const protobufPackage = "cluster_gateway"; diff --git a/packages/sdk-core/src/generated/protobuf/features.mixer.ts b/packages/sdk-core/src/generated/protobuf/features.mixer.ts index f43e576..6aa362c 100644 --- a/packages/sdk-core/src/generated/protobuf/features.mixer.ts +++ b/packages/sdk-core/src/generated/protobuf/features.mixer.ts @@ -1,11 +1,11 @@ // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v1.174.0 -// protoc v4.25.1 +// protoc v5.28.3 // source: features.mixer.proto /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; import { Receiver_Source } from "./shared"; export const protobufPackage = "features.mixer"; diff --git a/packages/sdk-core/src/generated/protobuf/features.ts b/packages/sdk-core/src/generated/protobuf/features.ts index 934cfff..4c76c2e 100644 --- a/packages/sdk-core/src/generated/protobuf/features.ts +++ b/packages/sdk-core/src/generated/protobuf/features.ts @@ -1,11 +1,11 @@ // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v1.174.0 -// protoc v4.25.1 +// protoc v5.28.3 // source: features.proto /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; import { Config as Config1, Request as Request2, diff --git a/packages/sdk-core/src/generated/protobuf/gateway.ts b/packages/sdk-core/src/generated/protobuf/gateway.ts index 3a5d8a7..2d0ac9b 100644 --- a/packages/sdk-core/src/generated/protobuf/gateway.ts +++ b/packages/sdk-core/src/generated/protobuf/gateway.ts @@ -1,11 +1,11 @@ // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v1.174.0 -// protoc v4.25.1 +// protoc v5.28.3 // source: gateway.proto /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; import { RoomJoin } from "./session"; import { Tracks } from "./shared"; diff --git a/packages/sdk-core/src/generated/protobuf/session.ts b/packages/sdk-core/src/generated/protobuf/session.ts index 850b3f1..7f5aae1 100644 --- a/packages/sdk-core/src/generated/protobuf/session.ts +++ b/packages/sdk-core/src/generated/protobuf/session.ts @@ -1,11 +1,11 @@ // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v1.174.0 -// protoc v4.25.1 +// protoc v5.28.3 // source: session.proto /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; import { Config, Request as Request1, Response as Response2, ServerEvent as ServerEvent3 } from "./features"; import { Error, diff --git a/packages/sdk-core/src/generated/protobuf/shared.ts b/packages/sdk-core/src/generated/protobuf/shared.ts index 50d37be..77e4ea6 100644 --- a/packages/sdk-core/src/generated/protobuf/shared.ts +++ b/packages/sdk-core/src/generated/protobuf/shared.ts @@ -1,11 +1,11 @@ // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v1.174.0 -// protoc v4.25.1 +// protoc v5.28.3 // source: shared.proto /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "shared"; diff --git a/packages/sdk-core/src/generated/protobuf/sip_gateway.ts b/packages/sdk-core/src/generated/protobuf/sip_gateway.ts index 205fa12..cfd630a 100644 --- a/packages/sdk-core/src/generated/protobuf/sip_gateway.ts +++ b/packages/sdk-core/src/generated/protobuf/sip_gateway.ts @@ -1,34 +1,15 @@ // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v1.174.0 -// protoc v4.25.1 +// protoc v5.28.3 // source: sip_gateway.proto /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sip_gateway"; -export interface IncomingCallNotify { - callId: string; - arrived?: IncomingCallNotify_CallArrived | undefined; - cancelled?: IncomingCallNotify_CallCancelled | undefined; - accepted?: IncomingCallNotify_CallAccepted | undefined; -} - -export interface IncomingCallNotify_CallArrived { - callToken: string; - callWs: string; - from: string; - to: string; -} - -export interface IncomingCallNotify_CallCancelled { -} - -export interface IncomingCallNotify_CallAccepted { -} - export interface IncomingCallData { event?: IncomingCallData_IncomingCallEvent | undefined; request?: IncomingCallData_IncomingCallRequest | undefined; @@ -40,6 +21,7 @@ export interface IncomingCallData_IncomingCallEvent { sip?: IncomingCallData_IncomingCallEvent_SipEvent | undefined; accepted?: IncomingCallData_IncomingCallEvent_Accepted | undefined; ended?: IncomingCallData_IncomingCallEvent_Ended | undefined; + rejected?: IncomingCallData_IncomingCallEvent_Rejected | undefined; } export interface IncomingCallData_IncomingCallEvent_SipEvent { @@ -56,6 +38,9 @@ export interface IncomingCallData_IncomingCallEvent_SipEvent_Bye { export interface IncomingCallData_IncomingCallEvent_Accepted { } +export interface IncomingCallData_IncomingCallEvent_Rejected { +} + export interface IncomingCallData_IncomingCallEvent_Ended { } @@ -67,8 +52,8 @@ export interface IncomingCallData_IncomingCallRequest { reqId: number; ring?: IncomingCallData_IncomingCallRequest_Ring | undefined; accept?: IncomingCallData_IncomingCallRequest_Accept | undefined; - accept2?: IncomingCallData_IncomingCallRequest_Accept2 | undefined; end?: IncomingCallData_IncomingCallRequest_End | undefined; + continue?: IncomingCallData_IncomingCallRequest_Continue | undefined; } export interface IncomingCallData_IncomingCallRequest_Ring { @@ -80,10 +65,10 @@ export interface IncomingCallData_IncomingCallRequest_Accept { record: boolean; } -export interface IncomingCallData_IncomingCallRequest_Accept2 { +export interface IncomingCallData_IncomingCallRequest_End { } -export interface IncomingCallData_IncomingCallRequest_End { +export interface IncomingCallData_IncomingCallRequest_Continue { } export interface IncomingCallData_IncomingCallResponse { @@ -91,8 +76,8 @@ export interface IncomingCallData_IncomingCallResponse { error?: IncomingCallData_IncomingCallResponse_Error | undefined; ring?: IncomingCallData_IncomingCallResponse_Ring | undefined; accept?: IncomingCallData_IncomingCallResponse_Accept | undefined; - accept2?: IncomingCallData_IncomingCallResponse_Accept2 | undefined; end?: IncomingCallData_IncomingCallResponse_End | undefined; + continue?: IncomingCallData_IncomingCallResponse_Continue | undefined; } export interface IncomingCallData_IncomingCallResponse_Ring { @@ -101,13 +86,10 @@ export interface IncomingCallData_IncomingCallResponse_Ring { export interface IncomingCallData_IncomingCallResponse_Accept { } -export interface IncomingCallData_IncomingCallResponse_Accept2 { - room: string; - peer: string; - token: string; +export interface IncomingCallData_IncomingCallResponse_End { } -export interface IncomingCallData_IncomingCallResponse_End { +export interface IncomingCallData_IncomingCallResponse_Continue { } export interface IncomingCallData_IncomingCallResponse_Error { @@ -124,6 +106,8 @@ export interface OutgoingCallData_OutgoingCallEvent { err?: OutgoingCallData_OutgoingCallEvent_Error | undefined; sip?: OutgoingCallData_OutgoingCallEvent_SipEvent | undefined; ended?: OutgoingCallData_OutgoingCallEvent_Ended | undefined; + cancelled?: OutgoingCallData_OutgoingCallEvent_Cancelled | undefined; + terminated?: OutgoingCallData_OutgoingCallEvent_Terminated | undefined; } export interface OutgoingCallData_OutgoingCallEvent_SipEvent { @@ -153,6 +137,14 @@ export interface OutgoingCallData_OutgoingCallEvent_SipEvent_Failure { export interface OutgoingCallData_OutgoingCallEvent_SipEvent_Bye { } +/** user sent cancel */ +export interface OutgoingCallData_OutgoingCallEvent_Cancelled { +} + +/** user sent bye */ +export interface OutgoingCallData_OutgoingCallEvent_Terminated { +} + export interface OutgoingCallData_OutgoingCallEvent_Ended { } @@ -181,31 +173,65 @@ export interface OutgoingCallData_OutgoingCallResponse_Error { message: string; } -function createBaseIncomingCallNotify(): IncomingCallNotify { - return { callId: "", arrived: undefined, cancelled: undefined, accepted: undefined }; +export interface IncomingCallNotify { + arrived?: IncomingCallNotify_CallArrived | undefined; + cancelled?: IncomingCallNotify_CallCancelled | undefined; + accepted?: IncomingCallNotify_CallAccepted | undefined; + rejected?: IncomingCallNotify_CallRejected | undefined; } -export const IncomingCallNotify = { - encode(message: IncomingCallNotify, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.callId !== "") { - writer.uint32(10).string(message.callId); - } - if (message.arrived !== undefined) { - IncomingCallNotify_CallArrived.encode(message.arrived, writer.uint32(82).fork()).ldelim(); +export interface IncomingCallNotify_CallArrived { + callToken: string; + callWs: string; + callFrom: string; + callTo: string; +} + +export interface IncomingCallNotify_CallCancelled { + callFrom: string; + callTo: string; +} + +export interface IncomingCallNotify_CallAccepted { + callFrom: string; + callTo: string; +} + +export interface IncomingCallNotify_CallRejected { + callFrom: string; + callTo: string; +} + +export interface CallEvent { + timestamp: number; + callId: string; + notify?: IncomingCallNotify | undefined; + outgoing?: OutgoingCallData_OutgoingCallEvent | undefined; + incoming?: IncomingCallData_IncomingCallEvent | undefined; +} + +function createBaseIncomingCallData(): IncomingCallData { + return { event: undefined, request: undefined, response: undefined }; +} + +export const IncomingCallData = { + encode(message: IncomingCallData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.event !== undefined) { + IncomingCallData_IncomingCallEvent.encode(message.event, writer.uint32(10).fork()).ldelim(); } - if (message.cancelled !== undefined) { - IncomingCallNotify_CallCancelled.encode(message.cancelled, writer.uint32(90).fork()).ldelim(); + if (message.request !== undefined) { + IncomingCallData_IncomingCallRequest.encode(message.request, writer.uint32(18).fork()).ldelim(); } - if (message.accepted !== undefined) { - IncomingCallNotify_CallAccepted.encode(message.accepted, writer.uint32(98).fork()).ldelim(); + if (message.response !== undefined) { + IncomingCallData_IncomingCallResponse.encode(message.response, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallNotify { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallNotify(); + const message = createBaseIncomingCallData(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -214,28 +240,21 @@ export const IncomingCallNotify = { break; } - message.callId = reader.string(); - continue; - case 10: - if (tag !== 82) { - break; - } - - message.arrived = IncomingCallNotify_CallArrived.decode(reader, reader.uint32()); + message.event = IncomingCallData_IncomingCallEvent.decode(reader, reader.uint32()); continue; - case 11: - if (tag !== 90) { + case 2: + if (tag !== 18) { break; } - message.cancelled = IncomingCallNotify_CallCancelled.decode(reader, reader.uint32()); + message.request = IncomingCallData_IncomingCallRequest.decode(reader, reader.uint32()); continue; - case 12: - if (tag !== 98) { + case 3: + if (tag !== 26) { break; } - message.accepted = IncomingCallNotify_CallAccepted.decode(reader, reader.uint32()); + message.response = IncomingCallData_IncomingCallResponse.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -246,106 +265,111 @@ export const IncomingCallNotify = { return message; }, - fromJSON(object: any): IncomingCallNotify { + fromJSON(object: any): IncomingCallData { return { - callId: isSet(object.callId) ? globalThis.String(object.callId) : "", - arrived: isSet(object.arrived) ? IncomingCallNotify_CallArrived.fromJSON(object.arrived) : undefined, - cancelled: isSet(object.cancelled) ? IncomingCallNotify_CallCancelled.fromJSON(object.cancelled) : undefined, - accepted: isSet(object.accepted) ? IncomingCallNotify_CallAccepted.fromJSON(object.accepted) : undefined, + event: isSet(object.event) ? IncomingCallData_IncomingCallEvent.fromJSON(object.event) : undefined, + request: isSet(object.request) ? IncomingCallData_IncomingCallRequest.fromJSON(object.request) : undefined, + response: isSet(object.response) ? IncomingCallData_IncomingCallResponse.fromJSON(object.response) : undefined, }; }, - toJSON(message: IncomingCallNotify): unknown { + toJSON(message: IncomingCallData): unknown { const obj: any = {}; - if (message.callId !== "") { - obj.callId = message.callId; - } - if (message.arrived !== undefined) { - obj.arrived = IncomingCallNotify_CallArrived.toJSON(message.arrived); + if (message.event !== undefined) { + obj.event = IncomingCallData_IncomingCallEvent.toJSON(message.event); } - if (message.cancelled !== undefined) { - obj.cancelled = IncomingCallNotify_CallCancelled.toJSON(message.cancelled); + if (message.request !== undefined) { + obj.request = IncomingCallData_IncomingCallRequest.toJSON(message.request); } - if (message.accepted !== undefined) { - obj.accepted = IncomingCallNotify_CallAccepted.toJSON(message.accepted); + if (message.response !== undefined) { + obj.response = IncomingCallData_IncomingCallResponse.toJSON(message.response); } return obj; }, - create, I>>(base?: I): IncomingCallNotify { - return IncomingCallNotify.fromPartial(base ?? ({} as any)); + create, I>>(base?: I): IncomingCallData { + return IncomingCallData.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>(object: I): IncomingCallNotify { - const message = createBaseIncomingCallNotify(); - message.callId = object.callId ?? ""; - message.arrived = (object.arrived !== undefined && object.arrived !== null) - ? IncomingCallNotify_CallArrived.fromPartial(object.arrived) + fromPartial, I>>(object: I): IncomingCallData { + const message = createBaseIncomingCallData(); + message.event = (object.event !== undefined && object.event !== null) + ? IncomingCallData_IncomingCallEvent.fromPartial(object.event) : undefined; - message.cancelled = (object.cancelled !== undefined && object.cancelled !== null) - ? IncomingCallNotify_CallCancelled.fromPartial(object.cancelled) + message.request = (object.request !== undefined && object.request !== null) + ? IncomingCallData_IncomingCallRequest.fromPartial(object.request) : undefined; - message.accepted = (object.accepted !== undefined && object.accepted !== null) - ? IncomingCallNotify_CallAccepted.fromPartial(object.accepted) + message.response = (object.response !== undefined && object.response !== null) + ? IncomingCallData_IncomingCallResponse.fromPartial(object.response) : undefined; return message; }, }; -function createBaseIncomingCallNotify_CallArrived(): IncomingCallNotify_CallArrived { - return { callToken: "", callWs: "", from: "", to: "" }; +function createBaseIncomingCallData_IncomingCallEvent(): IncomingCallData_IncomingCallEvent { + return { err: undefined, sip: undefined, accepted: undefined, ended: undefined, rejected: undefined }; } -export const IncomingCallNotify_CallArrived = { - encode(message: IncomingCallNotify_CallArrived, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.callToken !== "") { - writer.uint32(10).string(message.callToken); +export const IncomingCallData_IncomingCallEvent = { + encode(message: IncomingCallData_IncomingCallEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.err !== undefined) { + IncomingCallData_IncomingCallEvent_Error.encode(message.err, writer.uint32(82).fork()).ldelim(); } - if (message.callWs !== "") { - writer.uint32(18).string(message.callWs); + if (message.sip !== undefined) { + IncomingCallData_IncomingCallEvent_SipEvent.encode(message.sip, writer.uint32(90).fork()).ldelim(); + } + if (message.accepted !== undefined) { + IncomingCallData_IncomingCallEvent_Accepted.encode(message.accepted, writer.uint32(98).fork()).ldelim(); } - if (message.from !== "") { - writer.uint32(26).string(message.from); + if (message.ended !== undefined) { + IncomingCallData_IncomingCallEvent_Ended.encode(message.ended, writer.uint32(106).fork()).ldelim(); } - if (message.to !== "") { - writer.uint32(34).string(message.to); + if (message.rejected !== undefined) { + IncomingCallData_IncomingCallEvent_Rejected.encode(message.rejected, writer.uint32(114).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallNotify_CallArrived { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallEvent { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallNotify_CallArrived(); + const message = createBaseIncomingCallData_IncomingCallEvent(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (tag !== 10) { + case 10: + if (tag !== 82) { break; } - message.callToken = reader.string(); + message.err = IncomingCallData_IncomingCallEvent_Error.decode(reader, reader.uint32()); continue; - case 2: - if (tag !== 18) { + case 11: + if (tag !== 90) { break; } - message.callWs = reader.string(); + message.sip = IncomingCallData_IncomingCallEvent_SipEvent.decode(reader, reader.uint32()); continue; - case 3: - if (tag !== 26) { + case 12: + if (tag !== 98) { break; } - message.from = reader.string(); + message.accepted = IncomingCallData_IncomingCallEvent_Accepted.decode(reader, reader.uint32()); continue; - case 4: - if (tag !== 34) { + case 13: + if (tag !== 106) { + break; + } + + message.ended = IncomingCallData_IncomingCallEvent_Ended.decode(reader, reader.uint32()); + continue; + case 14: + if (tag !== 114) { break; } - message.to = reader.string(); + message.rejected = IncomingCallData_IncomingCallEvent_Rejected.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -356,63 +380,105 @@ export const IncomingCallNotify_CallArrived = { return message; }, - fromJSON(object: any): IncomingCallNotify_CallArrived { + fromJSON(object: any): IncomingCallData_IncomingCallEvent { return { - callToken: isSet(object.callToken) ? globalThis.String(object.callToken) : "", - callWs: isSet(object.callWs) ? globalThis.String(object.callWs) : "", - from: isSet(object.from) ? globalThis.String(object.from) : "", - to: isSet(object.to) ? globalThis.String(object.to) : "", + err: isSet(object.err) ? IncomingCallData_IncomingCallEvent_Error.fromJSON(object.err) : undefined, + sip: isSet(object.sip) ? IncomingCallData_IncomingCallEvent_SipEvent.fromJSON(object.sip) : undefined, + accepted: isSet(object.accepted) + ? IncomingCallData_IncomingCallEvent_Accepted.fromJSON(object.accepted) + : undefined, + ended: isSet(object.ended) ? IncomingCallData_IncomingCallEvent_Ended.fromJSON(object.ended) : undefined, + rejected: isSet(object.rejected) + ? IncomingCallData_IncomingCallEvent_Rejected.fromJSON(object.rejected) + : undefined, }; }, - toJSON(message: IncomingCallNotify_CallArrived): unknown { + toJSON(message: IncomingCallData_IncomingCallEvent): unknown { const obj: any = {}; - if (message.callToken !== "") { - obj.callToken = message.callToken; + if (message.err !== undefined) { + obj.err = IncomingCallData_IncomingCallEvent_Error.toJSON(message.err); } - if (message.callWs !== "") { - obj.callWs = message.callWs; + if (message.sip !== undefined) { + obj.sip = IncomingCallData_IncomingCallEvent_SipEvent.toJSON(message.sip); + } + if (message.accepted !== undefined) { + obj.accepted = IncomingCallData_IncomingCallEvent_Accepted.toJSON(message.accepted); } - if (message.from !== "") { - obj.from = message.from; + if (message.ended !== undefined) { + obj.ended = IncomingCallData_IncomingCallEvent_Ended.toJSON(message.ended); } - if (message.to !== "") { - obj.to = message.to; + if (message.rejected !== undefined) { + obj.rejected = IncomingCallData_IncomingCallEvent_Rejected.toJSON(message.rejected); } return obj; }, - create, I>>(base?: I): IncomingCallNotify_CallArrived { - return IncomingCallNotify_CallArrived.fromPartial(base ?? ({} as any)); + create, I>>( + base?: I, + ): IncomingCallData_IncomingCallEvent { + return IncomingCallData_IncomingCallEvent.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): IncomingCallNotify_CallArrived { - const message = createBaseIncomingCallNotify_CallArrived(); - message.callToken = object.callToken ?? ""; - message.callWs = object.callWs ?? ""; - message.from = object.from ?? ""; - message.to = object.to ?? ""; + ): IncomingCallData_IncomingCallEvent { + const message = createBaseIncomingCallData_IncomingCallEvent(); + message.err = (object.err !== undefined && object.err !== null) + ? IncomingCallData_IncomingCallEvent_Error.fromPartial(object.err) + : undefined; + message.sip = (object.sip !== undefined && object.sip !== null) + ? IncomingCallData_IncomingCallEvent_SipEvent.fromPartial(object.sip) + : undefined; + message.accepted = (object.accepted !== undefined && object.accepted !== null) + ? IncomingCallData_IncomingCallEvent_Accepted.fromPartial(object.accepted) + : undefined; + message.ended = (object.ended !== undefined && object.ended !== null) + ? IncomingCallData_IncomingCallEvent_Ended.fromPartial(object.ended) + : undefined; + message.rejected = (object.rejected !== undefined && object.rejected !== null) + ? IncomingCallData_IncomingCallEvent_Rejected.fromPartial(object.rejected) + : undefined; return message; }, }; -function createBaseIncomingCallNotify_CallCancelled(): IncomingCallNotify_CallCancelled { - return {}; +function createBaseIncomingCallData_IncomingCallEvent_SipEvent(): IncomingCallData_IncomingCallEvent_SipEvent { + return { cancelled: undefined, bye: undefined }; } -export const IncomingCallNotify_CallCancelled = { - encode(_: IncomingCallNotify_CallCancelled, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallNotify_CallCancelled { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallNotify_CallCancelled(); +export const IncomingCallData_IncomingCallEvent_SipEvent = { + encode(message: IncomingCallData_IncomingCallEvent_SipEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.cancelled !== undefined) { + IncomingCallData_IncomingCallEvent_SipEvent_Cancelled.encode(message.cancelled, writer.uint32(10).fork()) + .ldelim(); + } + if (message.bye !== undefined) { + IncomingCallData_IncomingCallEvent_SipEvent_Bye.encode(message.bye, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallEvent_SipEvent { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIncomingCallData_IncomingCallEvent_SipEvent(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.cancelled = IncomingCallData_IncomingCallEvent_SipEvent_Cancelled.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.bye = IncomingCallData_IncomingCallEvent_SipEvent_Bye.decode(reader, reader.uint32()); + continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -422,41 +488,61 @@ export const IncomingCallNotify_CallCancelled = { return message; }, - fromJSON(_: any): IncomingCallNotify_CallCancelled { - return {}; + fromJSON(object: any): IncomingCallData_IncomingCallEvent_SipEvent { + return { + cancelled: isSet(object.cancelled) + ? IncomingCallData_IncomingCallEvent_SipEvent_Cancelled.fromJSON(object.cancelled) + : undefined, + bye: isSet(object.bye) ? IncomingCallData_IncomingCallEvent_SipEvent_Bye.fromJSON(object.bye) : undefined, + }; }, - toJSON(_: IncomingCallNotify_CallCancelled): unknown { + toJSON(message: IncomingCallData_IncomingCallEvent_SipEvent): unknown { const obj: any = {}; + if (message.cancelled !== undefined) { + obj.cancelled = IncomingCallData_IncomingCallEvent_SipEvent_Cancelled.toJSON(message.cancelled); + } + if (message.bye !== undefined) { + obj.bye = IncomingCallData_IncomingCallEvent_SipEvent_Bye.toJSON(message.bye); + } return obj; }, - create, I>>( + create, I>>( base?: I, - ): IncomingCallNotify_CallCancelled { - return IncomingCallNotify_CallCancelled.fromPartial(base ?? ({} as any)); + ): IncomingCallData_IncomingCallEvent_SipEvent { + return IncomingCallData_IncomingCallEvent_SipEvent.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( - _: I, - ): IncomingCallNotify_CallCancelled { - const message = createBaseIncomingCallNotify_CallCancelled(); + fromPartial, I>>( + object: I, + ): IncomingCallData_IncomingCallEvent_SipEvent { + const message = createBaseIncomingCallData_IncomingCallEvent_SipEvent(); + message.cancelled = (object.cancelled !== undefined && object.cancelled !== null) + ? IncomingCallData_IncomingCallEvent_SipEvent_Cancelled.fromPartial(object.cancelled) + : undefined; + message.bye = (object.bye !== undefined && object.bye !== null) + ? IncomingCallData_IncomingCallEvent_SipEvent_Bye.fromPartial(object.bye) + : undefined; return message; }, }; -function createBaseIncomingCallNotify_CallAccepted(): IncomingCallNotify_CallAccepted { +function createBaseIncomingCallData_IncomingCallEvent_SipEvent_Cancelled(): IncomingCallData_IncomingCallEvent_SipEvent_Cancelled { return {}; } -export const IncomingCallNotify_CallAccepted = { - encode(_: IncomingCallNotify_CallAccepted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const IncomingCallData_IncomingCallEvent_SipEvent_Cancelled = { + encode( + _: IncomingCallData_IncomingCallEvent_SipEvent_Cancelled, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallNotify_CallAccepted { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallEvent_SipEvent_Cancelled { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallNotify_CallAccepted(); + const message = createBaseIncomingCallData_IncomingCallEvent_SipEvent_Cancelled(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -469,70 +555,44 @@ export const IncomingCallNotify_CallAccepted = { return message; }, - fromJSON(_: any): IncomingCallNotify_CallAccepted { + fromJSON(_: any): IncomingCallData_IncomingCallEvent_SipEvent_Cancelled { return {}; }, - toJSON(_: IncomingCallNotify_CallAccepted): unknown { + toJSON(_: IncomingCallData_IncomingCallEvent_SipEvent_Cancelled): unknown { const obj: any = {}; return obj; }, - create, I>>(base?: I): IncomingCallNotify_CallAccepted { - return IncomingCallNotify_CallAccepted.fromPartial(base ?? ({} as any)); + create, I>>( + base?: I, + ): IncomingCallData_IncomingCallEvent_SipEvent_Cancelled { + return IncomingCallData_IncomingCallEvent_SipEvent_Cancelled.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>(_: I): IncomingCallNotify_CallAccepted { - const message = createBaseIncomingCallNotify_CallAccepted(); + fromPartial, I>>( + _: I, + ): IncomingCallData_IncomingCallEvent_SipEvent_Cancelled { + const message = createBaseIncomingCallData_IncomingCallEvent_SipEvent_Cancelled(); return message; }, }; -function createBaseIncomingCallData(): IncomingCallData { - return { event: undefined, request: undefined, response: undefined }; +function createBaseIncomingCallData_IncomingCallEvent_SipEvent_Bye(): IncomingCallData_IncomingCallEvent_SipEvent_Bye { + return {}; } -export const IncomingCallData = { - encode(message: IncomingCallData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.event !== undefined) { - IncomingCallData_IncomingCallEvent.encode(message.event, writer.uint32(10).fork()).ldelim(); - } - if (message.request !== undefined) { - IncomingCallData_IncomingCallRequest.encode(message.request, writer.uint32(18).fork()).ldelim(); - } - if (message.response !== undefined) { - IncomingCallData_IncomingCallResponse.encode(message.response, writer.uint32(26).fork()).ldelim(); - } +export const IncomingCallData_IncomingCallEvent_SipEvent_Bye = { + encode(_: IncomingCallData_IncomingCallEvent_SipEvent_Bye, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallEvent_SipEvent_Bye { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallData(); + const message = createBaseIncomingCallData_IncomingCallEvent_SipEvent_Bye(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.event = IncomingCallData_IncomingCallEvent.decode(reader, reader.uint32()); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.request = IncomingCallData_IncomingCallRequest.decode(reader, reader.uint32()); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.response = IncomingCallData_IncomingCallResponse.decode(reader, reader.uint32()); - continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -542,102 +602,44 @@ export const IncomingCallData = { return message; }, - fromJSON(object: any): IncomingCallData { - return { - event: isSet(object.event) ? IncomingCallData_IncomingCallEvent.fromJSON(object.event) : undefined, - request: isSet(object.request) ? IncomingCallData_IncomingCallRequest.fromJSON(object.request) : undefined, - response: isSet(object.response) ? IncomingCallData_IncomingCallResponse.fromJSON(object.response) : undefined, - }; + fromJSON(_: any): IncomingCallData_IncomingCallEvent_SipEvent_Bye { + return {}; }, - toJSON(message: IncomingCallData): unknown { + toJSON(_: IncomingCallData_IncomingCallEvent_SipEvent_Bye): unknown { const obj: any = {}; - if (message.event !== undefined) { - obj.event = IncomingCallData_IncomingCallEvent.toJSON(message.event); - } - if (message.request !== undefined) { - obj.request = IncomingCallData_IncomingCallRequest.toJSON(message.request); - } - if (message.response !== undefined) { - obj.response = IncomingCallData_IncomingCallResponse.toJSON(message.response); - } return obj; }, - create, I>>(base?: I): IncomingCallData { - return IncomingCallData.fromPartial(base ?? ({} as any)); + create, I>>( + base?: I, + ): IncomingCallData_IncomingCallEvent_SipEvent_Bye { + return IncomingCallData_IncomingCallEvent_SipEvent_Bye.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>(object: I): IncomingCallData { - const message = createBaseIncomingCallData(); - message.event = (object.event !== undefined && object.event !== null) - ? IncomingCallData_IncomingCallEvent.fromPartial(object.event) - : undefined; - message.request = (object.request !== undefined && object.request !== null) - ? IncomingCallData_IncomingCallRequest.fromPartial(object.request) - : undefined; - message.response = (object.response !== undefined && object.response !== null) - ? IncomingCallData_IncomingCallResponse.fromPartial(object.response) - : undefined; + fromPartial, I>>( + _: I, + ): IncomingCallData_IncomingCallEvent_SipEvent_Bye { + const message = createBaseIncomingCallData_IncomingCallEvent_SipEvent_Bye(); return message; }, }; -function createBaseIncomingCallData_IncomingCallEvent(): IncomingCallData_IncomingCallEvent { - return { err: undefined, sip: undefined, accepted: undefined, ended: undefined }; +function createBaseIncomingCallData_IncomingCallEvent_Accepted(): IncomingCallData_IncomingCallEvent_Accepted { + return {}; } -export const IncomingCallData_IncomingCallEvent = { - encode(message: IncomingCallData_IncomingCallEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.err !== undefined) { - IncomingCallData_IncomingCallEvent_Error.encode(message.err, writer.uint32(10).fork()).ldelim(); - } - if (message.sip !== undefined) { - IncomingCallData_IncomingCallEvent_SipEvent.encode(message.sip, writer.uint32(18).fork()).ldelim(); - } - if (message.accepted !== undefined) { - IncomingCallData_IncomingCallEvent_Accepted.encode(message.accepted, writer.uint32(26).fork()).ldelim(); - } - if (message.ended !== undefined) { - IncomingCallData_IncomingCallEvent_Ended.encode(message.ended, writer.uint32(34).fork()).ldelim(); - } +export const IncomingCallData_IncomingCallEvent_Accepted = { + encode(_: IncomingCallData_IncomingCallEvent_Accepted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallEvent { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallEvent_Accepted { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallData_IncomingCallEvent(); + const message = createBaseIncomingCallData_IncomingCallEvent_Accepted(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.err = IncomingCallData_IncomingCallEvent_Error.decode(reader, reader.uint32()); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.sip = IncomingCallData_IncomingCallEvent_SipEvent.decode(reader, reader.uint32()); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.accepted = IncomingCallData_IncomingCallEvent_Accepted.decode(reader, reader.uint32()); - continue; - case 4: - if (tag !== 34) { - break; - } - - message.ended = IncomingCallData_IncomingCallEvent_Ended.decode(reader, reader.uint32()); - continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -647,254 +649,41 @@ export const IncomingCallData_IncomingCallEvent = { return message; }, - fromJSON(object: any): IncomingCallData_IncomingCallEvent { - return { - err: isSet(object.err) ? IncomingCallData_IncomingCallEvent_Error.fromJSON(object.err) : undefined, - sip: isSet(object.sip) ? IncomingCallData_IncomingCallEvent_SipEvent.fromJSON(object.sip) : undefined, - accepted: isSet(object.accepted) - ? IncomingCallData_IncomingCallEvent_Accepted.fromJSON(object.accepted) - : undefined, - ended: isSet(object.ended) ? IncomingCallData_IncomingCallEvent_Ended.fromJSON(object.ended) : undefined, - }; + fromJSON(_: any): IncomingCallData_IncomingCallEvent_Accepted { + return {}; }, - toJSON(message: IncomingCallData_IncomingCallEvent): unknown { + toJSON(_: IncomingCallData_IncomingCallEvent_Accepted): unknown { const obj: any = {}; - if (message.err !== undefined) { - obj.err = IncomingCallData_IncomingCallEvent_Error.toJSON(message.err); - } - if (message.sip !== undefined) { - obj.sip = IncomingCallData_IncomingCallEvent_SipEvent.toJSON(message.sip); - } - if (message.accepted !== undefined) { - obj.accepted = IncomingCallData_IncomingCallEvent_Accepted.toJSON(message.accepted); - } - if (message.ended !== undefined) { - obj.ended = IncomingCallData_IncomingCallEvent_Ended.toJSON(message.ended); - } return obj; }, - create, I>>( + create, I>>( base?: I, - ): IncomingCallData_IncomingCallEvent { - return IncomingCallData_IncomingCallEvent.fromPartial(base ?? ({} as any)); + ): IncomingCallData_IncomingCallEvent_Accepted { + return IncomingCallData_IncomingCallEvent_Accepted.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( - object: I, - ): IncomingCallData_IncomingCallEvent { - const message = createBaseIncomingCallData_IncomingCallEvent(); - message.err = (object.err !== undefined && object.err !== null) - ? IncomingCallData_IncomingCallEvent_Error.fromPartial(object.err) - : undefined; - message.sip = (object.sip !== undefined && object.sip !== null) - ? IncomingCallData_IncomingCallEvent_SipEvent.fromPartial(object.sip) - : undefined; - message.accepted = (object.accepted !== undefined && object.accepted !== null) - ? IncomingCallData_IncomingCallEvent_Accepted.fromPartial(object.accepted) - : undefined; - message.ended = (object.ended !== undefined && object.ended !== null) - ? IncomingCallData_IncomingCallEvent_Ended.fromPartial(object.ended) - : undefined; - return message; - }, -}; - -function createBaseIncomingCallData_IncomingCallEvent_SipEvent(): IncomingCallData_IncomingCallEvent_SipEvent { - return { cancelled: undefined, bye: undefined }; -} - -export const IncomingCallData_IncomingCallEvent_SipEvent = { - encode(message: IncomingCallData_IncomingCallEvent_SipEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.cancelled !== undefined) { - IncomingCallData_IncomingCallEvent_SipEvent_Cancelled.encode(message.cancelled, writer.uint32(10).fork()) - .ldelim(); - } - if (message.bye !== undefined) { - IncomingCallData_IncomingCallEvent_SipEvent_Bye.encode(message.bye, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallEvent_SipEvent { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallData_IncomingCallEvent_SipEvent(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.cancelled = IncomingCallData_IncomingCallEvent_SipEvent_Cancelled.decode(reader, reader.uint32()); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.bye = IncomingCallData_IncomingCallEvent_SipEvent_Bye.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - fromJSON(object: any): IncomingCallData_IncomingCallEvent_SipEvent { - return { - cancelled: isSet(object.cancelled) - ? IncomingCallData_IncomingCallEvent_SipEvent_Cancelled.fromJSON(object.cancelled) - : undefined, - bye: isSet(object.bye) ? IncomingCallData_IncomingCallEvent_SipEvent_Bye.fromJSON(object.bye) : undefined, - }; - }, - - toJSON(message: IncomingCallData_IncomingCallEvent_SipEvent): unknown { - const obj: any = {}; - if (message.cancelled !== undefined) { - obj.cancelled = IncomingCallData_IncomingCallEvent_SipEvent_Cancelled.toJSON(message.cancelled); - } - if (message.bye !== undefined) { - obj.bye = IncomingCallData_IncomingCallEvent_SipEvent_Bye.toJSON(message.bye); - } - return obj; - }, - - create, I>>( - base?: I, - ): IncomingCallData_IncomingCallEvent_SipEvent { - return IncomingCallData_IncomingCallEvent_SipEvent.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): IncomingCallData_IncomingCallEvent_SipEvent { - const message = createBaseIncomingCallData_IncomingCallEvent_SipEvent(); - message.cancelled = (object.cancelled !== undefined && object.cancelled !== null) - ? IncomingCallData_IncomingCallEvent_SipEvent_Cancelled.fromPartial(object.cancelled) - : undefined; - message.bye = (object.bye !== undefined && object.bye !== null) - ? IncomingCallData_IncomingCallEvent_SipEvent_Bye.fromPartial(object.bye) - : undefined; - return message; - }, -}; - -function createBaseIncomingCallData_IncomingCallEvent_SipEvent_Cancelled(): IncomingCallData_IncomingCallEvent_SipEvent_Cancelled { - return {}; -} - -export const IncomingCallData_IncomingCallEvent_SipEvent_Cancelled = { - encode( - _: IncomingCallData_IncomingCallEvent_SipEvent_Cancelled, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallEvent_SipEvent_Cancelled { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallData_IncomingCallEvent_SipEvent_Cancelled(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - fromJSON(_: any): IncomingCallData_IncomingCallEvent_SipEvent_Cancelled { - return {}; - }, - - toJSON(_: IncomingCallData_IncomingCallEvent_SipEvent_Cancelled): unknown { - const obj: any = {}; - return obj; - }, - - create, I>>( - base?: I, - ): IncomingCallData_IncomingCallEvent_SipEvent_Cancelled { - return IncomingCallData_IncomingCallEvent_SipEvent_Cancelled.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - _: I, - ): IncomingCallData_IncomingCallEvent_SipEvent_Cancelled { - const message = createBaseIncomingCallData_IncomingCallEvent_SipEvent_Cancelled(); - return message; - }, -}; - -function createBaseIncomingCallData_IncomingCallEvent_SipEvent_Bye(): IncomingCallData_IncomingCallEvent_SipEvent_Bye { - return {}; -} - -export const IncomingCallData_IncomingCallEvent_SipEvent_Bye = { - encode(_: IncomingCallData_IncomingCallEvent_SipEvent_Bye, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallEvent_SipEvent_Bye { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallData_IncomingCallEvent_SipEvent_Bye(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - fromJSON(_: any): IncomingCallData_IncomingCallEvent_SipEvent_Bye { - return {}; - }, - - toJSON(_: IncomingCallData_IncomingCallEvent_SipEvent_Bye): unknown { - const obj: any = {}; - return obj; - }, - - create, I>>( - base?: I, - ): IncomingCallData_IncomingCallEvent_SipEvent_Bye { - return IncomingCallData_IncomingCallEvent_SipEvent_Bye.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( + fromPartial, I>>( _: I, - ): IncomingCallData_IncomingCallEvent_SipEvent_Bye { - const message = createBaseIncomingCallData_IncomingCallEvent_SipEvent_Bye(); + ): IncomingCallData_IncomingCallEvent_Accepted { + const message = createBaseIncomingCallData_IncomingCallEvent_Accepted(); return message; }, }; -function createBaseIncomingCallData_IncomingCallEvent_Accepted(): IncomingCallData_IncomingCallEvent_Accepted { +function createBaseIncomingCallData_IncomingCallEvent_Rejected(): IncomingCallData_IncomingCallEvent_Rejected { return {}; } -export const IncomingCallData_IncomingCallEvent_Accepted = { - encode(_: IncomingCallData_IncomingCallEvent_Accepted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const IncomingCallData_IncomingCallEvent_Rejected = { + encode(_: IncomingCallData_IncomingCallEvent_Rejected, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallEvent_Accepted { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallEvent_Rejected { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallData_IncomingCallEvent_Accepted(); + const message = createBaseIncomingCallData_IncomingCallEvent_Rejected(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -907,24 +696,24 @@ export const IncomingCallData_IncomingCallEvent_Accepted = { return message; }, - fromJSON(_: any): IncomingCallData_IncomingCallEvent_Accepted { + fromJSON(_: any): IncomingCallData_IncomingCallEvent_Rejected { return {}; }, - toJSON(_: IncomingCallData_IncomingCallEvent_Accepted): unknown { + toJSON(_: IncomingCallData_IncomingCallEvent_Rejected): unknown { const obj: any = {}; return obj; }, - create, I>>( + create, I>>( base?: I, - ): IncomingCallData_IncomingCallEvent_Accepted { - return IncomingCallData_IncomingCallEvent_Accepted.fromPartial(base ?? ({} as any)); + ): IncomingCallData_IncomingCallEvent_Rejected { + return IncomingCallData_IncomingCallEvent_Rejected.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( + fromPartial, I>>( _: I, - ): IncomingCallData_IncomingCallEvent_Accepted { - const message = createBaseIncomingCallData_IncomingCallEvent_Accepted(); + ): IncomingCallData_IncomingCallEvent_Rejected { + const message = createBaseIncomingCallData_IncomingCallEvent_Rejected(); return message; }, }; @@ -1038,7 +827,7 @@ export const IncomingCallData_IncomingCallEvent_Error = { }; function createBaseIncomingCallData_IncomingCallRequest(): IncomingCallData_IncomingCallRequest { - return { reqId: 0, ring: undefined, accept: undefined, accept2: undefined, end: undefined }; + return { reqId: 0, ring: undefined, accept: undefined, end: undefined, continue: undefined }; } export const IncomingCallData_IncomingCallRequest = { @@ -1052,11 +841,11 @@ export const IncomingCallData_IncomingCallRequest = { if (message.accept !== undefined) { IncomingCallData_IncomingCallRequest_Accept.encode(message.accept, writer.uint32(90).fork()).ldelim(); } - if (message.accept2 !== undefined) { - IncomingCallData_IncomingCallRequest_Accept2.encode(message.accept2, writer.uint32(98).fork()).ldelim(); - } if (message.end !== undefined) { - IncomingCallData_IncomingCallRequest_End.encode(message.end, writer.uint32(106).fork()).ldelim(); + IncomingCallData_IncomingCallRequest_End.encode(message.end, writer.uint32(98).fork()).ldelim(); + } + if (message.continue !== undefined) { + IncomingCallData_IncomingCallRequest_Continue.encode(message.continue, writer.uint32(106).fork()).ldelim(); } return writer; }, @@ -1094,14 +883,14 @@ export const IncomingCallData_IncomingCallRequest = { break; } - message.accept2 = IncomingCallData_IncomingCallRequest_Accept2.decode(reader, reader.uint32()); + message.end = IncomingCallData_IncomingCallRequest_End.decode(reader, reader.uint32()); continue; case 13: if (tag !== 106) { break; } - message.end = IncomingCallData_IncomingCallRequest_End.decode(reader, reader.uint32()); + message.continue = IncomingCallData_IncomingCallRequest_Continue.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -1117,10 +906,10 @@ export const IncomingCallData_IncomingCallRequest = { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : 0, ring: isSet(object.ring) ? IncomingCallData_IncomingCallRequest_Ring.fromJSON(object.ring) : undefined, accept: isSet(object.accept) ? IncomingCallData_IncomingCallRequest_Accept.fromJSON(object.accept) : undefined, - accept2: isSet(object.accept2) - ? IncomingCallData_IncomingCallRequest_Accept2.fromJSON(object.accept2) - : undefined, end: isSet(object.end) ? IncomingCallData_IncomingCallRequest_End.fromJSON(object.end) : undefined, + continue: isSet(object.continue) + ? IncomingCallData_IncomingCallRequest_Continue.fromJSON(object.continue) + : undefined, }; }, @@ -1135,12 +924,12 @@ export const IncomingCallData_IncomingCallRequest = { if (message.accept !== undefined) { obj.accept = IncomingCallData_IncomingCallRequest_Accept.toJSON(message.accept); } - if (message.accept2 !== undefined) { - obj.accept2 = IncomingCallData_IncomingCallRequest_Accept2.toJSON(message.accept2); - } if (message.end !== undefined) { obj.end = IncomingCallData_IncomingCallRequest_End.toJSON(message.end); } + if (message.continue !== undefined) { + obj.continue = IncomingCallData_IncomingCallRequest_Continue.toJSON(message.continue); + } return obj; }, @@ -1160,12 +949,12 @@ export const IncomingCallData_IncomingCallRequest = { message.accept = (object.accept !== undefined && object.accept !== null) ? IncomingCallData_IncomingCallRequest_Accept.fromPartial(object.accept) : undefined; - message.accept2 = (object.accept2 !== undefined && object.accept2 !== null) - ? IncomingCallData_IncomingCallRequest_Accept2.fromPartial(object.accept2) - : undefined; message.end = (object.end !== undefined && object.end !== null) ? IncomingCallData_IncomingCallRequest_End.fromPartial(object.end) : undefined; + message.continue = (object.continue !== undefined && object.continue !== null) + ? IncomingCallData_IncomingCallRequest_Continue.fromPartial(object.continue) + : undefined; return message; }, }; @@ -1310,19 +1099,19 @@ export const IncomingCallData_IncomingCallRequest_Accept = { }, }; -function createBaseIncomingCallData_IncomingCallRequest_Accept2(): IncomingCallData_IncomingCallRequest_Accept2 { +function createBaseIncomingCallData_IncomingCallRequest_End(): IncomingCallData_IncomingCallRequest_End { return {}; } -export const IncomingCallData_IncomingCallRequest_Accept2 = { - encode(_: IncomingCallData_IncomingCallRequest_Accept2, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const IncomingCallData_IncomingCallRequest_End = { + encode(_: IncomingCallData_IncomingCallRequest_End, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallRequest_Accept2 { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallRequest_End { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallData_IncomingCallRequest_Accept2(); + const message = createBaseIncomingCallData_IncomingCallRequest_End(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1335,41 +1124,41 @@ export const IncomingCallData_IncomingCallRequest_Accept2 = { return message; }, - fromJSON(_: any): IncomingCallData_IncomingCallRequest_Accept2 { + fromJSON(_: any): IncomingCallData_IncomingCallRequest_End { return {}; }, - toJSON(_: IncomingCallData_IncomingCallRequest_Accept2): unknown { + toJSON(_: IncomingCallData_IncomingCallRequest_End): unknown { const obj: any = {}; return obj; }, - create, I>>( + create, I>>( base?: I, - ): IncomingCallData_IncomingCallRequest_Accept2 { - return IncomingCallData_IncomingCallRequest_Accept2.fromPartial(base ?? ({} as any)); + ): IncomingCallData_IncomingCallRequest_End { + return IncomingCallData_IncomingCallRequest_End.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( + fromPartial, I>>( _: I, - ): IncomingCallData_IncomingCallRequest_Accept2 { - const message = createBaseIncomingCallData_IncomingCallRequest_Accept2(); + ): IncomingCallData_IncomingCallRequest_End { + const message = createBaseIncomingCallData_IncomingCallRequest_End(); return message; }, }; -function createBaseIncomingCallData_IncomingCallRequest_End(): IncomingCallData_IncomingCallRequest_End { +function createBaseIncomingCallData_IncomingCallRequest_Continue(): IncomingCallData_IncomingCallRequest_Continue { return {}; } -export const IncomingCallData_IncomingCallRequest_End = { - encode(_: IncomingCallData_IncomingCallRequest_End, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const IncomingCallData_IncomingCallRequest_Continue = { + encode(_: IncomingCallData_IncomingCallRequest_Continue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallRequest_End { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallRequest_Continue { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallData_IncomingCallRequest_End(); + const message = createBaseIncomingCallData_IncomingCallRequest_Continue(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1382,30 +1171,30 @@ export const IncomingCallData_IncomingCallRequest_End = { return message; }, - fromJSON(_: any): IncomingCallData_IncomingCallRequest_End { + fromJSON(_: any): IncomingCallData_IncomingCallRequest_Continue { return {}; }, - toJSON(_: IncomingCallData_IncomingCallRequest_End): unknown { + toJSON(_: IncomingCallData_IncomingCallRequest_Continue): unknown { const obj: any = {}; return obj; }, - create, I>>( + create, I>>( base?: I, - ): IncomingCallData_IncomingCallRequest_End { - return IncomingCallData_IncomingCallRequest_End.fromPartial(base ?? ({} as any)); + ): IncomingCallData_IncomingCallRequest_Continue { + return IncomingCallData_IncomingCallRequest_Continue.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( + fromPartial, I>>( _: I, - ): IncomingCallData_IncomingCallRequest_End { - const message = createBaseIncomingCallData_IncomingCallRequest_End(); + ): IncomingCallData_IncomingCallRequest_Continue { + const message = createBaseIncomingCallData_IncomingCallRequest_Continue(); return message; }, }; function createBaseIncomingCallData_IncomingCallResponse(): IncomingCallData_IncomingCallResponse { - return { reqId: 0, error: undefined, ring: undefined, accept: undefined, accept2: undefined, end: undefined }; + return { reqId: 0, error: undefined, ring: undefined, accept: undefined, end: undefined, continue: undefined }; } export const IncomingCallData_IncomingCallResponse = { @@ -1422,11 +1211,11 @@ export const IncomingCallData_IncomingCallResponse = { if (message.accept !== undefined) { IncomingCallData_IncomingCallResponse_Accept.encode(message.accept, writer.uint32(98).fork()).ldelim(); } - if (message.accept2 !== undefined) { - IncomingCallData_IncomingCallResponse_Accept2.encode(message.accept2, writer.uint32(106).fork()).ldelim(); - } if (message.end !== undefined) { - IncomingCallData_IncomingCallResponse_End.encode(message.end, writer.uint32(114).fork()).ldelim(); + IncomingCallData_IncomingCallResponse_End.encode(message.end, writer.uint32(106).fork()).ldelim(); + } + if (message.continue !== undefined) { + IncomingCallData_IncomingCallResponse_Continue.encode(message.continue, writer.uint32(114).fork()).ldelim(); } return writer; }, @@ -1471,14 +1260,14 @@ export const IncomingCallData_IncomingCallResponse = { break; } - message.accept2 = IncomingCallData_IncomingCallResponse_Accept2.decode(reader, reader.uint32()); + message.end = IncomingCallData_IncomingCallResponse_End.decode(reader, reader.uint32()); continue; case 14: if (tag !== 114) { break; } - message.end = IncomingCallData_IncomingCallResponse_End.decode(reader, reader.uint32()); + message.continue = IncomingCallData_IncomingCallResponse_Continue.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -1495,10 +1284,10 @@ export const IncomingCallData_IncomingCallResponse = { error: isSet(object.error) ? IncomingCallData_IncomingCallResponse_Error.fromJSON(object.error) : undefined, ring: isSet(object.ring) ? IncomingCallData_IncomingCallResponse_Ring.fromJSON(object.ring) : undefined, accept: isSet(object.accept) ? IncomingCallData_IncomingCallResponse_Accept.fromJSON(object.accept) : undefined, - accept2: isSet(object.accept2) - ? IncomingCallData_IncomingCallResponse_Accept2.fromJSON(object.accept2) - : undefined, end: isSet(object.end) ? IncomingCallData_IncomingCallResponse_End.fromJSON(object.end) : undefined, + continue: isSet(object.continue) + ? IncomingCallData_IncomingCallResponse_Continue.fromJSON(object.continue) + : undefined, }; }, @@ -1516,12 +1305,12 @@ export const IncomingCallData_IncomingCallResponse = { if (message.accept !== undefined) { obj.accept = IncomingCallData_IncomingCallResponse_Accept.toJSON(message.accept); } - if (message.accept2 !== undefined) { - obj.accept2 = IncomingCallData_IncomingCallResponse_Accept2.toJSON(message.accept2); - } if (message.end !== undefined) { obj.end = IncomingCallData_IncomingCallResponse_End.toJSON(message.end); } + if (message.continue !== undefined) { + obj.continue = IncomingCallData_IncomingCallResponse_Continue.toJSON(message.continue); + } return obj; }, @@ -1544,12 +1333,12 @@ export const IncomingCallData_IncomingCallResponse = { message.accept = (object.accept !== undefined && object.accept !== null) ? IncomingCallData_IncomingCallResponse_Accept.fromPartial(object.accept) : undefined; - message.accept2 = (object.accept2 !== undefined && object.accept2 !== null) - ? IncomingCallData_IncomingCallResponse_Accept2.fromPartial(object.accept2) - : undefined; message.end = (object.end !== undefined && object.end !== null) ? IncomingCallData_IncomingCallResponse_End.fromPartial(object.end) : undefined; + message.continue = (object.continue !== undefined && object.continue !== null) + ? IncomingCallData_IncomingCallResponse_Continue.fromPartial(object.continue) + : undefined; return message; }, }; @@ -1648,52 +1437,22 @@ export const IncomingCallData_IncomingCallResponse_Accept = { }, }; -function createBaseIncomingCallData_IncomingCallResponse_Accept2(): IncomingCallData_IncomingCallResponse_Accept2 { - return { room: "", peer: "", token: "" }; +function createBaseIncomingCallData_IncomingCallResponse_End(): IncomingCallData_IncomingCallResponse_End { + return {}; } -export const IncomingCallData_IncomingCallResponse_Accept2 = { - encode(message: IncomingCallData_IncomingCallResponse_Accept2, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.room !== "") { - writer.uint32(10).string(message.room); - } - if (message.peer !== "") { - writer.uint32(18).string(message.peer); - } - if (message.token !== "") { - writer.uint32(26).string(message.token); - } +export const IncomingCallData_IncomingCallResponse_End = { + encode(_: IncomingCallData_IncomingCallResponse_End, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallResponse_Accept2 { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallResponse_End { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallData_IncomingCallResponse_Accept2(); + const message = createBaseIncomingCallData_IncomingCallResponse_End(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.room = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.peer = reader.string(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.token = reader.string(); - continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -1703,57 +1462,41 @@ export const IncomingCallData_IncomingCallResponse_Accept2 = { return message; }, - fromJSON(object: any): IncomingCallData_IncomingCallResponse_Accept2 { - return { - room: isSet(object.room) ? globalThis.String(object.room) : "", - peer: isSet(object.peer) ? globalThis.String(object.peer) : "", - token: isSet(object.token) ? globalThis.String(object.token) : "", - }; + fromJSON(_: any): IncomingCallData_IncomingCallResponse_End { + return {}; }, - toJSON(message: IncomingCallData_IncomingCallResponse_Accept2): unknown { + toJSON(_: IncomingCallData_IncomingCallResponse_End): unknown { const obj: any = {}; - if (message.room !== "") { - obj.room = message.room; - } - if (message.peer !== "") { - obj.peer = message.peer; - } - if (message.token !== "") { - obj.token = message.token; - } return obj; }, - create, I>>( + create, I>>( base?: I, - ): IncomingCallData_IncomingCallResponse_Accept2 { - return IncomingCallData_IncomingCallResponse_Accept2.fromPartial(base ?? ({} as any)); + ): IncomingCallData_IncomingCallResponse_End { + return IncomingCallData_IncomingCallResponse_End.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( - object: I, - ): IncomingCallData_IncomingCallResponse_Accept2 { - const message = createBaseIncomingCallData_IncomingCallResponse_Accept2(); - message.room = object.room ?? ""; - message.peer = object.peer ?? ""; - message.token = object.token ?? ""; + fromPartial, I>>( + _: I, + ): IncomingCallData_IncomingCallResponse_End { + const message = createBaseIncomingCallData_IncomingCallResponse_End(); return message; }, }; -function createBaseIncomingCallData_IncomingCallResponse_End(): IncomingCallData_IncomingCallResponse_End { +function createBaseIncomingCallData_IncomingCallResponse_Continue(): IncomingCallData_IncomingCallResponse_Continue { return {}; } -export const IncomingCallData_IncomingCallResponse_End = { - encode(_: IncomingCallData_IncomingCallResponse_End, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const IncomingCallData_IncomingCallResponse_Continue = { + encode(_: IncomingCallData_IncomingCallResponse_Continue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallResponse_End { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallData_IncomingCallResponse_Continue { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncomingCallData_IncomingCallResponse_End(); + const message = createBaseIncomingCallData_IncomingCallResponse_Continue(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1766,24 +1509,24 @@ export const IncomingCallData_IncomingCallResponse_End = { return message; }, - fromJSON(_: any): IncomingCallData_IncomingCallResponse_End { + fromJSON(_: any): IncomingCallData_IncomingCallResponse_Continue { return {}; }, - toJSON(_: IncomingCallData_IncomingCallResponse_End): unknown { + toJSON(_: IncomingCallData_IncomingCallResponse_Continue): unknown { const obj: any = {}; return obj; }, - create, I>>( + create, I>>( base?: I, - ): IncomingCallData_IncomingCallResponse_End { - return IncomingCallData_IncomingCallResponse_End.fromPartial(base ?? ({} as any)); + ): IncomingCallData_IncomingCallResponse_Continue { + return IncomingCallData_IncomingCallResponse_Continue.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( + fromPartial, I>>( _: I, - ): IncomingCallData_IncomingCallResponse_End { - const message = createBaseIncomingCallData_IncomingCallResponse_End(); + ): IncomingCallData_IncomingCallResponse_Continue { + const message = createBaseIncomingCallData_IncomingCallResponse_Continue(); return message; }, }; @@ -1945,7 +1688,7 @@ export const OutgoingCallData = { }; function createBaseOutgoingCallData_OutgoingCallEvent(): OutgoingCallData_OutgoingCallEvent { - return { err: undefined, sip: undefined, ended: undefined }; + return { err: undefined, sip: undefined, ended: undefined, cancelled: undefined, terminated: undefined }; } export const OutgoingCallData_OutgoingCallEvent = { @@ -1959,6 +1702,12 @@ export const OutgoingCallData_OutgoingCallEvent = { if (message.ended !== undefined) { OutgoingCallData_OutgoingCallEvent_Ended.encode(message.ended, writer.uint32(26).fork()).ldelim(); } + if (message.cancelled !== undefined) { + OutgoingCallData_OutgoingCallEvent_Cancelled.encode(message.cancelled, writer.uint32(34).fork()).ldelim(); + } + if (message.terminated !== undefined) { + OutgoingCallData_OutgoingCallEvent_Terminated.encode(message.terminated, writer.uint32(42).fork()).ldelim(); + } return writer; }, @@ -1990,6 +1739,20 @@ export const OutgoingCallData_OutgoingCallEvent = { message.ended = OutgoingCallData_OutgoingCallEvent_Ended.decode(reader, reader.uint32()); continue; + case 4: + if (tag !== 34) { + break; + } + + message.cancelled = OutgoingCallData_OutgoingCallEvent_Cancelled.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.terminated = OutgoingCallData_OutgoingCallEvent_Terminated.decode(reader, reader.uint32()); + continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -2004,6 +1767,12 @@ export const OutgoingCallData_OutgoingCallEvent = { err: isSet(object.err) ? OutgoingCallData_OutgoingCallEvent_Error.fromJSON(object.err) : undefined, sip: isSet(object.sip) ? OutgoingCallData_OutgoingCallEvent_SipEvent.fromJSON(object.sip) : undefined, ended: isSet(object.ended) ? OutgoingCallData_OutgoingCallEvent_Ended.fromJSON(object.ended) : undefined, + cancelled: isSet(object.cancelled) + ? OutgoingCallData_OutgoingCallEvent_Cancelled.fromJSON(object.cancelled) + : undefined, + terminated: isSet(object.terminated) + ? OutgoingCallData_OutgoingCallEvent_Terminated.fromJSON(object.terminated) + : undefined, }; }, @@ -2018,6 +1787,12 @@ export const OutgoingCallData_OutgoingCallEvent = { if (message.ended !== undefined) { obj.ended = OutgoingCallData_OutgoingCallEvent_Ended.toJSON(message.ended); } + if (message.cancelled !== undefined) { + obj.cancelled = OutgoingCallData_OutgoingCallEvent_Cancelled.toJSON(message.cancelled); + } + if (message.terminated !== undefined) { + obj.terminated = OutgoingCallData_OutgoingCallEvent_Terminated.toJSON(message.terminated); + } return obj; }, @@ -2039,6 +1814,12 @@ export const OutgoingCallData_OutgoingCallEvent = { message.ended = (object.ended !== undefined && object.ended !== null) ? OutgoingCallData_OutgoingCallEvent_Ended.fromPartial(object.ended) : undefined; + message.cancelled = (object.cancelled !== undefined && object.cancelled !== null) + ? OutgoingCallData_OutgoingCallEvent_Cancelled.fromPartial(object.cancelled) + : undefined; + message.terminated = (object.terminated !== undefined && object.terminated !== null) + ? OutgoingCallData_OutgoingCallEvent_Terminated.fromPartial(object.terminated) + : undefined; return message; }, }; @@ -2119,98 +1900,539 @@ export const OutgoingCallData_OutgoingCallEvent_SipEvent = { return message; }, - fromJSON(object: any): OutgoingCallData_OutgoingCallEvent_SipEvent { - return { - provisional: isSet(object.provisional) - ? OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional.fromJSON(object.provisional) - : undefined, - early: isSet(object.early) ? OutgoingCallData_OutgoingCallEvent_SipEvent_Early.fromJSON(object.early) : undefined, - accepted: isSet(object.accepted) - ? OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted.fromJSON(object.accepted) - : undefined, - failure: isSet(object.failure) - ? OutgoingCallData_OutgoingCallEvent_SipEvent_Failure.fromJSON(object.failure) - : undefined, - bye: isSet(object.bye) ? OutgoingCallData_OutgoingCallEvent_SipEvent_Bye.fromJSON(object.bye) : undefined, - }; + fromJSON(object: any): OutgoingCallData_OutgoingCallEvent_SipEvent { + return { + provisional: isSet(object.provisional) + ? OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional.fromJSON(object.provisional) + : undefined, + early: isSet(object.early) ? OutgoingCallData_OutgoingCallEvent_SipEvent_Early.fromJSON(object.early) : undefined, + accepted: isSet(object.accepted) + ? OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted.fromJSON(object.accepted) + : undefined, + failure: isSet(object.failure) + ? OutgoingCallData_OutgoingCallEvent_SipEvent_Failure.fromJSON(object.failure) + : undefined, + bye: isSet(object.bye) ? OutgoingCallData_OutgoingCallEvent_SipEvent_Bye.fromJSON(object.bye) : undefined, + }; + }, + + toJSON(message: OutgoingCallData_OutgoingCallEvent_SipEvent): unknown { + const obj: any = {}; + if (message.provisional !== undefined) { + obj.provisional = OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional.toJSON(message.provisional); + } + if (message.early !== undefined) { + obj.early = OutgoingCallData_OutgoingCallEvent_SipEvent_Early.toJSON(message.early); + } + if (message.accepted !== undefined) { + obj.accepted = OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted.toJSON(message.accepted); + } + if (message.failure !== undefined) { + obj.failure = OutgoingCallData_OutgoingCallEvent_SipEvent_Failure.toJSON(message.failure); + } + if (message.bye !== undefined) { + obj.bye = OutgoingCallData_OutgoingCallEvent_SipEvent_Bye.toJSON(message.bye); + } + return obj; + }, + + create, I>>( + base?: I, + ): OutgoingCallData_OutgoingCallEvent_SipEvent { + return OutgoingCallData_OutgoingCallEvent_SipEvent.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): OutgoingCallData_OutgoingCallEvent_SipEvent { + const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent(); + message.provisional = (object.provisional !== undefined && object.provisional !== null) + ? OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional.fromPartial(object.provisional) + : undefined; + message.early = (object.early !== undefined && object.early !== null) + ? OutgoingCallData_OutgoingCallEvent_SipEvent_Early.fromPartial(object.early) + : undefined; + message.accepted = (object.accepted !== undefined && object.accepted !== null) + ? OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted.fromPartial(object.accepted) + : undefined; + message.failure = (object.failure !== undefined && object.failure !== null) + ? OutgoingCallData_OutgoingCallEvent_SipEvent_Failure.fromPartial(object.failure) + : undefined; + message.bye = (object.bye !== undefined && object.bye !== null) + ? OutgoingCallData_OutgoingCallEvent_SipEvent_Bye.fromPartial(object.bye) + : undefined; + return message; + }, +}; + +function createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Provisional(): OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional { + return { code: 0 }; +} + +export const OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional = { + encode( + message: OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Provisional(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.code = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional { + return { code: isSet(object.code) ? globalThis.Number(object.code) : 0 }; + }, + + toJSON(message: OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional): unknown { + const obj: any = {}; + if (message.code !== 0) { + obj.code = Math.round(message.code); + } + return obj; + }, + + create, I>>( + base?: I, + ): OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional { + return OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional { + const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Provisional(); + message.code = object.code ?? 0; + return message; + }, +}; + +function createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Early(): OutgoingCallData_OutgoingCallEvent_SipEvent_Early { + return { code: 0 }; +} + +export const OutgoingCallData_OutgoingCallEvent_SipEvent_Early = { + encode( + message: OutgoingCallData_OutgoingCallEvent_SipEvent_Early, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_SipEvent_Early { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Early(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.code = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): OutgoingCallData_OutgoingCallEvent_SipEvent_Early { + return { code: isSet(object.code) ? globalThis.Number(object.code) : 0 }; + }, + + toJSON(message: OutgoingCallData_OutgoingCallEvent_SipEvent_Early): unknown { + const obj: any = {}; + if (message.code !== 0) { + obj.code = Math.round(message.code); + } + return obj; + }, + + create, I>>( + base?: I, + ): OutgoingCallData_OutgoingCallEvent_SipEvent_Early { + return OutgoingCallData_OutgoingCallEvent_SipEvent_Early.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): OutgoingCallData_OutgoingCallEvent_SipEvent_Early { + const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Early(); + message.code = object.code ?? 0; + return message; + }, +}; + +function createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Accepted(): OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted { + return { code: 0 }; +} + +export const OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted = { + encode( + message: OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Accepted(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.code = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted { + return { code: isSet(object.code) ? globalThis.Number(object.code) : 0 }; + }, + + toJSON(message: OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted): unknown { + const obj: any = {}; + if (message.code !== 0) { + obj.code = Math.round(message.code); + } + return obj; + }, + + create, I>>( + base?: I, + ): OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted { + return OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted { + const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Accepted(); + message.code = object.code ?? 0; + return message; + }, +}; + +function createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Failure(): OutgoingCallData_OutgoingCallEvent_SipEvent_Failure { + return { code: 0 }; +} + +export const OutgoingCallData_OutgoingCallEvent_SipEvent_Failure = { + encode( + message: OutgoingCallData_OutgoingCallEvent_SipEvent_Failure, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_SipEvent_Failure { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Failure(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.code = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): OutgoingCallData_OutgoingCallEvent_SipEvent_Failure { + return { code: isSet(object.code) ? globalThis.Number(object.code) : 0 }; + }, + + toJSON(message: OutgoingCallData_OutgoingCallEvent_SipEvent_Failure): unknown { + const obj: any = {}; + if (message.code !== 0) { + obj.code = Math.round(message.code); + } + return obj; + }, + + create, I>>( + base?: I, + ): OutgoingCallData_OutgoingCallEvent_SipEvent_Failure { + return OutgoingCallData_OutgoingCallEvent_SipEvent_Failure.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): OutgoingCallData_OutgoingCallEvent_SipEvent_Failure { + const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Failure(); + message.code = object.code ?? 0; + return message; + }, +}; + +function createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Bye(): OutgoingCallData_OutgoingCallEvent_SipEvent_Bye { + return {}; +} + +export const OutgoingCallData_OutgoingCallEvent_SipEvent_Bye = { + encode(_: OutgoingCallData_OutgoingCallEvent_SipEvent_Bye, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_SipEvent_Bye { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Bye(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): OutgoingCallData_OutgoingCallEvent_SipEvent_Bye { + return {}; + }, + + toJSON(_: OutgoingCallData_OutgoingCallEvent_SipEvent_Bye): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): OutgoingCallData_OutgoingCallEvent_SipEvent_Bye { + return OutgoingCallData_OutgoingCallEvent_SipEvent_Bye.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): OutgoingCallData_OutgoingCallEvent_SipEvent_Bye { + const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Bye(); + return message; + }, +}; + +function createBaseOutgoingCallData_OutgoingCallEvent_Cancelled(): OutgoingCallData_OutgoingCallEvent_Cancelled { + return {}; +} + +export const OutgoingCallData_OutgoingCallEvent_Cancelled = { + encode(_: OutgoingCallData_OutgoingCallEvent_Cancelled, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_Cancelled { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutgoingCallData_OutgoingCallEvent_Cancelled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): OutgoingCallData_OutgoingCallEvent_Cancelled { + return {}; + }, + + toJSON(_: OutgoingCallData_OutgoingCallEvent_Cancelled): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): OutgoingCallData_OutgoingCallEvent_Cancelled { + return OutgoingCallData_OutgoingCallEvent_Cancelled.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): OutgoingCallData_OutgoingCallEvent_Cancelled { + const message = createBaseOutgoingCallData_OutgoingCallEvent_Cancelled(); + return message; + }, +}; + +function createBaseOutgoingCallData_OutgoingCallEvent_Terminated(): OutgoingCallData_OutgoingCallEvent_Terminated { + return {}; +} + +export const OutgoingCallData_OutgoingCallEvent_Terminated = { + encode(_: OutgoingCallData_OutgoingCallEvent_Terminated, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_Terminated { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutgoingCallData_OutgoingCallEvent_Terminated(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): OutgoingCallData_OutgoingCallEvent_Terminated { + return {}; + }, + + toJSON(_: OutgoingCallData_OutgoingCallEvent_Terminated): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): OutgoingCallData_OutgoingCallEvent_Terminated { + return OutgoingCallData_OutgoingCallEvent_Terminated.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): OutgoingCallData_OutgoingCallEvent_Terminated { + const message = createBaseOutgoingCallData_OutgoingCallEvent_Terminated(); + return message; + }, +}; + +function createBaseOutgoingCallData_OutgoingCallEvent_Ended(): OutgoingCallData_OutgoingCallEvent_Ended { + return {}; +} + +export const OutgoingCallData_OutgoingCallEvent_Ended = { + encode(_: OutgoingCallData_OutgoingCallEvent_Ended, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_Ended { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutgoingCallData_OutgoingCallEvent_Ended(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): OutgoingCallData_OutgoingCallEvent_Ended { + return {}; }, - toJSON(message: OutgoingCallData_OutgoingCallEvent_SipEvent): unknown { + toJSON(_: OutgoingCallData_OutgoingCallEvent_Ended): unknown { const obj: any = {}; - if (message.provisional !== undefined) { - obj.provisional = OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional.toJSON(message.provisional); - } - if (message.early !== undefined) { - obj.early = OutgoingCallData_OutgoingCallEvent_SipEvent_Early.toJSON(message.early); - } - if (message.accepted !== undefined) { - obj.accepted = OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted.toJSON(message.accepted); - } - if (message.failure !== undefined) { - obj.failure = OutgoingCallData_OutgoingCallEvent_SipEvent_Failure.toJSON(message.failure); - } - if (message.bye !== undefined) { - obj.bye = OutgoingCallData_OutgoingCallEvent_SipEvent_Bye.toJSON(message.bye); - } return obj; }, - create, I>>( + create, I>>( base?: I, - ): OutgoingCallData_OutgoingCallEvent_SipEvent { - return OutgoingCallData_OutgoingCallEvent_SipEvent.fromPartial(base ?? ({} as any)); + ): OutgoingCallData_OutgoingCallEvent_Ended { + return OutgoingCallData_OutgoingCallEvent_Ended.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( - object: I, - ): OutgoingCallData_OutgoingCallEvent_SipEvent { - const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent(); - message.provisional = (object.provisional !== undefined && object.provisional !== null) - ? OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional.fromPartial(object.provisional) - : undefined; - message.early = (object.early !== undefined && object.early !== null) - ? OutgoingCallData_OutgoingCallEvent_SipEvent_Early.fromPartial(object.early) - : undefined; - message.accepted = (object.accepted !== undefined && object.accepted !== null) - ? OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted.fromPartial(object.accepted) - : undefined; - message.failure = (object.failure !== undefined && object.failure !== null) - ? OutgoingCallData_OutgoingCallEvent_SipEvent_Failure.fromPartial(object.failure) - : undefined; - message.bye = (object.bye !== undefined && object.bye !== null) - ? OutgoingCallData_OutgoingCallEvent_SipEvent_Bye.fromPartial(object.bye) - : undefined; + fromPartial, I>>( + _: I, + ): OutgoingCallData_OutgoingCallEvent_Ended { + const message = createBaseOutgoingCallData_OutgoingCallEvent_Ended(); return message; }, }; -function createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Provisional(): OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional { - return { code: 0 }; +function createBaseOutgoingCallData_OutgoingCallEvent_Error(): OutgoingCallData_OutgoingCallEvent_Error { + return { message: "" }; } -export const OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional = { - encode( - message: OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); +export const OutgoingCallData_OutgoingCallEvent_Error = { + encode(message: OutgoingCallData_OutgoingCallEvent_Error, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional { + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_Error { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Provisional(); + const message = createBaseOutgoingCallData_OutgoingCallEvent_Error(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (tag !== 8) { + if (tag !== 10) { break; } - message.code = reader.uint32(); + message.message = reader.string(); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -2221,51 +2443,51 @@ export const OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional = { return message; }, - fromJSON(object: any): OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional { - return { code: isSet(object.code) ? globalThis.Number(object.code) : 0 }; + fromJSON(object: any): OutgoingCallData_OutgoingCallEvent_Error { + return { message: isSet(object.message) ? globalThis.String(object.message) : "" }; }, - toJSON(message: OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional): unknown { + toJSON(message: OutgoingCallData_OutgoingCallEvent_Error): unknown { const obj: any = {}; - if (message.code !== 0) { - obj.code = Math.round(message.code); + if (message.message !== "") { + obj.message = message.message; } return obj; }, - create, I>>( + create, I>>( base?: I, - ): OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional { - return OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional.fromPartial(base ?? ({} as any)); + ): OutgoingCallData_OutgoingCallEvent_Error { + return OutgoingCallData_OutgoingCallEvent_Error.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): OutgoingCallData_OutgoingCallEvent_SipEvent_Provisional { - const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Provisional(); - message.code = object.code ?? 0; + ): OutgoingCallData_OutgoingCallEvent_Error { + const message = createBaseOutgoingCallData_OutgoingCallEvent_Error(); + message.message = object.message ?? ""; return message; }, }; -function createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Early(): OutgoingCallData_OutgoingCallEvent_SipEvent_Early { - return { code: 0 }; +function createBaseOutgoingCallData_OutgoingCallRequest(): OutgoingCallData_OutgoingCallRequest { + return { reqId: 0, end: undefined }; } -export const OutgoingCallData_OutgoingCallEvent_SipEvent_Early = { - encode( - message: OutgoingCallData_OutgoingCallEvent_SipEvent_Early, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); +export const OutgoingCallData_OutgoingCallRequest = { + encode(message: OutgoingCallData_OutgoingCallRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.reqId !== 0) { + writer.uint32(8).uint32(message.reqId); + } + if (message.end !== undefined) { + OutgoingCallData_OutgoingCallRequest_End.encode(message.end, writer.uint32(82).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_SipEvent_Early { + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallRequest { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Early(); + const message = createBaseOutgoingCallData_OutgoingCallRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2274,7 +2496,14 @@ export const OutgoingCallData_OutgoingCallEvent_SipEvent_Early = { break; } - message.code = reader.uint32(); + message.reqId = reader.uint32(); + continue; + case 10: + if (tag !== 82) { + break; + } + + message.end = OutgoingCallData_OutgoingCallRequest_End.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -2285,61 +2514,57 @@ export const OutgoingCallData_OutgoingCallEvent_SipEvent_Early = { return message; }, - fromJSON(object: any): OutgoingCallData_OutgoingCallEvent_SipEvent_Early { - return { code: isSet(object.code) ? globalThis.Number(object.code) : 0 }; + fromJSON(object: any): OutgoingCallData_OutgoingCallRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : 0, + end: isSet(object.end) ? OutgoingCallData_OutgoingCallRequest_End.fromJSON(object.end) : undefined, + }; }, - toJSON(message: OutgoingCallData_OutgoingCallEvent_SipEvent_Early): unknown { + toJSON(message: OutgoingCallData_OutgoingCallRequest): unknown { const obj: any = {}; - if (message.code !== 0) { - obj.code = Math.round(message.code); + if (message.reqId !== 0) { + obj.reqId = Math.round(message.reqId); + } + if (message.end !== undefined) { + obj.end = OutgoingCallData_OutgoingCallRequest_End.toJSON(message.end); } return obj; }, - create, I>>( + create, I>>( base?: I, - ): OutgoingCallData_OutgoingCallEvent_SipEvent_Early { - return OutgoingCallData_OutgoingCallEvent_SipEvent_Early.fromPartial(base ?? ({} as any)); + ): OutgoingCallData_OutgoingCallRequest { + return OutgoingCallData_OutgoingCallRequest.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): OutgoingCallData_OutgoingCallEvent_SipEvent_Early { - const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Early(); - message.code = object.code ?? 0; + ): OutgoingCallData_OutgoingCallRequest { + const message = createBaseOutgoingCallData_OutgoingCallRequest(); + message.reqId = object.reqId ?? 0; + message.end = (object.end !== undefined && object.end !== null) + ? OutgoingCallData_OutgoingCallRequest_End.fromPartial(object.end) + : undefined; return message; }, }; -function createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Accepted(): OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted { - return { code: 0 }; +function createBaseOutgoingCallData_OutgoingCallRequest_End(): OutgoingCallData_OutgoingCallRequest_End { + return {}; } -export const OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted = { - encode( - message: OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); - } +export const OutgoingCallData_OutgoingCallRequest_End = { + encode(_: OutgoingCallData_OutgoingCallRequest_End, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted { + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallRequest_End { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Accepted(); + const message = createBaseOutgoingCallData_OutgoingCallRequest_End(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.code = reader.uint32(); - continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -2349,51 +2574,50 @@ export const OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted = { return message; }, - fromJSON(object: any): OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted { - return { code: isSet(object.code) ? globalThis.Number(object.code) : 0 }; + fromJSON(_: any): OutgoingCallData_OutgoingCallRequest_End { + return {}; }, - toJSON(message: OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted): unknown { + toJSON(_: OutgoingCallData_OutgoingCallRequest_End): unknown { const obj: any = {}; - if (message.code !== 0) { - obj.code = Math.round(message.code); - } return obj; }, - create, I>>( + create, I>>( base?: I, - ): OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted { - return OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted.fromPartial(base ?? ({} as any)); + ): OutgoingCallData_OutgoingCallRequest_End { + return OutgoingCallData_OutgoingCallRequest_End.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( - object: I, - ): OutgoingCallData_OutgoingCallEvent_SipEvent_Accepted { - const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Accepted(); - message.code = object.code ?? 0; + fromPartial, I>>( + _: I, + ): OutgoingCallData_OutgoingCallRequest_End { + const message = createBaseOutgoingCallData_OutgoingCallRequest_End(); return message; }, }; -function createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Failure(): OutgoingCallData_OutgoingCallEvent_SipEvent_Failure { - return { code: 0 }; +function createBaseOutgoingCallData_OutgoingCallResponse(): OutgoingCallData_OutgoingCallResponse { + return { reqId: 0, error: undefined, end: undefined }; } -export const OutgoingCallData_OutgoingCallEvent_SipEvent_Failure = { - encode( - message: OutgoingCallData_OutgoingCallEvent_SipEvent_Failure, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); +export const OutgoingCallData_OutgoingCallResponse = { + encode(message: OutgoingCallData_OutgoingCallResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.reqId !== 0) { + writer.uint32(8).uint32(message.reqId); + } + if (message.error !== undefined) { + OutgoingCallData_OutgoingCallResponse_Error.encode(message.error, writer.uint32(82).fork()).ldelim(); + } + if (message.end !== undefined) { + OutgoingCallData_OutgoingCallResponse_End.encode(message.end, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_SipEvent_Failure { + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallResponse { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Failure(); + const message = createBaseOutgoingCallData_OutgoingCallResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2402,7 +2626,21 @@ export const OutgoingCallData_OutgoingCallEvent_SipEvent_Failure = { break; } - message.code = reader.uint32(); + message.reqId = reader.uint32(); + continue; + case 10: + if (tag !== 82) { + break; + } + + message.error = OutgoingCallData_OutgoingCallResponse_Error.decode(reader, reader.uint32()); + continue; + case 11: + if (tag !== 90) { + break; + } + + message.end = OutgoingCallData_OutgoingCallResponse_End.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -2413,45 +2651,61 @@ export const OutgoingCallData_OutgoingCallEvent_SipEvent_Failure = { return message; }, - fromJSON(object: any): OutgoingCallData_OutgoingCallEvent_SipEvent_Failure { - return { code: isSet(object.code) ? globalThis.Number(object.code) : 0 }; + fromJSON(object: any): OutgoingCallData_OutgoingCallResponse { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : 0, + error: isSet(object.error) ? OutgoingCallData_OutgoingCallResponse_Error.fromJSON(object.error) : undefined, + end: isSet(object.end) ? OutgoingCallData_OutgoingCallResponse_End.fromJSON(object.end) : undefined, + }; }, - toJSON(message: OutgoingCallData_OutgoingCallEvent_SipEvent_Failure): unknown { + toJSON(message: OutgoingCallData_OutgoingCallResponse): unknown { const obj: any = {}; - if (message.code !== 0) { - obj.code = Math.round(message.code); + if (message.reqId !== 0) { + obj.reqId = Math.round(message.reqId); + } + if (message.error !== undefined) { + obj.error = OutgoingCallData_OutgoingCallResponse_Error.toJSON(message.error); + } + if (message.end !== undefined) { + obj.end = OutgoingCallData_OutgoingCallResponse_End.toJSON(message.end); } return obj; }, - create, I>>( + create, I>>( base?: I, - ): OutgoingCallData_OutgoingCallEvent_SipEvent_Failure { - return OutgoingCallData_OutgoingCallEvent_SipEvent_Failure.fromPartial(base ?? ({} as any)); + ): OutgoingCallData_OutgoingCallResponse { + return OutgoingCallData_OutgoingCallResponse.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): OutgoingCallData_OutgoingCallEvent_SipEvent_Failure { - const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Failure(); - message.code = object.code ?? 0; + ): OutgoingCallData_OutgoingCallResponse { + const message = createBaseOutgoingCallData_OutgoingCallResponse(); + message.reqId = object.reqId ?? 0; + message.error = (object.error !== undefined && object.error !== null) + ? OutgoingCallData_OutgoingCallResponse_Error.fromPartial(object.error) + : undefined; + message.end = (object.end !== undefined && object.end !== null) + ? OutgoingCallData_OutgoingCallResponse_End.fromPartial(object.end) + : undefined; return message; }, }; -function createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Bye(): OutgoingCallData_OutgoingCallEvent_SipEvent_Bye { +function createBaseOutgoingCallData_OutgoingCallResponse_End(): OutgoingCallData_OutgoingCallResponse_End { return {}; } -export const OutgoingCallData_OutgoingCallEvent_SipEvent_Bye = { - encode(_: OutgoingCallData_OutgoingCallEvent_SipEvent_Bye, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const OutgoingCallData_OutgoingCallResponse_End = { + encode(_: OutgoingCallData_OutgoingCallResponse_End, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_SipEvent_Bye { + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallResponse_End { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Bye(); + const message = createBaseOutgoingCallData_OutgoingCallResponse_End(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2464,44 +2718,54 @@ export const OutgoingCallData_OutgoingCallEvent_SipEvent_Bye = { return message; }, - fromJSON(_: any): OutgoingCallData_OutgoingCallEvent_SipEvent_Bye { + fromJSON(_: any): OutgoingCallData_OutgoingCallResponse_End { return {}; }, - toJSON(_: OutgoingCallData_OutgoingCallEvent_SipEvent_Bye): unknown { + toJSON(_: OutgoingCallData_OutgoingCallResponse_End): unknown { const obj: any = {}; return obj; }, - create, I>>( + create, I>>( base?: I, - ): OutgoingCallData_OutgoingCallEvent_SipEvent_Bye { - return OutgoingCallData_OutgoingCallEvent_SipEvent_Bye.fromPartial(base ?? ({} as any)); + ): OutgoingCallData_OutgoingCallResponse_End { + return OutgoingCallData_OutgoingCallResponse_End.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( + fromPartial, I>>( _: I, - ): OutgoingCallData_OutgoingCallEvent_SipEvent_Bye { - const message = createBaseOutgoingCallData_OutgoingCallEvent_SipEvent_Bye(); + ): OutgoingCallData_OutgoingCallResponse_End { + const message = createBaseOutgoingCallData_OutgoingCallResponse_End(); return message; }, }; -function createBaseOutgoingCallData_OutgoingCallEvent_Ended(): OutgoingCallData_OutgoingCallEvent_Ended { - return {}; +function createBaseOutgoingCallData_OutgoingCallResponse_Error(): OutgoingCallData_OutgoingCallResponse_Error { + return { message: "" }; } -export const OutgoingCallData_OutgoingCallEvent_Ended = { - encode(_: OutgoingCallData_OutgoingCallEvent_Ended, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const OutgoingCallData_OutgoingCallResponse_Error = { + encode(message: OutgoingCallData_OutgoingCallResponse_Error, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_Ended { + decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallResponse_Error { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOutgoingCallData_OutgoingCallEvent_Ended(); + const message = createBaseOutgoingCallData_OutgoingCallResponse_Error(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.message = reader.string(); + continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -2511,53 +2775,87 @@ export const OutgoingCallData_OutgoingCallEvent_Ended = { return message; }, - fromJSON(_: any): OutgoingCallData_OutgoingCallEvent_Ended { - return {}; + fromJSON(object: any): OutgoingCallData_OutgoingCallResponse_Error { + return { message: isSet(object.message) ? globalThis.String(object.message) : "" }; }, - toJSON(_: OutgoingCallData_OutgoingCallEvent_Ended): unknown { + toJSON(message: OutgoingCallData_OutgoingCallResponse_Error): unknown { const obj: any = {}; + if (message.message !== "") { + obj.message = message.message; + } return obj; }, - create, I>>( + create, I>>( base?: I, - ): OutgoingCallData_OutgoingCallEvent_Ended { - return OutgoingCallData_OutgoingCallEvent_Ended.fromPartial(base ?? ({} as any)); + ): OutgoingCallData_OutgoingCallResponse_Error { + return OutgoingCallData_OutgoingCallResponse_Error.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( - _: I, - ): OutgoingCallData_OutgoingCallEvent_Ended { - const message = createBaseOutgoingCallData_OutgoingCallEvent_Ended(); + fromPartial, I>>( + object: I, + ): OutgoingCallData_OutgoingCallResponse_Error { + const message = createBaseOutgoingCallData_OutgoingCallResponse_Error(); + message.message = object.message ?? ""; return message; }, }; -function createBaseOutgoingCallData_OutgoingCallEvent_Error(): OutgoingCallData_OutgoingCallEvent_Error { - return { message: "" }; +function createBaseIncomingCallNotify(): IncomingCallNotify { + return { arrived: undefined, cancelled: undefined, accepted: undefined, rejected: undefined }; } -export const OutgoingCallData_OutgoingCallEvent_Error = { - encode(message: OutgoingCallData_OutgoingCallEvent_Error, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.message !== "") { - writer.uint32(10).string(message.message); +export const IncomingCallNotify = { + encode(message: IncomingCallNotify, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.arrived !== undefined) { + IncomingCallNotify_CallArrived.encode(message.arrived, writer.uint32(82).fork()).ldelim(); + } + if (message.cancelled !== undefined) { + IncomingCallNotify_CallCancelled.encode(message.cancelled, writer.uint32(90).fork()).ldelim(); + } + if (message.accepted !== undefined) { + IncomingCallNotify_CallAccepted.encode(message.accepted, writer.uint32(98).fork()).ldelim(); + } + if (message.rejected !== undefined) { + IncomingCallNotify_CallRejected.encode(message.rejected, writer.uint32(106).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallEvent_Error { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallNotify { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOutgoingCallData_OutgoingCallEvent_Error(); + const message = createBaseIncomingCallNotify(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (tag !== 10) { + case 10: + if (tag !== 82) { break; } - message.message = reader.string(); + message.arrived = IncomingCallNotify_CallArrived.decode(reader, reader.uint32()); + continue; + case 11: + if (tag !== 90) { + break; + } + + message.cancelled = IncomingCallNotify_CallCancelled.decode(reader, reader.uint32()); + continue; + case 12: + if (tag !== 98) { + break; + } + + message.accepted = IncomingCallNotify_CallAccepted.decode(reader, reader.uint32()); + continue; + case 13: + if (tag !== 106) { + break; + } + + message.rejected = IncomingCallNotify_CallRejected.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -2568,67 +2866,108 @@ export const OutgoingCallData_OutgoingCallEvent_Error = { return message; }, - fromJSON(object: any): OutgoingCallData_OutgoingCallEvent_Error { - return { message: isSet(object.message) ? globalThis.String(object.message) : "" }; + fromJSON(object: any): IncomingCallNotify { + return { + arrived: isSet(object.arrived) ? IncomingCallNotify_CallArrived.fromJSON(object.arrived) : undefined, + cancelled: isSet(object.cancelled) ? IncomingCallNotify_CallCancelled.fromJSON(object.cancelled) : undefined, + accepted: isSet(object.accepted) ? IncomingCallNotify_CallAccepted.fromJSON(object.accepted) : undefined, + rejected: isSet(object.rejected) ? IncomingCallNotify_CallRejected.fromJSON(object.rejected) : undefined, + }; }, - toJSON(message: OutgoingCallData_OutgoingCallEvent_Error): unknown { + toJSON(message: IncomingCallNotify): unknown { const obj: any = {}; - if (message.message !== "") { - obj.message = message.message; + if (message.arrived !== undefined) { + obj.arrived = IncomingCallNotify_CallArrived.toJSON(message.arrived); + } + if (message.cancelled !== undefined) { + obj.cancelled = IncomingCallNotify_CallCancelled.toJSON(message.cancelled); + } + if (message.accepted !== undefined) { + obj.accepted = IncomingCallNotify_CallAccepted.toJSON(message.accepted); + } + if (message.rejected !== undefined) { + obj.rejected = IncomingCallNotify_CallRejected.toJSON(message.rejected); } return obj; }, - create, I>>( - base?: I, - ): OutgoingCallData_OutgoingCallEvent_Error { - return OutgoingCallData_OutgoingCallEvent_Error.fromPartial(base ?? ({} as any)); + create, I>>(base?: I): IncomingCallNotify { + return IncomingCallNotify.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( - object: I, - ): OutgoingCallData_OutgoingCallEvent_Error { - const message = createBaseOutgoingCallData_OutgoingCallEvent_Error(); - message.message = object.message ?? ""; + fromPartial, I>>(object: I): IncomingCallNotify { + const message = createBaseIncomingCallNotify(); + message.arrived = (object.arrived !== undefined && object.arrived !== null) + ? IncomingCallNotify_CallArrived.fromPartial(object.arrived) + : undefined; + message.cancelled = (object.cancelled !== undefined && object.cancelled !== null) + ? IncomingCallNotify_CallCancelled.fromPartial(object.cancelled) + : undefined; + message.accepted = (object.accepted !== undefined && object.accepted !== null) + ? IncomingCallNotify_CallAccepted.fromPartial(object.accepted) + : undefined; + message.rejected = (object.rejected !== undefined && object.rejected !== null) + ? IncomingCallNotify_CallRejected.fromPartial(object.rejected) + : undefined; return message; }, }; -function createBaseOutgoingCallData_OutgoingCallRequest(): OutgoingCallData_OutgoingCallRequest { - return { reqId: 0, end: undefined }; +function createBaseIncomingCallNotify_CallArrived(): IncomingCallNotify_CallArrived { + return { callToken: "", callWs: "", callFrom: "", callTo: "" }; } -export const OutgoingCallData_OutgoingCallRequest = { - encode(message: OutgoingCallData_OutgoingCallRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.reqId !== 0) { - writer.uint32(8).uint32(message.reqId); +export const IncomingCallNotify_CallArrived = { + encode(message: IncomingCallNotify_CallArrived, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.callToken !== "") { + writer.uint32(10).string(message.callToken); } - if (message.end !== undefined) { - OutgoingCallData_OutgoingCallRequest_End.encode(message.end, writer.uint32(82).fork()).ldelim(); + if (message.callWs !== "") { + writer.uint32(18).string(message.callWs); + } + if (message.callFrom !== "") { + writer.uint32(26).string(message.callFrom); + } + if (message.callTo !== "") { + writer.uint32(34).string(message.callTo); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallNotify_CallArrived { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOutgoingCallData_OutgoingCallRequest(); + const message = createBaseIncomingCallNotify_CallArrived(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (tag !== 8) { + if (tag !== 10) { break; } - message.reqId = reader.uint32(); + message.callToken = reader.string(); continue; - case 10: - if (tag !== 82) { + case 2: + if (tag !== 18) { + break; + } + + message.callWs = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.callFrom = reader.string(); + continue; + case 4: + if (tag !== 34) { break; } - message.end = OutgoingCallData_OutgoingCallRequest_End.decode(reader, reader.uint32()); + message.callTo = reader.string(); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -2639,57 +2978,83 @@ export const OutgoingCallData_OutgoingCallRequest = { return message; }, - fromJSON(object: any): OutgoingCallData_OutgoingCallRequest { + fromJSON(object: any): IncomingCallNotify_CallArrived { return { - reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : 0, - end: isSet(object.end) ? OutgoingCallData_OutgoingCallRequest_End.fromJSON(object.end) : undefined, + callToken: isSet(object.callToken) ? globalThis.String(object.callToken) : "", + callWs: isSet(object.callWs) ? globalThis.String(object.callWs) : "", + callFrom: isSet(object.callFrom) ? globalThis.String(object.callFrom) : "", + callTo: isSet(object.callTo) ? globalThis.String(object.callTo) : "", }; }, - toJSON(message: OutgoingCallData_OutgoingCallRequest): unknown { + toJSON(message: IncomingCallNotify_CallArrived): unknown { const obj: any = {}; - if (message.reqId !== 0) { - obj.reqId = Math.round(message.reqId); + if (message.callToken !== "") { + obj.callToken = message.callToken; } - if (message.end !== undefined) { - obj.end = OutgoingCallData_OutgoingCallRequest_End.toJSON(message.end); + if (message.callWs !== "") { + obj.callWs = message.callWs; + } + if (message.callFrom !== "") { + obj.callFrom = message.callFrom; + } + if (message.callTo !== "") { + obj.callTo = message.callTo; } return obj; }, - create, I>>( - base?: I, - ): OutgoingCallData_OutgoingCallRequest { - return OutgoingCallData_OutgoingCallRequest.fromPartial(base ?? ({} as any)); + create, I>>(base?: I): IncomingCallNotify_CallArrived { + return IncomingCallNotify_CallArrived.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): OutgoingCallData_OutgoingCallRequest { - const message = createBaseOutgoingCallData_OutgoingCallRequest(); - message.reqId = object.reqId ?? 0; - message.end = (object.end !== undefined && object.end !== null) - ? OutgoingCallData_OutgoingCallRequest_End.fromPartial(object.end) - : undefined; + ): IncomingCallNotify_CallArrived { + const message = createBaseIncomingCallNotify_CallArrived(); + message.callToken = object.callToken ?? ""; + message.callWs = object.callWs ?? ""; + message.callFrom = object.callFrom ?? ""; + message.callTo = object.callTo ?? ""; return message; }, }; -function createBaseOutgoingCallData_OutgoingCallRequest_End(): OutgoingCallData_OutgoingCallRequest_End { - return {}; +function createBaseIncomingCallNotify_CallCancelled(): IncomingCallNotify_CallCancelled { + return { callFrom: "", callTo: "" }; } -export const OutgoingCallData_OutgoingCallRequest_End = { - encode(_: OutgoingCallData_OutgoingCallRequest_End, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const IncomingCallNotify_CallCancelled = { + encode(message: IncomingCallNotify_CallCancelled, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.callFrom !== "") { + writer.uint32(26).string(message.callFrom); + } + if (message.callTo !== "") { + writer.uint32(34).string(message.callTo); + } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallRequest_End { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallNotify_CallCancelled { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOutgoingCallData_OutgoingCallRequest_End(); + const message = createBaseIncomingCallNotify_CallCancelled(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 3: + if (tag !== 26) { + break; + } + + message.callFrom = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.callTo = reader.string(); + continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -2699,73 +3064,74 @@ export const OutgoingCallData_OutgoingCallRequest_End = { return message; }, - fromJSON(_: any): OutgoingCallData_OutgoingCallRequest_End { - return {}; + fromJSON(object: any): IncomingCallNotify_CallCancelled { + return { + callFrom: isSet(object.callFrom) ? globalThis.String(object.callFrom) : "", + callTo: isSet(object.callTo) ? globalThis.String(object.callTo) : "", + }; }, - toJSON(_: OutgoingCallData_OutgoingCallRequest_End): unknown { + toJSON(message: IncomingCallNotify_CallCancelled): unknown { const obj: any = {}; + if (message.callFrom !== "") { + obj.callFrom = message.callFrom; + } + if (message.callTo !== "") { + obj.callTo = message.callTo; + } return obj; }, - create, I>>( + create, I>>( base?: I, - ): OutgoingCallData_OutgoingCallRequest_End { - return OutgoingCallData_OutgoingCallRequest_End.fromPartial(base ?? ({} as any)); + ): IncomingCallNotify_CallCancelled { + return IncomingCallNotify_CallCancelled.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( - _: I, - ): OutgoingCallData_OutgoingCallRequest_End { - const message = createBaseOutgoingCallData_OutgoingCallRequest_End(); + fromPartial, I>>( + object: I, + ): IncomingCallNotify_CallCancelled { + const message = createBaseIncomingCallNotify_CallCancelled(); + message.callFrom = object.callFrom ?? ""; + message.callTo = object.callTo ?? ""; return message; }, }; -function createBaseOutgoingCallData_OutgoingCallResponse(): OutgoingCallData_OutgoingCallResponse { - return { reqId: 0, error: undefined, end: undefined }; +function createBaseIncomingCallNotify_CallAccepted(): IncomingCallNotify_CallAccepted { + return { callFrom: "", callTo: "" }; } -export const OutgoingCallData_OutgoingCallResponse = { - encode(message: OutgoingCallData_OutgoingCallResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.reqId !== 0) { - writer.uint32(8).uint32(message.reqId); - } - if (message.error !== undefined) { - OutgoingCallData_OutgoingCallResponse_Error.encode(message.error, writer.uint32(82).fork()).ldelim(); +export const IncomingCallNotify_CallAccepted = { + encode(message: IncomingCallNotify_CallAccepted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.callFrom !== "") { + writer.uint32(26).string(message.callFrom); } - if (message.end !== undefined) { - OutgoingCallData_OutgoingCallResponse_End.encode(message.end, writer.uint32(90).fork()).ldelim(); + if (message.callTo !== "") { + writer.uint32(34).string(message.callTo); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallNotify_CallAccepted { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOutgoingCallData_OutgoingCallResponse(); + const message = createBaseIncomingCallNotify_CallAccepted(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.reqId = reader.uint32(); - continue; - case 10: - if (tag !== 82) { + case 3: + if (tag !== 26) { break; } - message.error = OutgoingCallData_OutgoingCallResponse_Error.decode(reader, reader.uint32()); + message.callFrom = reader.string(); continue; - case 11: - if (tag !== 90) { + case 4: + if (tag !== 34) { break; } - message.end = OutgoingCallData_OutgoingCallResponse_End.decode(reader, reader.uint32()); + message.callTo = reader.string(); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -2776,64 +3142,73 @@ export const OutgoingCallData_OutgoingCallResponse = { return message; }, - fromJSON(object: any): OutgoingCallData_OutgoingCallResponse { + fromJSON(object: any): IncomingCallNotify_CallAccepted { return { - reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : 0, - error: isSet(object.error) ? OutgoingCallData_OutgoingCallResponse_Error.fromJSON(object.error) : undefined, - end: isSet(object.end) ? OutgoingCallData_OutgoingCallResponse_End.fromJSON(object.end) : undefined, + callFrom: isSet(object.callFrom) ? globalThis.String(object.callFrom) : "", + callTo: isSet(object.callTo) ? globalThis.String(object.callTo) : "", }; }, - toJSON(message: OutgoingCallData_OutgoingCallResponse): unknown { + toJSON(message: IncomingCallNotify_CallAccepted): unknown { const obj: any = {}; - if (message.reqId !== 0) { - obj.reqId = Math.round(message.reqId); - } - if (message.error !== undefined) { - obj.error = OutgoingCallData_OutgoingCallResponse_Error.toJSON(message.error); + if (message.callFrom !== "") { + obj.callFrom = message.callFrom; } - if (message.end !== undefined) { - obj.end = OutgoingCallData_OutgoingCallResponse_End.toJSON(message.end); + if (message.callTo !== "") { + obj.callTo = message.callTo; } return obj; }, - create, I>>( - base?: I, - ): OutgoingCallData_OutgoingCallResponse { - return OutgoingCallData_OutgoingCallResponse.fromPartial(base ?? ({} as any)); + create, I>>(base?: I): IncomingCallNotify_CallAccepted { + return IncomingCallNotify_CallAccepted.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): OutgoingCallData_OutgoingCallResponse { - const message = createBaseOutgoingCallData_OutgoingCallResponse(); - message.reqId = object.reqId ?? 0; - message.error = (object.error !== undefined && object.error !== null) - ? OutgoingCallData_OutgoingCallResponse_Error.fromPartial(object.error) - : undefined; - message.end = (object.end !== undefined && object.end !== null) - ? OutgoingCallData_OutgoingCallResponse_End.fromPartial(object.end) - : undefined; + ): IncomingCallNotify_CallAccepted { + const message = createBaseIncomingCallNotify_CallAccepted(); + message.callFrom = object.callFrom ?? ""; + message.callTo = object.callTo ?? ""; return message; }, }; -function createBaseOutgoingCallData_OutgoingCallResponse_End(): OutgoingCallData_OutgoingCallResponse_End { - return {}; +function createBaseIncomingCallNotify_CallRejected(): IncomingCallNotify_CallRejected { + return { callFrom: "", callTo: "" }; } -export const OutgoingCallData_OutgoingCallResponse_End = { - encode(_: OutgoingCallData_OutgoingCallResponse_End, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const IncomingCallNotify_CallRejected = { + encode(message: IncomingCallNotify_CallRejected, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.callFrom !== "") { + writer.uint32(26).string(message.callFrom); + } + if (message.callTo !== "") { + writer.uint32(34).string(message.callTo); + } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallResponse_End { + decode(input: _m0.Reader | Uint8Array, length?: number): IncomingCallNotify_CallRejected { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOutgoingCallData_OutgoingCallResponse_End(); + const message = createBaseIncomingCallNotify_CallRejected(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 3: + if (tag !== 26) { + break; + } + + message.callFrom = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.callTo = reader.string(); + continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -2843,53 +3218,102 @@ export const OutgoingCallData_OutgoingCallResponse_End = { return message; }, - fromJSON(_: any): OutgoingCallData_OutgoingCallResponse_End { - return {}; + fromJSON(object: any): IncomingCallNotify_CallRejected { + return { + callFrom: isSet(object.callFrom) ? globalThis.String(object.callFrom) : "", + callTo: isSet(object.callTo) ? globalThis.String(object.callTo) : "", + }; }, - toJSON(_: OutgoingCallData_OutgoingCallResponse_End): unknown { + toJSON(message: IncomingCallNotify_CallRejected): unknown { const obj: any = {}; + if (message.callFrom !== "") { + obj.callFrom = message.callFrom; + } + if (message.callTo !== "") { + obj.callTo = message.callTo; + } return obj; }, - create, I>>( - base?: I, - ): OutgoingCallData_OutgoingCallResponse_End { - return OutgoingCallData_OutgoingCallResponse_End.fromPartial(base ?? ({} as any)); + create, I>>(base?: I): IncomingCallNotify_CallRejected { + return IncomingCallNotify_CallRejected.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( - _: I, - ): OutgoingCallData_OutgoingCallResponse_End { - const message = createBaseOutgoingCallData_OutgoingCallResponse_End(); + fromPartial, I>>( + object: I, + ): IncomingCallNotify_CallRejected { + const message = createBaseIncomingCallNotify_CallRejected(); + message.callFrom = object.callFrom ?? ""; + message.callTo = object.callTo ?? ""; return message; }, }; -function createBaseOutgoingCallData_OutgoingCallResponse_Error(): OutgoingCallData_OutgoingCallResponse_Error { - return { message: "" }; +function createBaseCallEvent(): CallEvent { + return { timestamp: 0, callId: "", notify: undefined, outgoing: undefined, incoming: undefined }; } -export const OutgoingCallData_OutgoingCallResponse_Error = { - encode(message: OutgoingCallData_OutgoingCallResponse_Error, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.message !== "") { - writer.uint32(10).string(message.message); +export const CallEvent = { + encode(message: CallEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.timestamp !== 0) { + writer.uint32(8).uint64(message.timestamp); + } + if (message.callId !== "") { + writer.uint32(18).string(message.callId); + } + if (message.notify !== undefined) { + IncomingCallNotify.encode(message.notify, writer.uint32(82).fork()).ldelim(); + } + if (message.outgoing !== undefined) { + OutgoingCallData_OutgoingCallEvent.encode(message.outgoing, writer.uint32(90).fork()).ldelim(); + } + if (message.incoming !== undefined) { + IncomingCallData_IncomingCallEvent.encode(message.incoming, writer.uint32(98).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OutgoingCallData_OutgoingCallResponse_Error { + decode(input: _m0.Reader | Uint8Array, length?: number): CallEvent { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOutgoingCallData_OutgoingCallResponse_Error(); + const message = createBaseCallEvent(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (tag !== 10) { + if (tag !== 8) { break; } - message.message = reader.string(); + message.timestamp = longToNumber(reader.uint64() as Long); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.callId = reader.string(); + continue; + case 10: + if (tag !== 82) { + break; + } + + message.notify = IncomingCallNotify.decode(reader, reader.uint32()); + continue; + case 11: + if (tag !== 90) { + break; + } + + message.outgoing = OutgoingCallData_OutgoingCallEvent.decode(reader, reader.uint32()); + continue; + case 12: + if (tag !== 98) { + break; + } + + message.incoming = IncomingCallData_IncomingCallEvent.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -2900,28 +3324,52 @@ export const OutgoingCallData_OutgoingCallResponse_Error = { return message; }, - fromJSON(object: any): OutgoingCallData_OutgoingCallResponse_Error { - return { message: isSet(object.message) ? globalThis.String(object.message) : "" }; + fromJSON(object: any): CallEvent { + return { + timestamp: isSet(object.timestamp) ? globalThis.Number(object.timestamp) : 0, + callId: isSet(object.callId) ? globalThis.String(object.callId) : "", + notify: isSet(object.notify) ? IncomingCallNotify.fromJSON(object.notify) : undefined, + outgoing: isSet(object.outgoing) ? OutgoingCallData_OutgoingCallEvent.fromJSON(object.outgoing) : undefined, + incoming: isSet(object.incoming) ? IncomingCallData_IncomingCallEvent.fromJSON(object.incoming) : undefined, + }; }, - toJSON(message: OutgoingCallData_OutgoingCallResponse_Error): unknown { + toJSON(message: CallEvent): unknown { const obj: any = {}; - if (message.message !== "") { - obj.message = message.message; + if (message.timestamp !== 0) { + obj.timestamp = Math.round(message.timestamp); + } + if (message.callId !== "") { + obj.callId = message.callId; + } + if (message.notify !== undefined) { + obj.notify = IncomingCallNotify.toJSON(message.notify); + } + if (message.outgoing !== undefined) { + obj.outgoing = OutgoingCallData_OutgoingCallEvent.toJSON(message.outgoing); + } + if (message.incoming !== undefined) { + obj.incoming = IncomingCallData_IncomingCallEvent.toJSON(message.incoming); } return obj; }, - create, I>>( - base?: I, - ): OutgoingCallData_OutgoingCallResponse_Error { - return OutgoingCallData_OutgoingCallResponse_Error.fromPartial(base ?? ({} as any)); + create, I>>(base?: I): CallEvent { + return CallEvent.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>( - object: I, - ): OutgoingCallData_OutgoingCallResponse_Error { - const message = createBaseOutgoingCallData_OutgoingCallResponse_Error(); - message.message = object.message ?? ""; + fromPartial, I>>(object: I): CallEvent { + const message = createBaseCallEvent(); + message.timestamp = object.timestamp ?? 0; + message.callId = object.callId ?? ""; + message.notify = (object.notify !== undefined && object.notify !== null) + ? IncomingCallNotify.fromPartial(object.notify) + : undefined; + message.outgoing = (object.outgoing !== undefined && object.outgoing !== null) + ? OutgoingCallData_OutgoingCallEvent.fromPartial(object.outgoing) + : undefined; + message.incoming = (object.incoming !== undefined && object.incoming !== null) + ? IncomingCallData_IncomingCallEvent.fromPartial(object.incoming) + : undefined; return message; }, }; @@ -2938,6 +3386,18 @@ type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +function longToNumber(long: Long): number { + if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + function isSet(value: any): boolean { return value !== null && value !== undefined; } diff --git a/packages/sdk-core/src/sip_incoming.ts b/packages/sdk-core/src/sip_incoming.ts index 256092a..314a4f2 100644 --- a/packages/sdk-core/src/sip_incoming.ts +++ b/packages/sdk-core/src/sip_incoming.ts @@ -1,4 +1,4 @@ -import { IncomingCallData, IncomingCallData_IncomingCallRequest_Accept2, IncomingCallData_IncomingCallResponse_Accept2 } from "./generated/protobuf/sip_gateway"; +import { IncomingCallData } from "./generated/protobuf/sip_gateway"; import { EventEmitter } from "./utils"; export interface IncomingSipCallStatus { @@ -13,7 +13,7 @@ export class SipIncomingCall extends EventEmitter { reqIdSeed = 1; reqs: Map void, (err: Error) => void]> = new Map(); - constructor(private callWs: string) { + constructor(callWs: string) { super() this.wsConn = new WebSocket(callWs); this.wsConn.binaryType = "arraybuffer"; @@ -64,7 +64,7 @@ export class SipIncomingCall extends EventEmitter { if (response.error) { reject(new Error(response.error.message)) } else { - resolve(response.accept || response.end || response.end || response.ring || response.accept2) + resolve(response.accept || response.end || response.end || response.ring || response.continue) } } else { console.error("Invalid response:", response); @@ -105,20 +105,6 @@ export class SipIncomingCall extends EventEmitter { }); } - async accept2(room: string, peer: string, record: boolean): Promise { - return new Promise((resolve, reject) => { - const buf = IncomingCallData.encode({ - request: { - reqId: this.reqIdSeed, - accept2: {} - } - }).finish(); - this.reqs.set(this.reqIdSeed, [resolve, reject]); - this.reqIdSeed += 1; - this.wsConn.send(buf); - }); - } - async reject() { return new Promise((resolve, reject) => { const buf = IncomingCallData.encode({ diff --git a/packages/sdk-react-hooks/package.json b/packages/sdk-react-hooks/package.json index 114aa51..f5fd7e6 100644 --- a/packages/sdk-react-hooks/package.json +++ b/packages/sdk-react-hooks/package.json @@ -1,6 +1,6 @@ { "name": "@atm0s-media-sdk/react-hooks", - "version": "1.0.0-alpha.8", + "version": "1.0.0-alpha.9", "main": "./dist/lib.js", "module": "./dist/lib.mjs", "types": "./dist/lib.d.ts", @@ -9,7 +9,7 @@ "src/*" ], "dependencies": { - "@atm0s-media-sdk/core": "1.0.0-alpha.7" + "@atm0s-media-sdk/core": "1.0.0-alpha.8" }, "peerDependencies": { "react": "^18.2.0" diff --git a/packages/sdk-react-ui/package.json b/packages/sdk-react-ui/package.json index 3faae90..8d7c949 100644 --- a/packages/sdk-react-ui/package.json +++ b/packages/sdk-react-ui/package.json @@ -1,6 +1,6 @@ { "name": "@atm0s-media-sdk/react-ui", - "version": "1.0.0-alpha.8", + "version": "1.0.0-alpha.9", "main": "./dist/lib.js", "module": "./dist/lib.mjs", "types": "./dist/lib.d.ts", @@ -11,8 +11,8 @@ "dependencies": { "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", - "@atm0s-media-sdk/core": "1.0.0-alpha.7", - "@atm0s-media-sdk/react-hooks": "1.0.0-alpha.7" + "@atm0s-media-sdk/core": "1.0.0-alpha.8", + "@atm0s-media-sdk/react-hooks": "1.0.0-alpha.9" }, "peerDependencies": { "react": "^18.2.0" diff --git a/packages/sdk-react-ui/src/panels/sip_incoming.tsx b/packages/sdk-react-ui/src/panels/sip_incoming.tsx index 5713544..97f9a5b 100644 --- a/packages/sdk-react-ui/src/panels/sip_incoming.tsx +++ b/packages/sdk-react-ui/src/panels/sip_incoming.tsx @@ -7,8 +7,12 @@ export interface SipIncomingCallProps { callFrom: string, callWs: string; room: string, + sipPeer: string, record: boolean, - onEnd: () => void; + onAccept?: () => void; + onCancel?: () => void; + onReject?: () => void; + onEnd?: () => void; } type AcceptState = "Connecting" | "Accepting" | "Accepted"; @@ -30,21 +34,51 @@ export function SipIncomingCallWidget(props: SipIncomingCallProps): JSX.Element }; }, [session]); + useEffect(() => { + switch (status.sipState) { + case "Bye": { + if (props.onEnd) { + props.onEnd(); + } + break; + } + case "Cancelled": { + if (props.onCancel) { + props.onCancel(); + } + break; + } + } + }, [status]) + const accept = useCallback(() => { setAcceptState("Connecting") session.connect().then(() => { setAcceptState("Accepting") - return call.accept(props.room, props.callFrom, props.record).then(() => { + if (props.onAccept) { + props.onAccept(); + } + return call.accept(props.room, props.sipPeer, props.record).then(() => { setAcceptState("Accepted") }).catch(() => setAcceptError("SipFailed")) }).catch(() => setAcceptError("MediaFailed")) - }, [call]); + }, [session, call, props.onAccept]); const reject = useCallback(() => { call.reject() session.disconnect(); - props.onEnd() + if (props.onReject) { + props.onReject(); + } + }, [session, call, props.onReject]); + + const end = useCallback(() => { + call.end() + session.disconnect(); + if (props.onEnd) { + props.onEnd(); + } }, [session, call, props.onEnd]); return ( @@ -58,8 +92,8 @@ export function SipIncomingCallWidget(props: SipIncomingCallProps): JSX.Element {/* Time Counting */}
{status.startedAt && }
- {/* Destination Number Info */} -

Destination: {props.callFrom}

+ {/* From Number Info */} +

From: {props.callFrom}

@@ -82,7 +116,7 @@ export function SipIncomingCallWidget(props: SipIncomingCallProps): JSX.Element {/* Reject Button */} {showHangup && } diff --git a/packages/sdk-react-ui/src/panels/sip_outgoing.tsx b/packages/sdk-react-ui/src/panels/sip_outgoing.tsx index 5fe41b9..93f9e76 100644 --- a/packages/sdk-react-ui/src/panels/sip_outgoing.tsx +++ b/packages/sdk-react-ui/src/panels/sip_outgoing.tsx @@ -6,7 +6,9 @@ import { ClockTimer } from "../components/uis/clock_timer"; export interface SipOutgoingCallProps { callTo: string, callWs: string; - onEnd: () => void; + onAccept?: () => void; + onEnd?: () => void; + onFailed?: () => void; } export function SipOutgoingCallWidget(props: SipOutgoingCallProps): JSX.Element { @@ -20,9 +22,34 @@ export function SipOutgoingCallWidget(props: SipOutgoingCallProps): JSX.Element }; }, [session]); + useEffect(() => { + switch (status.sipState) { + case "Accepted": { + if (props.onAccept) { + props.onAccept(); + } + break; + } + case "Failure": { + if (props.onFailed) { + props.onFailed(); + } + break; + } + case "Bye": { + if (props.onEnd) { + props.onEnd(); + } + break; + } + } + }, [status]) + const hangUp = useCallback(() => { session.disconnect(); - props.onEnd() + if (props.onEnd) { + props.onEnd(); + } }, [session, props.onEnd]); return ( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8038ac2..ede3524 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -151,6 +151,9 @@ importers: packages/sdk-core: dependencies: + long: + specifier: ^5.2.3 + version: 5.2.3 protobufjs: specifier: ^7.3.0 version: 7.3.0 @@ -186,7 +189,7 @@ importers: packages/sdk-react-hooks: dependencies: '@atm0s-media-sdk/core': - specifier: 1.0.0-alpha.7 + specifier: 1.0.0-alpha.8 version: link:../sdk-core react: specifier: ^18.2.0 @@ -226,10 +229,10 @@ importers: packages/sdk-react-ui: dependencies: '@atm0s-media-sdk/core': - specifier: 1.0.0-alpha.7 + specifier: 1.0.0-alpha.8 version: link:../sdk-core '@atm0s-media-sdk/react-hooks': - specifier: 1.0.0-alpha.7 + specifier: 1.0.0-alpha.9 version: link:../sdk-react-hooks '@emotion/react': specifier: ^11.11.4