telnyx 5.74.0 → 5.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/models/call_deepfake_detection_error_webhook_event.rb +160 -0
  5. data/lib/telnyx/models/call_deepfake_detection_result_webhook_event.rb +176 -0
  6. data/lib/telnyx/models/call_dial_params.rb +48 -1
  7. data/lib/telnyx/models/calls/action_answer_params.rb +48 -1
  8. data/lib/telnyx/models/sim_card_list_params.rb +1 -1
  9. data/lib/telnyx/models/traffic_policy_profile_list_params.rb +2 -2
  10. data/lib/telnyx/models/unsafe_unwrap_webhook_event.rb +5 -1
  11. data/lib/telnyx/models/unwrap_webhook_event.rb +5 -1
  12. data/lib/telnyx/models/verify_profile.rb +9 -3
  13. data/lib/telnyx/models/verify_profile_create_params.rb +15 -5
  14. data/lib/telnyx/models/verify_profile_update_params.rb +15 -5
  15. data/lib/telnyx/models.rb +4 -0
  16. data/lib/telnyx/resources/calls/actions.rb +6 -1
  17. data/lib/telnyx/resources/calls.rb +6 -1
  18. data/lib/telnyx/resources/webhooks.rb +2 -2
  19. data/lib/telnyx/version.rb +1 -1
  20. data/lib/telnyx.rb +2 -0
  21. data/rbi/telnyx/models/call_deepfake_detection_error_webhook_event.rbi +380 -0
  22. data/rbi/telnyx/models/call_deepfake_detection_result_webhook_event.rbi +398 -0
  23. data/rbi/telnyx/models/call_dial_params.rbi +80 -0
  24. data/rbi/telnyx/models/calls/action_answer_params.rbi +87 -0
  25. data/rbi/telnyx/models/sim_card_list_params.rbi +1 -1
  26. data/rbi/telnyx/models/traffic_policy_profile_list_params.rbi +2 -2
  27. data/rbi/telnyx/models/unsafe_unwrap_webhook_event.rbi +2 -0
  28. data/rbi/telnyx/models/unwrap_webhook_event.rbi +2 -0
  29. data/rbi/telnyx/models/verify_profile.rbi +18 -6
  30. data/rbi/telnyx/models/verify_profile_create_params.rbi +30 -10
  31. data/rbi/telnyx/models/verify_profile_update_params.rbi +30 -10
  32. data/rbi/telnyx/models.rbi +6 -0
  33. data/rbi/telnyx/resources/calls/actions.rbi +10 -0
  34. data/rbi/telnyx/resources/calls.rbi +9 -0
  35. data/rbi/telnyx/resources/webhooks.rbi +4 -0
  36. data/sig/telnyx/models/call_deepfake_detection_error_webhook_event.rbs +166 -0
  37. data/sig/telnyx/models/call_deepfake_detection_result_webhook_event.rbs +171 -0
  38. data/sig/telnyx/models/call_dial_params.rbs +36 -0
  39. data/sig/telnyx/models/calls/action_answer_params.rbs +36 -0
  40. data/sig/telnyx/models/sim_card_list_params.rbs +1 -1
  41. data/sig/telnyx/models/traffic_policy_profile_list_params.rbs +2 -2
  42. data/sig/telnyx/models/unsafe_unwrap_webhook_event.rbs +2 -0
  43. data/sig/telnyx/models/unwrap_webhook_event.rbs +2 -0
  44. data/sig/telnyx/models.rbs +4 -0
  45. data/sig/telnyx/resources/calls/actions.rbs +1 -0
  46. data/sig/telnyx/resources/calls.rbs +1 -0
  47. data/sig/telnyx/resources/webhooks.rbs +4 -0
  48. metadata +8 -2
