configure_calls.rb

 1form!
 2title "Configure Calls"
 3
 4field(
 5	var: "fwd[timeout]",
 6	type: "text-single",
 7	datatype: "xs:integer",
 8	label: "Seconds to ring before voicemail",
 9	description: "One ring is ~5 seconds. Negative means ring forever.",
10	value: @customer.fwd.timeout.to_i.to_s
11)
12
13field(
14	var: "voicemail_transcription",
15	type: "boolean",
16	label: "Voicemail transcription",
17	value: @customer.transcription_enabled.to_s
18)
19
20field(
21	var: "fwd[uri]",
22	type: "list-single",
23	datatype: "xs:anyURI",
24	open: true,
25	label: "Forward calls to",
26	description: "List item or any custom xmpp:, sip:, or tel: URI.",
27	options: [
28		{ label: "Jabber ID", value: "xmpp:#{@customer.jid}" },
29		{ label: "SIP Account", value: @customer.sip_account.uri }
30	],
31	value: @customer.fwd.uri
32)
33
34if (lidb = @customer.tndetails&.dig(:features, :lidb))
35	field(
36		var: "lidb_name",
37		type: "fixed",
38		label: "CNAM",
39		value: "#{lidb[:subscriber_information]} (#{lidb[:status]})"
40	)
41elsif @customer.tndetails&.dig(:on_net_vendor)
42	field(
43		var: "lidb_name",
44		type: "text-single",
45		label: "CNAM Name",
46		description: "or nothing/space to leave blank"
47	)
48end