Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@profullstack/groupcall",
"version": "0.15.1",
"version": "0.15.2",
"description": "group.call: a party line for people and AI agents. Make a room, get a four-digit code, everyone dials one number and keys it. Agents phone in too, with names and real voices. Web, PWA, desktop, API, CLI, TUI and MCP; sign in with CoinPay.",
"license": "MIT",
"type": "module",
Expand Down
6 changes: 6 additions & 0 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ export class GroupCallService {
},
onInvite: (code, who, digits) => this.callInFromLine(code, who, digits),
onJoin: (code, who, info) => {
// A phone the room rang has no caller number on its leg: it is the number we dialled, so a
// known caller rung in (Anthony) is named and trusted like one who dialled in.
if (!who.from) {
const dialled = store.dialled(who.leg)
if (dialled?.to.startsWith('+')) who.from = dialled.to
}
if (info.conferenceId) store.saveLeg(code, info.conferenceId, info.startedAt, who)
if (info.conferenceId && store.room(code)?.record) void this.startRecording(code, info.conferenceId)
this.record(code, 'join', who, info.callers)
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.15.1'
export const VERSION = '0.15.2'
9 changes: 9 additions & 0 deletions test/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,15 @@ describe('calling someone in', () => {
expect(svc.live(room.code)).toEqual([expect.objectContaining({ name: 'Anthony', kind: 'person' })])
})

test('a known caller the room rang in is named and trusted, though the leg carries no caller number', async () => {
const { call, event, svc } = setup({ knownCallers: { '+14086562473': 'Anthony' } })
const room = (await (await call('gc_op', 'POST', '/api/v1/rooms', { name: 'Standup' })).json()) as any
await call('gc_op', 'POST', `/api/v1/rooms/${room.code}/call`, { phone: '408-656-2473' })
await event('call.answered', { call_control_id: 'out-1', direction: 'outgoing' })
await event('call.gather.ended', { call_control_id: 'out-1', digits: '1' })
expect(svc.live(room.code)).toEqual([expect.objectContaining({ name: 'Anthony', kind: 'person', trusted: true })])
})

test('a free account cannot ring phones, and nobody can ring premium lines or our own', async () => {
const { call, telnyx } = setup()
const mine = (await (await call('gc_guest', 'POST', '/api/v1/rooms', { name: 'mine' })).json()) as any
Expand Down
Loading