Open-source helpers for India telephony with LiveKit: region pinning, TRAI pre-call checks, Tamil turn detection

A few India-specific telephony problems keep coming up here and in the agents repo: outbound calls to Indian carriers timing out before any SIP response, Plivo media-anchoring hangups, and no turn detection for Tamil. I packaged what I’ve learned into a small MIT library that drops into an existing agent:

Trunks pinned to India

  • india_sip_uri() gives the <subdomain>.india.sip.livekit.cloud URI to hand your carrier
  • outbound_trunk() builds a SIPOutboundTrunkInfo with destination_country="in" and TCP set
  • Setup checklists for Exotel and Plivo, including the step behind most outbound timeouts: getting LiveKit’s India egress ranges allow-listed on the carrier’s SBC
  • check_outbound_trunk() flags existing trunks that will fail for Indian calls

Pre-call checks (TRAI)

  • check_call(): the 09:00–21:00 IST window for promotional calls, a DND/NCPR hook, Indian mobile validation, and a warning when the caller ID series (140 / 1600) doesn’t match the call’s purpose
  • opening_line(): AI disclosure plus recording notice in English, Hindi and Tamil

Turn-taking

  • turn_handling("ta"): the open TamilEOT smart-turn model, kept active when code-mixed Tamil gets reported as en-IN (otherwise it silently falls back to fixed timing)
  • MultilingualModel for Hindi and English
  • short_answers=True caps max_delay at 1.2 s for yes/no and slot-picking phases (background: livekit/agents#6415)
session = AgentSession(
    vad=silero.VAD.load(**vad_options("ta")),
    turn_handling=turn_handling("ta", short_answers=True),
    ...
)

Tested against livekit-agents 1.8.6; the 70 tests need no API keys. The generic guidance for other Indian carriers (Vobiz, Tata Smartflo, Airtel) is the least verified part, so corrections from anyone running those in production would be very welcome.

Thanks for sharing. I have now unsilenced your account and made this post public after it was (incorrectly) flagged :in_hole: by our content filters.

Great to see smart-turn-livekit · PyPI being used, LiveKit Plugin for Smart Turn EOT Detection Models.