@@ -0,0 +1,398 @@
1
+ # typed: strong
2
+
3
+ module Telnyx
4
+ module Models
5
+ class CallDeepfakeDetectionResultWebhookEvent < Telnyx::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent,
10
+ Telnyx::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig do
15
+ returns(
16
+ T.nilable(Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data)
17
+ )
18
+ end
19
+ attr_reader :data
20
+
21
+ sig do
22
+ params(
23
+ data: Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::OrHash
24
+ ).void
25
+ end
26
+ attr_writer :data
27
+
28
+ sig do
29
+ params(
30
+ data: Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::OrHash
31
+ ).returns(T.attached_class)
32
+ end
33
+ def self.new(data: nil)
34
+ end
35
+
36
+ sig do
37
+ override.returns(
38
+ { data: Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data }
39
+ )
40
+ end
41
+ def to_hash
42
+ end
43
+
44
+ class Data < Telnyx::Internal::Type::BaseModel
45
+ OrHash =
46
+ T.type_alias do
47
+ T.any(
48
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data,
49
+ Telnyx::Internal::AnyHash
50
+ )
51
+ end
52
+
53
+ # Identifies the type of resource.
54
+ sig { returns(T.nilable(String)) }
55
+ attr_reader :id
56
+
57
+ sig { params(id: String).void }
58
+ attr_writer :id
59
+
60
+ # The type of event being delivered.
61
+ sig do
62
+ returns(
63
+ T.nilable(
64
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::EventType::TaggedSymbol
65
+ )
66
+ )
67
+ end
68
+ attr_reader :event_type
69
+
70
+ sig do
71
+ params(
72
+ event_type:
73
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::EventType::OrSymbol
74
+ ).void
75
+ end
76
+ attr_writer :event_type
77
+
78
+ # ISO 8601 datetime of when the event occurred.
79
+ sig { returns(T.nilable(Time)) }
80
+ attr_reader :occurred_at
81
+
82
+ sig { params(occurred_at: Time).void }
83
+ attr_writer :occurred_at
84
+
85
+ sig do
86
+ returns(
87
+ T.nilable(
88
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload
89
+ )
90
+ )
91
+ end
92
+ attr_reader :payload
93
+
94
+ sig do
95
+ params(
96
+ payload:
97
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload::OrHash
98
+ ).void
99
+ end
100
+ attr_writer :payload
101
+
102
+ # Identifies the type of the resource.
103
+ sig do
104
+ returns(
105
+ T.nilable(
106
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::RecordType::TaggedSymbol
107
+ )
108
+ )
109
+ end
110
+ attr_reader :record_type
111
+
112
+ sig do
113
+ params(
114
+ record_type:
115
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::RecordType::OrSymbol
116
+ ).void
117
+ end
118
+ attr_writer :record_type
119
+
120
+ sig do
121
+ params(
122
+ id: String,
123
+ event_type:
124
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::EventType::OrSymbol,
125
+ occurred_at: Time,
126
+ payload:
127
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload::OrHash,
128
+ record_type:
129
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::RecordType::OrSymbol
130
+ ).returns(T.attached_class)
131
+ end
132
+ def self.new(
133
+ # Identifies the type of resource.
134
+ id: nil,
135
+ # The type of event being delivered.
136
+ event_type: nil,
137
+ # ISO 8601 datetime of when the event occurred.
138
+ occurred_at: nil,
139
+ payload: nil,
140
+ # Identifies the type of the resource.
141
+ record_type: nil
142
+ )
143
+ end
144
+
145
+ sig do
146
+ override.returns(
147
+ {
148
+ id: String,
149
+ event_type:
150
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::EventType::TaggedSymbol,
151
+ occurred_at: Time,
152
+ payload:
153
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload,
154
+ record_type:
155
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::RecordType::TaggedSymbol
156
+ }
157
+ )
158
+ end
159
+ def to_hash
160
+ end
161
+
162
+ # The type of event being delivered.
163
+ module EventType
164
+ extend Telnyx::Internal::Type::Enum
165
+
166
+ TaggedSymbol =
167
+ T.type_alias do
168
+ T.all(
169
+ Symbol,
170
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::EventType
171
+ )
172
+ end
173
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
174
+
175
+ CALL_DEEPFAKE_DETECTION_RESULT =
176
+ T.let(
177
+ :"call.deepfake_detection.result",
178
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::EventType::TaggedSymbol
179
+ )
180
+
181
+ sig do
182
+ override.returns(
183
+ T::Array[
184
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::EventType::TaggedSymbol
185
+ ]
186
+ )
187
+ end
188
+ def self.values
189
+ end
190
+ end
191
+
192
+ class Payload < Telnyx::Internal::Type::BaseModel
193
+ OrHash =
194
+ T.type_alias do
195
+ T.any(
196
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload,
197
+ Telnyx::Internal::AnyHash
198
+ )
199
+ end
200
+
201
+ # Call ID used to issue commands via Call Control API.
202
+ sig { returns(T.nilable(String)) }
203
+ attr_reader :call_control_id
204
+
205
+ sig { params(call_control_id: String).void }
206
+ attr_writer :call_control_id
207
+
208
+ # ID that is unique to the call and can be used to correlate webhook events.
209
+ sig { returns(T.nilable(String)) }
210
+ attr_reader :call_leg_id
211
+
212
+ sig { params(call_leg_id: String).void }
213
+ attr_writer :call_leg_id
214
+
215
+ # ID that is unique to the call session and can be used to correlate webhook
216
+ # events. Call session is a group of related call legs that logically belong to
217
+ # the same phone call, e.g. an inbound and outbound leg of a transferred call.
218
+ sig { returns(T.nilable(String)) }
219
+ attr_reader :call_session_id
220
+
221
+ sig { params(call_session_id: String).void }
222
+ attr_writer :call_session_id
223
+
224
+ # State received from a command.
225
+ sig { returns(T.nilable(String)) }
226
+ attr_accessor :client_state
227
+
228
+ # Call Control App ID (formerly Telnyx connection ID) used in the call.
229
+ sig { returns(T.nilable(String)) }
230
+ attr_reader :connection_id
231
+
232
+ sig { params(connection_id: String).void }
233
+ attr_writer :connection_id
234
+
235
+ # Percentage (0-100) indicating how consistently the model classified the audio
236
+ # across frames. High consistency (>90%) means confident classification
237
+ # throughout; low consistency suggests mixed signals. Null for silence_timeout.
238
+ sig { returns(T.nilable(Float)) }
239
+ attr_accessor :consistency
240
+
241
+ # Detection outcome. 'real' = human voice, 'fake' = AI-generated voice,
242
+ # 'silence_timeout' = no analyzable speech detected before timeout.
243
+ sig do
244
+ returns(
245
+ T.nilable(
246
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload::Result::TaggedSymbol
247
+ )
248
+ )
249
+ end
250
+ attr_reader :result
251
+
252
+ sig do
253
+ params(
254
+ result:
255
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload::Result::OrSymbol
256
+ ).void
257
+ end
258
+ attr_writer :result
259
+
260
+ # Probability that the audio is AI-generated, from 0.0 (likely real) to 1.0
261
+ # (likely deepfake). Based on the model's aggregated confidence across analyzed
262
+ # audio frames. Null for silence_timeout.
263
+ sig { returns(T.nilable(Float)) }
264
+ attr_accessor :score
265
+
266
+ sig do
267
+ params(
268
+ call_control_id: String,
269
+ call_leg_id: String,
270
+ call_session_id: String,
271
+ client_state: T.nilable(String),
272
+ connection_id: String,
273
+ consistency: T.nilable(Float),
274
+ result:
275
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload::Result::OrSymbol,
276
+ score: T.nilable(Float)
277
+ ).returns(T.attached_class)
278
+ end
279
+ def self.new(
280
+ # Call ID used to issue commands via Call Control API.
281
+ call_control_id: nil,
282
+ # ID that is unique to the call and can be used to correlate webhook events.
283
+ call_leg_id: nil,
284
+ # ID that is unique to the call session and can be used to correlate webhook
285
+ # events. Call session is a group of related call legs that logically belong to
286
+ # the same phone call, e.g. an inbound and outbound leg of a transferred call.
287
+ call_session_id: nil,
288
+ # State received from a command.
289
+ client_state: nil,
290
+ # Call Control App ID (formerly Telnyx connection ID) used in the call.
291
+ connection_id: nil,
292
+ # Percentage (0-100) indicating how consistently the model classified the audio
293
+ # across frames. High consistency (>90%) means confident classification
294
+ # throughout; low consistency suggests mixed signals. Null for silence_timeout.
295
+ consistency: nil,
296
+ # Detection outcome. 'real' = human voice, 'fake' = AI-generated voice,
297
+ # 'silence_timeout' = no analyzable speech detected before timeout.
298
+ result: nil,
299
+ # Probability that the audio is AI-generated, from 0.0 (likely real) to 1.0
300
+ # (likely deepfake). Based on the model's aggregated confidence across analyzed
301
+ # audio frames. Null for silence_timeout.
302
+ score: nil
303
+ )
304
+ end
305
+
306
+ sig do
307
+ override.returns(
308
+ {
309
+ call_control_id: String,
310
+ call_leg_id: String,
311
+ call_session_id: String,
312
+ client_state: T.nilable(String),
313
+ connection_id: String,
314
+ consistency: T.nilable(Float),
315
+ result:
316
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload::Result::TaggedSymbol,
317
+ score: T.nilable(Float)
318
+ }
319
+ )
320
+ end
321
+ def to_hash
322
+ end
323
+
324
+ # Detection outcome. 'real' = human voice, 'fake' = AI-generated voice,
325
+ # 'silence_timeout' = no analyzable speech detected before timeout.
326
+ module Result
327
+ extend Telnyx::Internal::Type::Enum
328
+
329
+ TaggedSymbol =
330
+ T.type_alias do
331
+ T.all(
332
+ Symbol,
333
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload::Result
334
+ )
335
+ end
336
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
337
+
338
+ REAL =
339
+ T.let(
340
+ :real,
341
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload::Result::TaggedSymbol
342
+ )
343
+ FAKE =
344
+ T.let(
345
+ :fake,
346
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload::Result::TaggedSymbol
347
+ )
348
+ SILENCE_TIMEOUT =
349
+ T.let(
350
+ :silence_timeout,
351
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload::Result::TaggedSymbol
352
+ )
353
+
354
+ sig do
355
+ override.returns(
356
+ T::Array[
357
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::Payload::Result::TaggedSymbol
358
+ ]
359
+ )
360
+ end
361
+ def self.values
362
+ end
363
+ end
364
+ end
365
+
366
+ # Identifies the type of the resource.
367
+ module RecordType
368
+ extend Telnyx::Internal::Type::Enum
369
+
370
+ TaggedSymbol =
371
+ T.type_alias do
372
+ T.all(
373
+ Symbol,
374
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::RecordType
375
+ )
376
+ end
377
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
378
+
379
+ EVENT =
380
+ T.let(
381
+ :event,
382
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::RecordType::TaggedSymbol
383
+ )
384
+
385
+ sig do
386
+ override.returns(
387
+ T::Array[
388
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent::Data::RecordType::TaggedSymbol
389
+ ]
390
+ )
391
+ end
392
+ def self.values
393
+ end
394
+ end
395
+ end
396
+ end
397
+ end
398
+ end
@@ -154,6 +154,20 @@ module Telnyx
154
154
  end
