diff --git a/packages/calls/src/DidCommCallsService.ts b/packages/calls/src/DidCommCallsService.ts index 9bea81d..75f75a0 100644 --- a/packages/calls/src/DidCommCallsService.ts +++ b/packages/calls/src/DidCommCallsService.ts @@ -7,9 +7,15 @@ import { CallRejectMessage } from './messages/CallRejectMessage' @scoped(Lifecycle.ContainerScoped) export class DidCommCallsService { - public createOffer(options: { callType: DidCommCallType; parameters: Record }) { - const { callType, parameters } = options - return new CallOfferMessage({ callType, parameters }) + public createOffer(options: { + callType: DidCommCallType + offerExpirationTime?: Date + offerStartTime?: Date + description: string + parameters: Record + }) { + const { callType, offerExpirationTime, offerStartTime, description, parameters } = options + return new CallOfferMessage({ callType, offerExpirationTime, offerStartTime, description, parameters }) } public createAccept(options: { threadId?: string; parameters: Record }) { diff --git a/packages/calls/src/DidcommCallsApi.ts b/packages/calls/src/DidcommCallsApi.ts index aa8a6f1..9696f5e 100644 --- a/packages/calls/src/DidcommCallsApi.ts +++ b/packages/calls/src/DidcommCallsApi.ts @@ -25,13 +25,22 @@ export class DidCommCallsApi { public async offer(options: { connectionId: string callType: DidCommCallType + offerExpirationTime?: Date + offerStartTime?: Date + description: string parameters: Record }) { - const { connectionId, callType, parameters } = options + const { connectionId, callType, offerExpirationTime, offerStartTime, description, parameters } = options const connection = await this.connectionService.getById(this.agentContext, connectionId) connection.assertReady() - const message = this.didcommCallsService.createOffer({ callType, parameters }) + const message = this.didcommCallsService.createOffer({ + callType, + offerExpirationTime, + offerStartTime, + description, + parameters, + }) const outbound = new OutboundMessageContext(message, { agentContext: this.agentContext, diff --git a/packages/calls/tests/DidCommCallsService.test.ts b/packages/calls/tests/DidCommCallsService.test.ts index d326766..12fded5 100644 --- a/packages/calls/tests/DidCommCallsService.test.ts +++ b/packages/calls/tests/DidCommCallsService.test.ts @@ -26,6 +26,7 @@ describe('Didcomm Calls', () => { test('Should create a valid https://didcomm.org/calls/1.0/call-offer message ', async () => { const message = didcommCallsService.createOffer({ callType: 'video', + description: 'new Call Offer', parameters: { param: 'value' }, })