Includes: API (Express/TypeScript), Astro site, Python workers, document generators, FCC compliance tools, Canada CRTC formation, Ansible infrastructure, and deployment scripts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
263 lines
10 KiB
Python
263 lines
10 KiB
Python
"""
|
|
Generate the FCC CPNI Annual Certification Letter — Audio Bridging variant.
|
|
|
|
Audio bridging / conferencing providers have a narrower CPNI scope than
|
|
ordinary carriers: CPNI is generally limited to participant dial-in
|
|
records, scheduled conference metadata, and enterprise billing records.
|
|
Per the Commission's longstanding treatment of non-real-time conferencing
|
|
services, some categories of conference metadata may fall outside the
|
|
definition of CPNI where the service is not "telecommunications service"
|
|
as defined in 47 USC § 153(53).
|
|
|
|
This certification addresses the CPNI {entity_name} does hold and states
|
|
expressly where non-real-time or information-service exceptions apply.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import logging
|
|
from datetime import datetime
|
|
from pathlib import Path
|
|
from typing import Optional
|
|
|
|
LOG = logging.getLogger("document_gen.cpni_audio_bridge")
|
|
|
|
try:
|
|
from docx import Document
|
|
from docx.shared import Pt, Inches, RGBColor
|
|
from docx.enum.text import WD_ALIGN_PARAGRAPH
|
|
except ImportError:
|
|
LOG.warning("python-docx not installed — CPNI Audio Bridge generation unavailable")
|
|
Document = None # type: ignore[assignment,misc]
|
|
|
|
_NAVY = RGBColor(0x1A, 0x27, 0x44) if Document else None
|
|
|
|
VARIANT_ID = "audio_bridging"
|
|
VARIANT_LABEL = "Audio Bridging / Conferencing"
|
|
|
|
MAX_FORFEITURE_PER_VIOLATION = "$251,322"
|
|
MAX_FORFEITURE_CAP = "$2,513,215"
|
|
|
|
|
|
def _sp(p, after=6, before=0):
|
|
p.paragraph_format.space_after = Pt(after)
|
|
if before:
|
|
p.paragraph_format.space_before = Pt(before)
|
|
|
|
|
|
def _h(doc, text):
|
|
p = doc.add_paragraph(); r = p.add_run(text)
|
|
r.font.size = Pt(12); r.bold = True; r.font.color.rgb = _NAVY
|
|
_sp(p, after=4, before=8)
|
|
|
|
|
|
def _b(doc, text, bold=False, size=10):
|
|
p = doc.add_paragraph(); p.alignment = WD_ALIGN_PARAGRAPH.LEFT
|
|
r = p.add_run(text); r.font.size = Pt(size); r.bold = bold
|
|
_sp(p, after=6)
|
|
|
|
|
|
def _cb(doc, text, checked=True):
|
|
mark = "\u2611" if checked else "\u2610"
|
|
p = doc.add_paragraph()
|
|
r = p.add_run(f" {mark} {text}"); r.font.size = Pt(10)
|
|
_sp(p, after=3)
|
|
|
|
|
|
def generate_cpni_audio_bridge(
|
|
output_path: str,
|
|
entity_name: str,
|
|
frn: str = "",
|
|
filer_id_499: str = "",
|
|
officer_name: str = "",
|
|
officer_title: str = "Chief Executive Officer",
|
|
complaints_count: int = 0,
|
|
complaints_description: str = "",
|
|
has_data_broker_inquiries: bool = False,
|
|
data_broker_description: str = "",
|
|
reporting_year: int = 0,
|
|
address_street: str = "",
|
|
address_city: str = "",
|
|
address_state: str = "",
|
|
address_zip: str = "",
|
|
contact_email: str = "",
|
|
contact_phone: str = "",
|
|
breaches: list[dict] | None = None,
|
|
**_: dict,
|
|
) -> Optional[str]:
|
|
if Document is None:
|
|
LOG.error("python-docx not installed")
|
|
return None
|
|
if reporting_year == 0:
|
|
reporting_year = datetime.now().year - 1
|
|
breaches = breaches or []
|
|
|
|
doc = Document()
|
|
for s in doc.sections:
|
|
s.top_margin = Inches(1); s.bottom_margin = Inches(1)
|
|
s.left_margin = Inches(1.25); s.right_margin = Inches(1.25)
|
|
|
|
today = datetime.now().strftime("%B %d, %Y")
|
|
signer = officer_name or "Authorized Officer"
|
|
title = officer_title or "Officer"
|
|
|
|
tp = doc.add_paragraph(); tp.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
t = tp.add_run("CPNI Annual Certification Letter")
|
|
t.font.size = Pt(14); t.bold = True; t.font.color.rgb = _NAVY
|
|
_sp(tp, after=2)
|
|
sp = doc.add_paragraph(); sp.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
s = sp.add_run(
|
|
f"Audio Bridging / Conferencing \u2014 47 CFR \u00a7 64.2009 "
|
|
f"\u2014 Calendar Year {reporting_year}"
|
|
)
|
|
s.font.size = Pt(10); s.font.color.rgb = RGBColor(0x55, 0x55, 0x55)
|
|
_sp(sp, after=8)
|
|
|
|
_h(doc, "1. Provider Information")
|
|
lines = [f"Company Name: {entity_name}", f"Variant: {VARIANT_LABEL}"]
|
|
if frn: lines.append(f"FCC Registration Number (FRN): {frn}")
|
|
if filer_id_499: lines.append(f"FCC Form 499 Filer ID: {filer_id_499}")
|
|
addr = ", ".join(filter(None, [address_street, address_city]))
|
|
if address_state or address_zip:
|
|
addr += f", {address_state} {address_zip}".strip()
|
|
if addr.strip(", "):
|
|
lines.append(f"Address: {addr.strip(', ')}")
|
|
if contact_phone: lines.append(f"Telephone: {contact_phone}")
|
|
if contact_email: lines.append(f"Email: {contact_email}")
|
|
lines.append(f"Certifying Officer: {signer}, {title}")
|
|
lines.append(f"Date of Filing: {today}")
|
|
lines.append(f"Filing Deadline: March 2, {reporting_year + 1}")
|
|
_b(doc, "\n".join(lines))
|
|
|
|
_h(doc, "2. Officer Statement of Personal Knowledge")
|
|
_b(doc, (
|
|
f"I, {signer}, {title} of {entity_name}, state that I have personal "
|
|
f"knowledge of the matters certified herein, including procedures "
|
|
f"governing participant dial-in records, scheduled-conference "
|
|
f"metadata, and enterprise billing data."
|
|
))
|
|
|
|
_h(doc, "3. Scope Note and Certification of Compliance")
|
|
_b(doc, (
|
|
f"{entity_name} provides audio bridging / conferencing service. "
|
|
f"Its CPNI-like holdings are narrow: participant dial-in numbers, "
|
|
f"conference-bridge access records, and enterprise billing data. "
|
|
f"To the extent any portion of the service is properly classified "
|
|
f"as a non-real-time information service rather than a "
|
|
f"telecommunications service under 47 USC \u00a7 153(53), the "
|
|
f"Commission has recognized that such portion is not subject to "
|
|
f"47 CFR Part 64 Subpart U. {entity_name} certifies compliance "
|
|
f"with 47 CFR \u00a7\u00a7 64.2001 through 64.2011 with respect to "
|
|
f"all remaining CPNI it holds for the period January 1, "
|
|
f"{reporting_year} through December 31, {reporting_year}."
|
|
))
|
|
|
|
_h(doc, "4. How Our Procedures Ensure Compliance")
|
|
_cb(doc, (
|
|
"Access to participant dial-in records and conference metadata is "
|
|
"restricted to authenticated personnel performing billing, "
|
|
"support, or abuse investigations. Authentication occurs through "
|
|
"named-user credentials; access is logged (47 CFR \u00a7 64.2009)."
|
|
))
|
|
_cb(doc, (
|
|
"Customer authentication is required before CPNI release in "
|
|
"response to a customer-initiated inquiry. Consumer-side "
|
|
"authentication is by pre-established password; enterprise-side "
|
|
"authentication is via credentials assigned in the master service "
|
|
"agreement (47 CFR \u00a7 64.2010)."
|
|
))
|
|
_cb(doc, (
|
|
"Customer approval for use of CPNI beyond the scope of the "
|
|
"subscribed service is obtained through written opt-in consent, "
|
|
"documented per 47 CFR \u00a7 64.2007."
|
|
))
|
|
_cb(doc, (
|
|
"Supervisory review of CPNI access is conducted at least "
|
|
"quarterly; retention of logs meets or exceeds two years, and "
|
|
"certification records are retained for five years, per 47 CFR "
|
|
"\u00a7 64.2009."
|
|
))
|
|
_cb(doc, (
|
|
"Annual training is provided to all personnel with CPNI access; "
|
|
"breach-notification procedures comply with 47 CFR \u00a7 64.2011 "
|
|
"as amended by FCC 23-111."
|
|
))
|
|
|
|
_h(doc, "5. Customer Complaints")
|
|
if complaints_count == 0:
|
|
_b(doc, (
|
|
f"{entity_name} has NOT received any customer complaints during "
|
|
f"the reporting period concerning the unauthorized release or "
|
|
f"use of CPNI. Zero (0) complaints were logged."
|
|
))
|
|
else:
|
|
desc = complaints_description or "Each complaint was investigated and resolved."
|
|
_b(doc, (
|
|
f"{entity_name} HAS received {complaints_count} customer "
|
|
f"complaint{'s' if complaints_count != 1 else ''} during the "
|
|
f"reporting period. {desc}"
|
|
))
|
|
|
|
_h(doc, "6. Data Broker Inquiries and Pretexting")
|
|
if not has_data_broker_inquiries:
|
|
_b(doc, (
|
|
f"{entity_name} has NOT received any inquiries, communications, "
|
|
f"or attempts by data brokers or other unauthorized parties "
|
|
f"seeking the unauthorized release of CPNI."
|
|
))
|
|
else:
|
|
desc = data_broker_description or "Each was refused, documented, and escalated."
|
|
_b(doc, (
|
|
f"{entity_name} HAS received data broker or pretexting-style "
|
|
f"inquiries during the reporting period. {desc}"
|
|
))
|
|
|
|
_h(doc, "7. Breach Log Summary")
|
|
if not breaches:
|
|
_b(doc, (
|
|
f"{entity_name} experienced no CPNI breaches during the "
|
|
f"reporting period. No 47 CFR \u00a7 64.2011 notifications "
|
|
f"were required."
|
|
))
|
|
else:
|
|
_b(doc, (
|
|
f"{entity_name} experienced {len(breaches)} CPNI breach"
|
|
f"{'es' if len(breaches) != 1 else ''} during the reporting "
|
|
f"period; each was reported within 7 business days."
|
|
))
|
|
|
|
_h(doc, "8. Penalties, Truthfulness, and Perjury Acknowledgment")
|
|
_b(doc, (
|
|
f"{entity_name} and the undersigned acknowledge that CPNI rule "
|
|
f"violations may subject the carrier to forfeitures up to "
|
|
f"{MAX_FORFEITURE_PER_VIOLATION} per violation and up to "
|
|
f"{MAX_FORFEITURE_CAP} for any single act or failure to act."
|
|
))
|
|
_b(doc, (
|
|
"Pursuant to 47 CFR \u00a7 1.17, the undersigned represents that no "
|
|
"material factual information has been withheld and all statements "
|
|
"are truthful, accurate, and complete."
|
|
))
|
|
_b(doc, (
|
|
"Willful false statements are punishable under Title 18, U.S.C. "
|
|
"\u00a7 1001, and by forfeiture under 47 U.S.C. \u00a7 503."
|
|
))
|
|
|
|
_h(doc, "9. Signature of Certifying Officer")
|
|
_b(doc, (
|
|
"I declare under penalty of perjury under the laws of the United "
|
|
"States of America that the foregoing is true and correct."
|
|
))
|
|
p = doc.add_paragraph(); _sp(p, after=0)
|
|
sig = doc.add_paragraph(); sig.add_run("_" * 45).font.size = Pt(10); _sp(sig, after=2)
|
|
nm = doc.add_paragraph(); nr = nm.add_run(signer); nr.bold = True
|
|
nr.font.size = Pt(10); _sp(nm, after=2)
|
|
tpp = doc.add_paragraph(); tpp.add_run(f"{title}, {entity_name}").font.size = Pt(10)
|
|
_sp(tpp, after=2)
|
|
dp = doc.add_paragraph(); dp.add_run(f"Date: {today}").font.size = Pt(10)
|
|
_sp(dp, after=2)
|
|
|
|
out = Path(output_path)
|
|
out.parent.mkdir(parents=True, exist_ok=True)
|
|
doc.save(str(out))
|
|
LOG.info("CPNI Audio Bridge certification letter generated: %s", out)
|
|
return str(out)
|