155
155
  attr_writer :custom_headers
156
156
 
157
+ # Enables deepfake detection on the call. When enabled, audio from the remote
158
+ # party is streamed to a detection service that analyzes whether the voice is
159
+ # AI-generated. Results are delivered via the `call.deepfake_detection.result`
160
+ # webhook.
161
+ sig { returns(T.nilable(Telnyx::CallDialParams::DeepfakeDetection)) }
162
+ attr_reader :deepfake_detection
163
+
164
+ sig do
165
+ params(
166
+ deepfake_detection: Telnyx::CallDialParams::DeepfakeDetection::OrHash
167
+ ).void
168
+ end
169
+ attr_writer :deepfake_detection
170
+
157
171
  sig { returns(T.nilable(Telnyx::DialogflowConfig)) }
158
172
  attr_reader :dialogflow_config
159
173
 
@@ -627,6 +641,7 @@ module Telnyx
627
641
  command_id: String,
628
642
  conference_config: Telnyx::CallDialParams::ConferenceConfig::OrHash,
629
643
  custom_headers: T::Array[Telnyx::CustomSipHeader::OrHash],
644
+ deepfake_detection: Telnyx::CallDialParams::DeepfakeDetection::OrHash,
630
645
  dialogflow_config: Telnyx::DialogflowConfig::OrHash,
