Skip to content

Instantly share code, notes, and snippets.

@ben221199
Last active June 5, 2025 11:04
Show Gist options
  • Save ben221199/7cf689dd68ce90f1bc60786465d20695 to your computer and use it in GitHub Desktop.
Save ben221199/7cf689dd68ce90f1bc60786465d20695 to your computer and use it in GitHub Desktop.
IPTV

TV-Anytime

Location Resolution

See: ETSI TS 102 822-4 (Clause 12)

Assuming crid://example.com;name_extension/some-name (where ;name_extension is optional)

Discovery

Protocol: TCP/IP based

See: ETSI TS 102 822-4 (Clause 12.3.5)

DNS: Get SRV record of _lres._tcp.name_extension.example.com, containing hostname and port

Request

Protocol: TCP/IP based

See: ETSI TS 102 822-4 (Clause 12.3.6)

HTTP: Do a GET request to http://hostname:port/?CRID={crid1}&CRID={crid2?}&CRID={crid3?}&SubmittedCRID={submittedCRID?=0 or 1}&Result={result?=0 or 1}

Response

Protocol: TCP/IP based

See: ETSI TS 102 822-4 (Clause 12.3.7)

Possibilities:

  • XML with result of resolved CRIDs
  • Redirect, may be HTTPS negotiation
  • XML with Resolving Authority Record (RAR)
<?xml version="1.0" encoding="UTF-8"?>
<!--See: ETSI TS 102 822-4 (Annex A.1.1)-->
<ContentReferencingTable version="1.0" xmlns="urn:tva:ContentReferencing:{YYYY}">
	<Result CRID="crid://example.com;name_extension/some-name" complete="false" acquire="all" status="resolved" reresolveDate="1970-01-01T00:00:00"></Result>
	<Result CRID="crid://example.net;name_extension/some-name-2" complete="false" acquire="all" status="resolved" reresolveDate="1970-01-01T00:00:00">
		<CRIDResult>
			<Crid>crid://example.com;name_extension/some-other-name-1</Crid>
			<Crid>crid://example.net;name_extension/some-other-name-2</Crid>
			<Crid>crid://example.org;name_extension/some-other-name-3</Crid>
		</CRIDResult>
		<CRIDResult>
			<Crid>crid://example.com;name_extension/some-other-name-4</Crid>
			<Crid>crid://example.net;name_extension/some-other-name-5</Crid>
			<Crid>crid://example.org;name_extension/some-other-name-6</Crid>
		</CRIDResult>
	</Result>
	<Result CRID="crid://example.org;name_extension/some-name-3" complete="false" acquire="all" status="resolved" reresolveDate="1970-01-01T00:00:00">
		<LocationsResult>
			<Locator instanceMetadataId="imi:1">dvb://1.4ee2.3f4;4f5@2001-03-
27T18:00:00.00+01:00</Locator>
			<DecomposedLocator start="2001-03-29T18:00:00.00" duration="P20M" end="2001-04- 03T18:00:00.00">ftp://myserver.example.com/directory12-
backup/hello.mp3</DecomposedLocator>
			<StructuredLocator></StructuredLocator><!--This one was added in a 1.1.1+ spec-->
		</LocationsResult>
		<LocationsResult>
			<Locator instanceMetadataId="imi:1">dvb://1.4ee2.3f4;4f5@2001-03-
27T18:00:00.00+01:00</Locator>
			<DecomposedLocator start="2001-03-29T18:00:00.00" duration="P20M" end="2001-04- 03T18:00:00.00">ftp://myserver.example.com/directory12-
backup/hello.mp3</DecomposedLocator>
			<StructuredLocator></StructuredLocator><!--This one was added in a 1.1.1+ spec-->
		</LocationsResult>
	</Result>
</ContentReferencingTable>
<?xml version="1.0" encoding="UTF-8"?>
<ResolvingAuthorityRecordTable>
	<!--See: ETSI TS 102 822-4 (Annex A.1.2)-->
</ResolvingAuthorityRecordTable>

Get Metadata

Assuming crid://example.com;name_extension/some-name (where ;name_extension is optional); this flow will try to discover a SOAP Metadata service based on the example.com;name_extension part.

Discovery

See: ETSI TS 102 822-6-2 (Clause 5)

Options:

  • DNS: Get SRV record of _gmet._tcp.name_extension.example.com, containing hostname and port
  • UDDI: Using uddi:TV-Anytime.org:get_Data_v10
  • WS-Inspection: Do a GET request to http://example.com/{name_extension}/inspection.wsil

In the end, based on just example.com;name_extension, those 3 options will give an URL that can receive SOAP messages.

There are also 2 other options:

  • Non-standardized (e.g. manual or pre-programmed)
  • Extracting URL from unidirectional stream (e.g. DVB)

Request

Headers:

  • SOAPAction = "get_Data"
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
	<Body>
<get_Data maxPrograms="123">
	<QueryConstraints>
		<PredicateBag contextNode negate="false" type="AND|OR">
			<!--Inside here can be a PredicateBag, BinaryPredicate AND/OR UnaryPredicate again.-->
		</PredicateBag>
		<!--OR-->
		<BinaryPredicate fieldID="some-field-name" fieldValue="some-field-value" test="equals|not_equals|contains|greater_than|greater_than_or_equals|less_than|less_than_or_equals"/>
		<!--OR-->
		<UnaryPredicate fieldID="some-field-name" test="exists"/>
	</QueryConstraints>
	<RequestedTables>
		<Table type="ContentReferencingTable|ClassificationSchemeTable|ProgramInformationTable|GroupInformationTable|CreditsInformationTable|ProgramLocationTable|ServiceInformationTable|ProgramReviewTable|SegmentInformationTable">
			<SortCriteria fieldID="some-field-name" order="ascending|descending"/>
			<SortCriteria fieldID="some-field-name" order="ascending|descending"/>
			<SortCriteria fieldID="some-field-name" order="ascending|descending"/>
		</Table>
	</RequestedTables>
</get_Data>
	</Body>
</Envelope>

Response

<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
	<Body>
<get_Data_Result serviceVersion="1234" truncated="false">
	<TableSortingInformation>
		<Table type="ContentReferencingTable|ClassificationSchemeTable|ProgramInformationTable|GroupInformationTable|CreditsInformationTable|ProgramLocationTable|ServiceInformationTable|ProgramReviewTable|SegmentInformationTable">
			<SortCriteria fieldID="some-field-name" order="ascending|descending"/>
			<SortCriteria fieldID="some-field-name" order="ascending|descending"/>
			<SortCriteria fieldID="some-field-name" order="ascending|descending"/>
		</Table>
	</TableSortingInformation>
	<TVAMain>
		<!--See TVAMain schema-->
	</TVAMain>
	<ContentReferencingTable>
		<!--See ContentReferencing schema-->
	</ContentReferencingTable>
	<InvalidFragments>
		<!--Zero or more <Fragment/> tags with some TVA-specific attributes-->
	</InvalidFragments>
</get_Data_Result>
	</Body>
</Envelope>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment