
if {![exists -proc get_channel_attr]} {
	if {![exists -proc svc]} { require svc.class }

	proc get_channel_attr {channel {field hSvc}} {
		set c [svc channel $channel]
		if {$c == 0} { return "" }
		return [$c get $field]
	}

	proc get_channel_attr_bylcn {lcn {field hSvc}} {
		set c [svc load usLcn $lcn]
		if {$c == 0} { return "" }
		return [$c get $field]
	}

	proc get_channel_attr_byorglcn {lcn {field hSvc}} {
		set c [svc _load_clause "usOrgLcn = $lcn and usLcn < 800" $lcn]
		if {$c == 0} { return "" }
		return [$c get $field]
	}

	proc get_channel_attr_byhsvc {hsvc {field usLcn}} {
		set c [svc load hSvc $hsvc]
		if {$c == 0} { return "" }
		return [$c get $field]
	}

	proc get_channel_attr_bysvc {svc {field usLcn}} {
		set c [svc load usSvcId $svc]
		if {$c == 0} { return "" }
		return [$c get $field]
	}
}