631
646
  enable_dialogflow: T::Boolean,
632
647
  from_display_name: String,
@@ -745,6 +760,11 @@ module Telnyx
745
760
  conference_config: nil,
746
761
  # Custom headers to be added to the SIP INVITE.
747
762
  custom_headers: nil,
763
+ # Enables deepfake detection on the call. When enabled, audio from the remote
764
+ # party is streamed to a detection service that analyzes whether the voice is
765
+ # AI-generated. Results are delivered via the `call.deepfake_detection.result`
766
+ # webhook.
767
+ deepfake_detection: nil,
748
768
  dialogflow_config: nil,
749
769
  # Enables Dialogflow for the current call. The default value is false.
750
770
  enable_dialogflow: nil,
@@ -904,6 +924,7 @@ module Telnyx
904
924
  command_id: String,
905
925
  conference_config: Telnyx::CallDialParams::ConferenceConfig,
906
926
  custom_headers: T::Array[Telnyx::CustomSipHeader],
927
+ deepfake_detection: Telnyx::CallDialParams::DeepfakeDetection,
907
928
  dialogflow_config: Telnyx::DialogflowConfig,
908
929
  enable_dialogflow: T::Boolean,
909
930
  from_display_name: String,
@@ -1551,6 +1572,65 @@ module Telnyx
1551
1572
  end
