FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
emcho
emchojust-some-testing
Remix of jubertioai/hello-realtime
Public
Like
just-some-testing
Home
Code
4
frontend
1
routes
5
README.md
H
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
1
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
main.tsx
https://emcho--01993544c121756eaa4022810f40ff9f.web.val.run
README.md

hello-realtime

Hello Realtime is a OpenAI Realtime app that supports both WebRTC and SIP (telephone) users. You can access the app via WebRTC at hello-realtime.val.run, or via SIP by calling 425-800-0042.

This demo shows off the new SIP API, the new all-in-one WebRTC API, and the new server-side websocket interface.

If you remix the app, you'll just need to pop in your own OPENAI_API_KEY (from platform.openai.com), and if you want SIP, the OPENAI_SIGNING_SECRET.

Architecture

  1. WebRTC Flow:
    • Browser connects to frontend
    • creates WebRTC offer
    • /rtc endpoint handles SDP negotiation with OpenAI
    • observer established to monitor session
  2. SIP Flow:
    • Phone calls triggers webhook
    • /sip endpoint verifies webhook and accepts call
    • observer established to monitor session

API Endpoints

  • GET / - serves the WebRTC-based app
  • POST /rtc - creates a new WebRTC-based Realtime API session
  • POST /sip - handles an incoming Realtime API SIP call
  • POST /observer - internal endpoint to establish a Realtime API websocket for session control

Project Structure

├── frontend/     
│   └── index.html          # HTML/JS application for WebRTC
├── main.tsx                # Main entrypoint for the val.town app
└── routes/
    |
    ├── agent.ts            # Realtime API session configuration and tools
    ├── observer.ts         # Server-side session control for SIP & WebRTC
    ├── rtc.ts              # WebRTC session setup
    ├── sip.ts              # SIP webhook handling and session setup
    └── utils.ts            # Various HTTP helpers

File Links

  • frontend/index.html
  • main.tsx
  • routes/agent.ts
  • routes/observer.ts
  • routes/rtc.ts
  • routes/sip.ts
  • routes/utils.ts
HTTP
  • main.tsx
    emcho--01…9f.web.val.run
Code
frontendroutesREADME.md
H
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.