feat: telephony dispatcher registration — sidecar self-registers on boot

Adds TelephonyRegistrationService that:
1. On startup: queries platform for agent list, registers with the
   telephony dispatcher at TELEPHONY_DISPATCHER_URL
2. Every 30s: sends heartbeat to keep registration alive (90s TTL)
3. On shutdown: deregisters (best-effort, TTL cleans up anyway)
4. On heartbeat failure: auto re-registers

Env vars:
  TELEPHONY_DISPATCHER_URL — where to register (outbound to dispatcher)
  TELEPHONY_CALLBACK_URL — where events come back (inbound to sidecar)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 15:08:30 +05:30
parent 898ff65951
commit 9f5935e417
2 changed files with 116 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ import { RulesEngineModule } from './rules-engine/rules-engine.module';
import { ConfigThemeModule } from './config/config-theme.module';
import { WidgetModule } from './widget/widget.module';
import { TeamModule } from './team/team.module';
import { TelephonyRegistrationService } from './telephony-registration.service';
@Module({
imports: [
@@ -49,5 +50,6 @@ import { TeamModule } from './team/team.module';
WidgetModule,
TeamModule,
],
providers: [TelephonyRegistrationService],
})
export class AppModule {}