1552
1573
  end
1553
1574
 
1575
+ class DeepfakeDetection < Telnyx::Internal::Type::BaseModel
1576
+ OrHash =
1577
+ T.type_alias do
1578
+ T.any(
1579
+ Telnyx::CallDialParams::DeepfakeDetection,
1580
+ Telnyx::Internal::AnyHash
1581
+ )
1582
+ end
1583
+
1584
+ # Whether deepfake detection is enabled.
1585
+ sig { returns(T::Boolean) }
1586
+ attr_accessor :enabled
1587
+
1588
+ # Maximum time in seconds to wait for RTP audio before timing out. If no audio is
1589
+ # received within this window, detection stops with an error.
1590
+ sig { returns(T.nilable(Integer)) }
1591
+ attr_reader :rtp_timeout
1592
+
1593
+ sig { params(rtp_timeout: Integer).void }
1594
+ attr_writer :rtp_timeout
1595
+
1596
+ # Maximum time in seconds to wait for a detection result before timing out.
1597
+ sig { returns(T.nilable(Integer)) }
1598
+ attr_reader :timeout
1599
+
1600
+ sig { params(timeout: Integer).void }
1601
+ attr_writer :timeout
1602
+
1603
+ # Enables deepfake detection on the call. When enabled, audio from the remote
1604
+ # party is streamed to a detection service that analyzes whether the voice is
1605
+ # AI-generated. Results are delivered via the `call.deepfake_detection.result`
1606
+ # webhook.
1607
+ sig do
1608
+ params(
1609
+ enabled: T::Boolean,
1610
+ rtp_timeout: Integer,
1611
+ timeout: Integer
1612
+ ).returns(T.attached_class)
1613
+ end
1614
+ def self.new(
1615
+ # Whether deepfake detection is enabled.
1616
+ enabled:,
1617
+ # Maximum time in seconds to wait for RTP audio before timing out. If no audio is
1618
+ # received within this window, detection stops with an error.
1619
+ rtp_timeout: nil,
1620
+ # Maximum time in seconds to wait for a detection result before timing out.
1621
+ timeout: nil
1622
+ )
1623
+ end
1624
+
1625
+ sig do
1626
+ override.returns(
1627
+ { enabled: T::Boolean, rtp_timeout: Integer, timeout: Integer }
1628
+ )
1629
+ end
1630
+ def to_hash
1631
+ end
1632
+ end
1633
+
1554
1634
  # Defines whether media should be encrypted on the call.
