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