1555
1635
  module MediaEncryption
1556
1636
  extend Telnyx::Internal::Type::Enum
@@ -57,6 +57,25 @@ module Telnyx
57
57
  end
58
58
  attr_writer :custom_headers
59
59
 
60
+ # Enables deepfake detection on the call. When enabled, audio from the remote
61
+ # party is streamed to a detection service that analyzes whether the voice is
62
+ # AI-generated. Results are delivered via the `call.deepfake_detection.result`
63
+ # webhook.
64
+ sig do
65
+ returns(
66
+ T.nilable(Telnyx::Calls::ActionAnswerParams::DeepfakeDetection)
67
+ )
68
+ end
69
+ attr_reader :deepfake_detection
70
+
71
+ sig do
72
+ params(
73
+ deepfake_detection:
74
+ Telnyx::Calls::ActionAnswerParams::DeepfakeDetection::OrHash
75
+ ).void
76
+ end
77
+ attr_writer :deepfake_detection
78
+
60
79
  # The list of comma-separated codecs in a preferred order for the forked media to
61
80
  # be received.
62
81
  sig do
@@ -386,6 +405,8 @@ module Telnyx
386
405
  client_state: String,
387
406
  command_id: String,
388
407
  custom_headers: T::Array[Telnyx::CustomSipHeader::OrHash],
408
+ deepfake_detection:
409
+ Telnyx::Calls::ActionAnswerParams::DeepfakeDetection::OrHash,
389
410
  preferred_codecs:
390
411
  Telnyx::Calls::ActionAnswerParams::PreferredCodecs::OrSymbol,
391
412
  record: Telnyx::Calls::ActionAnswerParams::Record::OrSymbol,
@@ -447,6 +468,11 @@ module Telnyx
447
468
  command_id: nil,
448
469
  # Custom headers to be added to the SIP INVITE response.
449
470
  custom_headers: nil,
471
+ # Enables deepfake detection on the call. When enabled, audio from the remote
472
+ # party is streamed to a detection service that analyzes whether the voice is
473
+ # AI-generated. Results are delivered via the `call.deepfake_detection.result`
474
+ # webhook.
475
+ deepfake_detection: nil,
450
476
  # The list of comma-separated codecs in a preferred order for the forked media to
451
477
  # be received.
452
478
  preferred_codecs: nil,
@@ -529,6 +555,8 @@ module Telnyx
529
555
  client_state: String,
530
556
  command_id: String,
531
557
  custom_headers: T::Array[Telnyx::CustomSipHeader],
558
+ deepfake_detection:
559
+ Telnyx::Calls::ActionAnswerParams::DeepfakeDetection,
532
560
  preferred_codecs:
533
561
  Telnyx::Calls::ActionAnswerParams::PreferredCodecs::OrSymbol,
534
562
  record: Telnyx::Calls::ActionAnswerParams::Record::OrSymbol,
@@ -576,6 +604,65 @@ module Telnyx
576
604
  def to_hash
577
605
  end
578
606
 
607
+ class DeepfakeDetection < Telnyx::Internal::Type::BaseModel
608
+ OrHash =
609
+ T.type_alias do
610
+ T.any(
611
+ Telnyx::Calls::ActionAnswerParams::DeepfakeDetection,
612
+ Telnyx::Internal::AnyHash
613
+ )
614
+ end
615
+
616
+ # Whether deepfake detection is enabled.
617
+ sig { returns(T::Boolean) }
618
+ attr_accessor :enabled
619
+
620
+ # Maximum time in seconds to wait for RTP audio before timing out. If no audio is
621
+ # received within this window, detection stops with an error.
622
+ sig { returns(T.nilable(Integer)) }
623
+ attr_reader :rtp_timeout
624
+
625
+ sig { params(rtp_timeout: Integer).void }
626
+ attr_writer :rtp_timeout
627
+
628
+ # Maximum time in seconds to wait for a detection result before timing out.
629
+ sig { returns(T.nilable(Integer)) }
630
+ attr_reader :timeout
631
+
632
+ sig { params(timeout: Integer).void }
633
+ attr_writer :timeout
634
+
635
+ # Enables deepfake detection on the call. When enabled, audio from the remote
636
+ # party is streamed to a detection service that analyzes whether the voice is
637
+ # AI-generated. Results are delivered via the `call.deepfake_detection.result`
638
+ # webhook.
639
+ sig do
640
+ params(
641
+ enabled: T::Boolean,
642
+ rtp_timeout: Integer,
643
+ timeout: Integer
644
+ ).returns(T.attached_class)
645
+ end
646
+ def self.new(
647
+ # Whether deepfake detection is enabled.
648
+ enabled:,
649
+ # Maximum time in seconds to wait for RTP audio before timing out. If no audio is
650
+ # received within this window, detection stops with an error.
651
+ rtp_timeout: nil,
652
+ # Maximum time in seconds to wait for a detection result before timing out.
653
+ timeout: nil
654
+ )
655
+ end
656
+
657
+ sig do
658
+ override.returns(
659
+ { enabled: T::Boolean, rtp_timeout: Integer, timeout: Integer }
660
+ )
661
+ end
662
+ def to_hash
663
+ end
664
+ end
665
+
579
666
  # The list of comma-separated codecs in a preferred order for the forked media to
580
667
  # be received.
581
668
  module PreferredCodecs
@@ -254,7 +254,7 @@ module Telnyx
254
254
  :"current_billing_period_consumed_data.amount",
255
255
  Telnyx::SimCardListParams::Sort::TaggedSymbol
256
256
  )
257
- MINUS_CURRENT_BILLING_PERIOD_CONSUMED_DATA_AMOUNT =
257
+ DESC_CURRENT_BILLING_PERIOD_CONSUMED_DATA_AMOUNT =
258
258
  T.let(
259
259
  :"-current_billing_period_consumed_data.amount",
260
260
  Telnyx::SimCardListParams::Sort::TaggedSymbol
@@ -165,7 +165,7 @@ module Telnyx
165
165
  :service,
166
166
  Telnyx::TrafficPolicyProfileListParams::Sort::TaggedSymbol
167
167
  )
168
- MINUS_SERVICE =
168
+ DESC_SERVICE =
169
169
  T.let(
170
170
  :"-service",
171
171
  Telnyx::TrafficPolicyProfileListParams::Sort::TaggedSymbol
@@ -175,7 +175,7 @@ module Telnyx
175
175
  :type,
176
176
  Telnyx::TrafficPolicyProfileListParams::Sort::TaggedSymbol
177
177
  )
178
- MINUS_TYPE =
178
+ DESC_TYPE =
179
179
  T.let(
180
180
  :"-type",
181
181
  Telnyx::TrafficPolicyProfileListParams::Sort::TaggedSymbol
@@ -16,6 +16,8 @@ module Telnyx
16
16
  Telnyx::CallConversationEndedWebhookEvent,
17
17
  Telnyx::CallConversationInsightsGeneratedWebhookEvent,
18
18
  Telnyx::CallCostWebhookEvent,
19
+ Telnyx::CallDeepfakeDetectionErrorWebhookEvent,
20
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent,
19
21
  Telnyx::CallDtmfReceivedWebhookEvent,
20
22
  Telnyx::CallEnqueuedWebhookEvent,
21
23
  Telnyx::CallForkStartedWebhookEvent,
@@ -16,6 +16,8 @@ module Telnyx
16
16
  Telnyx::CallConversationEndedWebhookEvent,
17
17
  Telnyx::CallConversationInsightsGeneratedWebhookEvent,
18
18
  Telnyx::CallCostWebhookEvent,
19
+ Telnyx::CallDeepfakeDetectionErrorWebhookEvent,
20
+ Telnyx::CallDeepfakeDetectionResultWebhookEvent,
19
21
  Telnyx::CallDtmfReceivedWebhookEvent,
20
22
  Telnyx::CallEnqueuedWebhookEvent,
21
23
  Telnyx::CallForkStartedWebhookEvent,