telnyx 5.164.0 → 5.166.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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/client.rb +4 -5
  5. data/lib/telnyx/lib/webhook_verification.rb +54 -155
  6. data/lib/telnyx/lib.rb +3 -1
  7. data/lib/telnyx/models/ai/assistant_tool.rb +14 -1
  8. data/lib/telnyx/models/ai/transcription_settings.rb +20 -15
  9. data/lib/telnyx/models/ai/transcription_settings_config.rb +35 -10
  10. data/lib/telnyx/models/call_dial_params.rb +13 -1
  11. data/lib/telnyx/models/calls/action_transfer_params.rb +13 -1
  12. data/lib/telnyx/models/connection_rtcp_settings.rb +3 -3
  13. data/lib/telnyx/models/credential_connections/action_check_registration_status_response.rb +12 -12
  14. data/lib/telnyx/models/external_requirements/sub_number_order_retrieve_params.rb +28 -0
  15. data/lib/telnyx/models/external_requirements/sub_number_order_retrieve_response.rb +104 -0
  16. data/lib/telnyx/models/external_requirements/sub_number_order_update_params.rb +69 -0
  17. data/lib/telnyx/models/external_requirements/sub_number_order_update_response.rb +66 -0
  18. data/lib/telnyx/models/outbound_voice_profile.rb +14 -14
  19. data/lib/telnyx/models/outbound_voice_profile_create_params.rb +14 -14
  20. data/lib/telnyx/models/outbound_voice_profile_update_params.rb +14 -14
  21. data/lib/telnyx/models/uac_connections/action_check_registration_status_response.rb +12 -12
  22. data/lib/telnyx/models.rb +2 -2
  23. data/lib/telnyx/resources/calls/actions.rb +3 -1
  24. data/lib/telnyx/resources/calls.rb +3 -1
  25. data/lib/telnyx/resources/credential_connections/actions.rb +3 -3
  26. data/lib/telnyx/resources/external_requirements/sub_number_orders.rb +99 -0
  27. data/lib/telnyx/resources/external_requirements.rb +19 -0
  28. data/lib/telnyx/resources/outbound_voice_profiles.rb +2 -2
  29. data/lib/telnyx/resources/uac_connections/actions.rb +3 -3
  30. data/lib/telnyx/resources/webhooks.rb +1 -1
  31. data/lib/telnyx/version.rb +1 -1
  32. data/lib/telnyx.rb +6 -4
  33. data/rbi/telnyx/client.rbi +3 -4
  34. data/rbi/telnyx/models/ai/assistant_tool.rbi +21 -0
  35. data/rbi/telnyx/models/ai/transcription_settings.rbi +40 -28
  36. data/rbi/telnyx/models/ai/transcription_settings_config.rbi +52 -12
  37. data/rbi/telnyx/models/call_dial_params.rbi +19 -0
  38. data/rbi/telnyx/models/calls/action_transfer_params.rbi +19 -0
  39. data/rbi/telnyx/models/connection_rtcp_settings.rbi +4 -4
  40. data/rbi/telnyx/models/credential_connections/action_check_registration_status_response.rbi +18 -36
  41. data/rbi/telnyx/models/external_requirements/sub_number_order_retrieve_params.rbi +52 -0
  42. data/rbi/telnyx/models/external_requirements/sub_number_order_retrieve_response.rbi +248 -0
  43. data/rbi/telnyx/models/external_requirements/sub_number_order_update_params.rbi +119 -0
  44. data/rbi/telnyx/models/external_requirements/sub_number_order_update_response.rbi +159 -0
  45. data/rbi/telnyx/models/outbound_voice_profile.rbi +18 -18
  46. data/rbi/telnyx/models/outbound_voice_profile_create_params.rbi +18 -18
  47. data/rbi/telnyx/models/outbound_voice_profile_update_params.rbi +18 -18
  48. data/rbi/telnyx/models/uac_connections/action_check_registration_status_response.rbi +18 -36
  49. data/rbi/telnyx/models.rbi +2 -3
  50. data/rbi/telnyx/resources/calls/actions.rbi +7 -0
  51. data/rbi/telnyx/resources/calls.rbi +7 -0
  52. data/rbi/telnyx/resources/credential_connections/actions.rbi +3 -3
  53. data/rbi/telnyx/resources/external_requirements/sub_number_orders.rbi +71 -0
  54. data/rbi/telnyx/resources/external_requirements.rbi +16 -0
  55. data/rbi/telnyx/resources/outbound_voice_profiles.rbi +4 -4
  56. data/rbi/telnyx/resources/uac_connections/actions.rbi +3 -3
  57. data/sig/telnyx/client.rbs +2 -2
  58. data/sig/telnyx/models/ai/assistant_tool.rbs +7 -0
  59. data/sig/telnyx/models/ai/transcription_settings.rbs +2 -0
  60. data/sig/telnyx/models/ai/transcription_settings_config.rbs +14 -0
  61. data/sig/telnyx/models/call_dial_params.rbs +7 -0
  62. data/sig/telnyx/models/calls/action_transfer_params.rbs +7 -0
  63. data/sig/telnyx/models/credential_connections/action_check_registration_status_response.rbs +24 -36
  64. data/sig/telnyx/models/external_requirements/sub_number_order_retrieve_params.rbs +30 -0
  65. data/sig/telnyx/models/external_requirements/sub_number_order_retrieve_response.rbs +110 -0
  66. data/sig/telnyx/models/external_requirements/sub_number_order_update_params.rbs +50 -0
  67. data/sig/telnyx/models/external_requirements/sub_number_order_update_response.rbs +75 -0
  68. data/sig/telnyx/models/uac_connections/action_check_registration_status_response.rbs +24 -36
  69. data/sig/telnyx/models.rbs +2 -2
  70. data/sig/telnyx/resources/calls/actions.rbs +1 -0
  71. data/sig/telnyx/resources/calls.rbs +1 -0
  72. data/sig/telnyx/resources/external_requirements/sub_number_orders.rbs +22 -0
  73. data/sig/telnyx/resources/external_requirements.rbs +9 -0
  74. metadata +20 -26
  75. data/lib/telnyx/lib/webhooks_ed25519.rb +0 -63
  76. data/lib/telnyx/models/sip_registration_status_retrieve_params.rb +0 -59
  77. data/lib/telnyx/models/sip_registration_status_retrieve_response.rb +0 -214
  78. data/lib/telnyx/resources/sip_registration_status.rb +0 -59
  79. data/rbi/telnyx/models/sip_registration_status_retrieve_params.rbi +0 -124
  80. data/rbi/telnyx/models/sip_registration_status_retrieve_response.rbi +0 -416
  81. data/rbi/telnyx/resources/sip_registration_status.rbi +0 -52
  82. data/sig/telnyx/models/sip_registration_status_retrieve_params.rbs +0 -55
  83. data/sig/telnyx/models/sip_registration_status_retrieve_response.rbs +0 -195
  84. data/sig/telnyx/resources/sip_registration_status.rbs +0 -14
@@ -23,36 +23,28 @@ module Telnyx
23
23
 
24
24
  type data =
25
25
  {
26
- ip_address: String,
27
- last_registration: String,
28
- port: Integer,
26
+ ip_address: String?,
27
+ last_registration: String?,
28
+ port: Integer?,
29
29
  record_type: String,
30
- sip_username: String,
30
+ sip_username: String?,
31
31
  status: Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::status,
32
- transport: String,
33
- user_agent: String
32
+ transport: String?,
33
+ user_agent: String?
34
34
  }
35
35
 
36
36
  class Data < Telnyx::Internal::Type::BaseModel
37
- attr_reader ip_address: String?
37
+ attr_accessor ip_address: String?
38
38
 
39
- def ip_address=: (String) -> String
39
+ attr_accessor last_registration: String?
40
40
 
41
- attr_reader last_registration: String?
42
-
43
- def last_registration=: (String) -> String
44
-
45
- attr_reader port: Integer?
46
-
47
- def port=: (Integer) -> Integer
41
+ attr_accessor port: Integer?
48
42
 
49
43
  attr_reader record_type: String?
50
44
 
51
45
  def record_type=: (String) -> String
52
46
 
53
- attr_reader sip_username: String?
54
-
55
- def sip_username=: (String) -> String
47
+ attr_accessor sip_username: String?
56
48
 
57
49
  attr_reader status: Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::status?
58
50
 
@@ -60,34 +52,30 @@ module Telnyx
60
52
  Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::status
61
53
  ) -> Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::status
62
54
 
63
- attr_reader transport: String?
64
-
65
- def transport=: (String) -> String
66
-
67
- attr_reader user_agent: String?
55
+ attr_accessor transport: String?
68
56
 
69
- def user_agent=: (String) -> String
57
+ attr_accessor user_agent: String?
70
58
 
71
59
  def initialize: (
72
- ?ip_address: String,
73
- ?last_registration: String,
74
- ?port: Integer,
60
+ ?ip_address: String?,
61
+ ?last_registration: String?,
62
+ ?port: Integer?,
75
63
  ?record_type: String,
76
- ?sip_username: String,
64
+ ?sip_username: String?,
77
65
  ?status: Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::status,
78
- ?transport: String,
79
- ?user_agent: String
66
+ ?transport: String?,
67
+ ?user_agent: String?
80
68
  ) -> void
81
69
 
82
70
  def to_hash: -> {
83
- ip_address: String,
84
- last_registration: String,
85
- port: Integer,
71
+ ip_address: String?,
72
+ last_registration: String?,
73
+ port: Integer?,
86
74
  record_type: String,
87
- sip_username: String,
75
+ sip_username: String?,
88
76
  status: Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::status,
89
- transport: String,
90
- user_agent: String
77
+ transport: String?,
78
+ user_agent: String?
91
79
  }
92
80
 
93
81
  type status =
@@ -765,6 +765,8 @@ module Telnyx
765
765
 
766
766
  class ExternalConnectionUpdateParams = Telnyx::Models::ExternalConnectionUpdateParams
767
767
 
768
+ module ExternalRequirements = Telnyx::Models::ExternalRequirements
769
+
768
770
  class ExternalVoiceIntegrationsPaginationMeta = Telnyx::Models::ExternalVoiceIntegrationsPaginationMeta
769
771
 
770
772
  class Fax = Telnyx::Models::Fax
@@ -1775,8 +1777,6 @@ module Telnyx
1775
1777
 
1776
1778
  class SiprecConnectorUpdateParams = Telnyx::Models::SiprecConnectorUpdateParams
1777
1779
 
1778
- class SipRegistrationStatusRetrieveParams = Telnyx::Models::SipRegistrationStatusRetrieveParams
1779
-
1780
1780
  class SoundModifications = Telnyx::Models::SoundModifications
1781
1781
 
1782
1782
  class SpeechToTextListProvidersParams = Telnyx::Models::SpeechToTextListProvidersParams
@@ -506,6 +506,7 @@ module Telnyx
506
506
  ?client_state: String,
507
507
  ?command_id: String,
508
508
  ?custom_headers: ::Array[Telnyx::CustomSipHeader],
509
+ ?diversion: String,
509
510
  ?early_media: bool,
510
511
  ?from: String,
511
512
  ?from_display_name: String,
@@ -21,6 +21,7 @@ module Telnyx
21
21
  ?custom_headers: ::Array[Telnyx::CustomSipHeader],
22
22
  ?deepfake_detection: Telnyx::CallDialParams::DeepfakeDetection,
23
23
  ?dialogflow_config: Telnyx::DialogflowConfig,
24
+ ?diversion: String,
24
25
  ?enable_dialogflow: bool,
25
26
  ?from_display_name: String,
26
27
  ?link_to: String,
@@ -0,0 +1,22 @@
1
+ module Telnyx
2
+ module Resources
3
+ class ExternalRequirements
4
+ class SubNumberOrders
5
+ def retrieve: (
6
+ String sub_number_order_id,
7
+ regulatory_requirement_id: String,
8
+ ?request_options: Telnyx::request_opts
9
+ ) -> Telnyx::Models::ExternalRequirements::SubNumberOrderRetrieveResponse
10
+
11
+ def update: (
12
+ String sub_number_order_id,
13
+ regulatory_requirement_id: String,
14
+ requirement: Telnyx::ExternalRequirements::SubNumberOrderUpdateParams::Requirement,
15
+ ?request_options: Telnyx::request_opts
16
+ ) -> Telnyx::Models::ExternalRequirements::SubNumberOrderUpdateResponse
17
+
18
+ def initialize: (client: Telnyx::Client) -> void
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,9 @@
1
+ module Telnyx
2
+ module Resources
3
+ class ExternalRequirements
4
+ attr_reader sub_number_orders: Telnyx::Resources::ExternalRequirements::SubNumberOrders
5
+
6
+ def initialize: (client: Telnyx::Client) -> void
7
+ end
8
+ end
9
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telnyx
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.164.0
4
+ version: 5.166.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Telnyx
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-31 00:00:00.000000000 Z
11
+ date: 2026-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: standardwebhooks
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  description:
70
56
  email: support@telnyx.com
71
57
  executables: []
@@ -112,7 +98,6 @@ files:
112
98
  - lib/telnyx/lib.rb
113
99
  - lib/telnyx/lib/webhook_verification.rb
114
100
  - lib/telnyx/lib/webhook_verification_error.rb
115
- - lib/telnyx/lib/webhooks_ed25519.rb
116
101
  - lib/telnyx/lib/websocket.rb
117
102
  - lib/telnyx/lib/websocket/base.rb
118
103
  - lib/telnyx/lib/websocket/speech_to_text_stream_params.rb
@@ -1255,6 +1240,10 @@ files:
1255
1240
  - lib/telnyx/models/external_connections/upload_retrieve_response.rb
1256
1241
  - lib/telnyx/models/external_connections/upload_retry_params.rb
1257
1242
  - lib/telnyx/models/external_connections/upload_retry_response.rb
1243
+ - lib/telnyx/models/external_requirements/sub_number_order_retrieve_params.rb
1244
+ - lib/telnyx/models/external_requirements/sub_number_order_retrieve_response.rb
1245
+ - lib/telnyx/models/external_requirements/sub_number_order_update_params.rb
1246
+ - lib/telnyx/models/external_requirements/sub_number_order_update_response.rb
1258
1247
  - lib/telnyx/models/external_voice_integrations_pagination_meta.rb
1259
1248
  - lib/telnyx/models/fax.rb
1260
1249
  - lib/telnyx/models/fax_application.rb
@@ -2486,8 +2475,6 @@ files:
2486
2475
  - lib/telnyx/models/sim_cards/wireless_sim_card_action.rb
2487
2476
  - lib/telnyx/models/simple_sim_card.rb
2488
2477
  - lib/telnyx/models/sip_header.rb
2489
- - lib/telnyx/models/sip_registration_status_retrieve_params.rb
2490
- - lib/telnyx/models/sip_registration_status_retrieve_response.rb
2491
2478
  - lib/telnyx/models/siprec_connector_create_params.rb
2492
2479
  - lib/telnyx/models/siprec_connector_delete_params.rb
2493
2480
  - lib/telnyx/models/siprec_connector_response.rb
@@ -3087,6 +3074,8 @@ files:
3087
3074
  - lib/telnyx/resources/external_connections/phone_numbers.rb
3088
3075
  - lib/telnyx/resources/external_connections/releases.rb
3089
3076
  - lib/telnyx/resources/external_connections/uploads.rb
3077
+ - lib/telnyx/resources/external_requirements.rb
3078
+ - lib/telnyx/resources/external_requirements/sub_number_orders.rb
3090
3079
  - lib/telnyx/resources/fax_applications.rb
3091
3080
  - lib/telnyx/resources/faxes.rb
3092
3081
  - lib/telnyx/resources/faxes/actions.rb
@@ -3264,7 +3253,6 @@ files:
3264
3253
  - lib/telnyx/resources/sim_card_orders.rb
3265
3254
  - lib/telnyx/resources/sim_cards.rb
3266
3255
  - lib/telnyx/resources/sim_cards/actions.rb
3267
- - lib/telnyx/resources/sip_registration_status.rb
3268
3256
  - lib/telnyx/resources/siprec_connectors.rb
3269
3257
  - lib/telnyx/resources/speech_to_text.rb
3270
3258
  - lib/telnyx/resources/storage.rb
@@ -4520,6 +4508,10 @@ files:
4520
4508
  - rbi/telnyx/models/external_connections/upload_retrieve_response.rbi
4521
4509
  - rbi/telnyx/models/external_connections/upload_retry_params.rbi
4522
4510
  - rbi/telnyx/models/external_connections/upload_retry_response.rbi
4511
+ - rbi/telnyx/models/external_requirements/sub_number_order_retrieve_params.rbi
4512
+ - rbi/telnyx/models/external_requirements/sub_number_order_retrieve_response.rbi
4513
+ - rbi/telnyx/models/external_requirements/sub_number_order_update_params.rbi
4514
+ - rbi/telnyx/models/external_requirements/sub_number_order_update_response.rbi
4523
4515
  - rbi/telnyx/models/external_voice_integrations_pagination_meta.rbi
4524
4516
  - rbi/telnyx/models/fax.rbi
4525
4517
  - rbi/telnyx/models/fax_application.rbi
@@ -5751,8 +5743,6 @@ files:
5751
5743
  - rbi/telnyx/models/sim_cards/wireless_sim_card_action.rbi
5752
5744
  - rbi/telnyx/models/simple_sim_card.rbi
5753
5745
  - rbi/telnyx/models/sip_header.rbi
5754
- - rbi/telnyx/models/sip_registration_status_retrieve_params.rbi
5755
- - rbi/telnyx/models/sip_registration_status_retrieve_response.rbi
5756
5746
  - rbi/telnyx/models/siprec_connector_create_params.rbi
5757
5747
  - rbi/telnyx/models/siprec_connector_delete_params.rbi
5758
5748
  - rbi/telnyx/models/siprec_connector_response.rbi
@@ -6352,6 +6342,8 @@ files:
6352
6342
  - rbi/telnyx/resources/external_connections/phone_numbers.rbi
6353
6343
  - rbi/telnyx/resources/external_connections/releases.rbi
6354
6344
  - rbi/telnyx/resources/external_connections/uploads.rbi
6345
+ - rbi/telnyx/resources/external_requirements.rbi
6346
+ - rbi/telnyx/resources/external_requirements/sub_number_orders.rbi
6355
6347
  - rbi/telnyx/resources/fax_applications.rbi
6356
6348
  - rbi/telnyx/resources/faxes.rbi
6357
6349
  - rbi/telnyx/resources/faxes/actions.rbi
@@ -6529,7 +6521,6 @@ files:
6529
6521
  - rbi/telnyx/resources/sim_card_orders.rbi
6530
6522
  - rbi/telnyx/resources/sim_cards.rbi
6531
6523
  - rbi/telnyx/resources/sim_cards/actions.rbi
6532
- - rbi/telnyx/resources/sip_registration_status.rbi
6533
6524
  - rbi/telnyx/resources/siprec_connectors.rbi
6534
6525
  - rbi/telnyx/resources/speech_to_text.rbi
6535
6526
  - rbi/telnyx/resources/storage.rbi
@@ -7776,6 +7767,10 @@ files:
7776
7767
  - sig/telnyx/models/external_connections/upload_retrieve_response.rbs
7777
7768
  - sig/telnyx/models/external_connections/upload_retry_params.rbs
7778
7769
  - sig/telnyx/models/external_connections/upload_retry_response.rbs
7770
+ - sig/telnyx/models/external_requirements/sub_number_order_retrieve_params.rbs
7771
+ - sig/telnyx/models/external_requirements/sub_number_order_retrieve_response.rbs
7772
+ - sig/telnyx/models/external_requirements/sub_number_order_update_params.rbs
7773
+ - sig/telnyx/models/external_requirements/sub_number_order_update_response.rbs
7779
7774
  - sig/telnyx/models/external_voice_integrations_pagination_meta.rbs
7780
7775
  - sig/telnyx/models/fax.rbs
7781
7776
  - sig/telnyx/models/fax_application.rbs
@@ -9007,8 +9002,6 @@ files:
9007
9002
  - sig/telnyx/models/sim_cards/wireless_sim_card_action.rbs
9008
9003
  - sig/telnyx/models/simple_sim_card.rbs
9009
9004
  - sig/telnyx/models/sip_header.rbs
9010
- - sig/telnyx/models/sip_registration_status_retrieve_params.rbs
9011
- - sig/telnyx/models/sip_registration_status_retrieve_response.rbs
9012
9005
  - sig/telnyx/models/siprec_connector_create_params.rbs
9013
9006
  - sig/telnyx/models/siprec_connector_delete_params.rbs
9014
9007
  - sig/telnyx/models/siprec_connector_response.rbs
@@ -9608,6 +9601,8 @@ files:
9608
9601
  - sig/telnyx/resources/external_connections/phone_numbers.rbs
9609
9602
  - sig/telnyx/resources/external_connections/releases.rbs
9610
9603
  - sig/telnyx/resources/external_connections/uploads.rbs
9604
+ - sig/telnyx/resources/external_requirements.rbs
9605
+ - sig/telnyx/resources/external_requirements/sub_number_orders.rbs
9611
9606
  - sig/telnyx/resources/fax_applications.rbs
9612
9607
  - sig/telnyx/resources/faxes.rbs
9613
9608
  - sig/telnyx/resources/faxes/actions.rbs
@@ -9785,7 +9780,6 @@ files:
9785
9780
  - sig/telnyx/resources/sim_card_orders.rbs
9786
9781
  - sig/telnyx/resources/sim_cards.rbs
9787
9782
  - sig/telnyx/resources/sim_cards/actions.rbs
9788
- - sig/telnyx/resources/sip_registration_status.rbs
9789
9783
  - sig/telnyx/resources/siprec_connectors.rbs
9790
9784
  - sig/telnyx/resources/speech_to_text.rbs
9791
9785
  - sig/telnyx/resources/storage.rbs
@@ -1,63 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "webhook_verification"
4
- require_relative "webhook_verification_error"
5
-
6
- # Only apply the ED25519 override if the generated Webhooks class exists.
7
- # This file is loaded after lib/telnyx/resources/webhooks.rb in the gem
8
- # load order (see lib/telnyx.rb), so the class should always be defined.
9
- if defined?(Telnyx::Resources::Webhooks)
10
- module Telnyx
11
- module Resources
12
- # Extends the generated Webhooks class with ED25519 signature verification.
13
- #
14
- # This reopens the Webhooks class to include the WebhookVerification module,
15
- # which adds ED25519 signature verification matching Python, Node, Go, and Java SDKs.
16
- #
17
- # Usage:
18
- #
19
- # require "telnyx"
20
- # # ED25519 verification is now loaded by default — no extra require needed
21
- #
22
- # client = Telnyx::Client.new(
23
- # api_key: ENV["TELNYX_API_KEY"],
24
- # public_key: ENV["TELNYX_PUBLIC_KEY"] # Base64 from Mission Control
25
- # )
26
- #
27
- # # Verify signature only (raises WebhookVerificationError on failure)
28
- # client.webhooks.verify!(payload, headers)
29
- #
30
- # # Verify and parse (ED25519 verification, then parse)
31
- # event = client.webhooks.unwrap(payload, headers: headers)
32
- #
33
- class Webhooks
34
- include Telnyx::Lib::WebhookVerification
35
-
36
- # Override unwrap to use ED25519 verification instead of StandardWebhooks.
37
- #
38
- # @param payload [String] The raw webhook payload as a string
39
- # @param headers [Hash{String=>String}] The raw HTTP headers
40
- # @param key [String, nil] Optional public key override (base64-encoded ED25519)
41
- #
42
- # @return [Telnyx::Models::UnwrapWebhookEvent]
43
- # @raise [Telnyx::Errors::WebhookVerificationError] If verification fails
44
- def unwrap(payload, headers:, key: nil)
45
- # Use ED25519 verification
46
- do_verify_signature(payload, headers, key || @client.public_key)
47
-
48
- # Parse the payload
49
- parsed = JSON.parse(payload, symbolize_names: true)
50
- Telnyx::Internal::Type::Converter.coerce(Telnyx::Models::UnwrapWebhookEvent, parsed)
51
- end
52
- end
53
- end
54
- end
55
- else
56
- # If the generated Webhooks class isn't loaded yet, the ED25519 override
57
- # can't be applied. This shouldn't happen in normal gem usage since
58
- # lib/telnyx.rb loads resources before lib/. If you see this warning,
59
- # ensure lib/telnyx.rb requires lib/telnyx/lib after the resources.
60
- warn "[telnyx] ED25519 webhook verification not loaded: " \
61
- "Telnyx::Resources::Webhooks is not defined. " \
62
- "Check that lib/telnyx.rb loads resources before lib/telnyx/lib."
63
- end
@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Telnyx
4
- module Models
5
- # @see Telnyx::Resources::SipRegistrationStatus#retrieve
6
- class SipRegistrationStatusRetrieveParams < Telnyx::Internal::Type::BaseModel
7
- extend Telnyx::Internal::Type::RequestParameters::Converter
8
- include Telnyx::Internal::Type::RequestParameters
9
-
10
- # @!attribute credential_type
11
- # The kind of credential to look up. `uac_external_credential` is keyed by
12
- # `connection_id`; `telephony_credential` and `sip_credential_connection` are
13
- # keyed by `username`.
14
- #
15
- # @return [Symbol, Telnyx::Models::SipRegistrationStatusRetrieveParams::CredentialType]
16
- required :credential_type, enum: -> { Telnyx::SipRegistrationStatusRetrieveParams::CredentialType }
17
-
18
- # @!attribute connection_id
19
- # Identifier of the UAC connection to look up. Required when `credential_type` is
20
- # `uac_external_credential`.
21
- #
22
- # @return [String, nil]
23
- optional :connection_id, String
24
-
25
- # @!attribute username
26
- # SIP username to look up. Required when `credential_type` is
27
- # `telephony_credential` or `sip_credential_connection`.
28
- #
29
- # @return [String, nil]
30
- optional :username, String
31
-
32
- # @!method initialize(credential_type:, connection_id: nil, username: nil, request_options: {})
33
- # Some parameter documentations has been truncated, see
34
- # {Telnyx::Models::SipRegistrationStatusRetrieveParams} for more details.
35
- #
36
- # @param credential_type [Symbol, Telnyx::Models::SipRegistrationStatusRetrieveParams::CredentialType] The kind of credential to look up. `uac_external_credential` is keyed by `connec
37
- #
38
- # @param connection_id [String] Identifier of the UAC connection to look up. Required when `credential_type` is
39
- #
40
- # @param username [String] SIP username to look up. Required when `credential_type` is `telephony_credentia
41
- #
42
- # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
43
-
44
- # The kind of credential to look up. `uac_external_credential` is keyed by
45
- # `connection_id`; `telephony_credential` and `sip_credential_connection` are
46
- # keyed by `username`.
47
- module CredentialType
48
- extend Telnyx::Internal::Type::Enum
49
-
50
- UAC_EXTERNAL_CREDENTIAL = :uac_external_credential
51
- TELEPHONY_CREDENTIAL = :telephony_credential
52
- SIP_CREDENTIAL_CONNECTION = :sip_credential_connection
53
-
54
- # @!method self.values
55
- # @return [Array<Symbol>]
56
- end
57
- end
58
- end
59
- end
@@ -1,214 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Telnyx
4
- module Models
5
- # @see Telnyx::Resources::SipRegistrationStatus#retrieve
6
- class SipRegistrationStatusRetrieveResponse < Telnyx::Internal::Type::BaseModel
7
- # @!attribute connection_id
8
- # Identifier of the connection associated with the credential.
9
- #
10
- # @return [String, nil]
11
- optional :connection_id, String
12
-
13
- # @!attribute connection_name
14
- # Human-readable connection name.
15
- #
16
- # @return [String, nil]
17
- optional :connection_name, String
18
-
19
- # @!attribute credential_type
20
- # The credential type that was looked up.
21
- #
22
- # @return [Symbol, Telnyx::Models::SipRegistrationStatusRetrieveResponse::CredentialType, nil]
23
- optional :credential_type,
24
- enum: -> { Telnyx::Models::SipRegistrationStatusRetrieveResponse::CredentialType }
25
-
26
- # @!attribute credential_username
27
- # SIP username used for the registration.
28
- #
29
- # @return [String, nil]
30
- optional :credential_username, String
31
-
32
- # @!attribute last_registration_response
33
- # SIP response from the last registration attempt.
34
- #
35
- # @return [String, nil]
36
- optional :last_registration_response, String, nil?: true
37
-
38
- # @!attribute registered
39
- # True if the endpoint is currently registered.
40
- #
41
- # @return [Boolean, nil]
42
- optional :registered, Telnyx::Internal::Type::Boolean
43
-
44
- # @!attribute sip_registration_details
45
- # Detailed registration information reported by the registrar. The populated
46
- # fields depend on `credential_type`: UAC external credentials report
47
- # `auth_retries`, `uptime`, `next_action_at`, `failures`, and `sip_uri_user_host`;
48
- # telephony credentials and SIP credential connections report `ua_ip`, `ua_port`,
49
- # `transport`, and `last_modified`. All types report `expires`.
50
- #
51
- # @return [Telnyx::Models::SipRegistrationStatusRetrieveResponse::SipRegistrationDetails, nil]
52
- optional :sip_registration_details,
53
- -> { Telnyx::Models::SipRegistrationStatusRetrieveResponse::SipRegistrationDetails }
54
-
55
- # @!attribute sip_registration_status
56
- # Human-readable registration status derived from the registrar state.
57
- #
58
- # @return [Symbol, Telnyx::Models::SipRegistrationStatusRetrieveResponse::SipRegistrationStatus, nil]
59
- optional :sip_registration_status,
60
- enum: -> { Telnyx::Models::SipRegistrationStatusRetrieveResponse::SipRegistrationStatus }
61
-
62
- # @!method initialize(connection_id: nil, connection_name: nil, credential_type: nil, credential_username: nil, last_registration_response: nil, registered: nil, sip_registration_details: nil, sip_registration_status: nil)
63
- # Some parameter documentations has been truncated, see
64
- # {Telnyx::Models::SipRegistrationStatusRetrieveResponse} for more details.
65
- #
66
- # @param connection_id [String] Identifier of the connection associated with the credential.
67
- #
68
- # @param connection_name [String] Human-readable connection name.
69
- #
70
- # @param credential_type [Symbol, Telnyx::Models::SipRegistrationStatusRetrieveResponse::CredentialType] The credential type that was looked up.
71
- #
72
- # @param credential_username [String] SIP username used for the registration.
73
- #
74
- # @param last_registration_response [String, nil] SIP response from the last registration attempt.
75
- #
76
- # @param registered [Boolean] True if the endpoint is currently registered.
77
- #
78
- # @param sip_registration_details [Telnyx::Models::SipRegistrationStatusRetrieveResponse::SipRegistrationDetails] Detailed registration information reported by the registrar. The populated field
79
- #
80
- # @param sip_registration_status [Symbol, Telnyx::Models::SipRegistrationStatusRetrieveResponse::SipRegistrationStatus] Human-readable registration status derived from the registrar state.
81
-
82
- # The credential type that was looked up.
83
- #
84
- # @see Telnyx::Models::SipRegistrationStatusRetrieveResponse#credential_type
85
- module CredentialType
86
- extend Telnyx::Internal::Type::Enum
87
-
88
- UAC_EXTERNAL_CREDENTIAL = :uac_external_credential
89
- TELEPHONY_CREDENTIAL = :telephony_credential
90
- SIP_CREDENTIAL_CONNECTION = :sip_credential_connection
91
-
92
- # @!method self.values
93
- # @return [Array<Symbol>]
94
- end
95
-
96
- # @see Telnyx::Models::SipRegistrationStatusRetrieveResponse#sip_registration_details
97
- class SipRegistrationDetails < Telnyx::Internal::Type::BaseModel
98
- # @!attribute auth_retries
99
- # Number of authentication retries on the last attempt (uac_external_credential).
100
- #
101
- # @return [Integer, nil]
102
- optional :auth_retries, Integer
103
-
104
- # @!attribute expires
105
- # Unix timestamp when the current registration expires.
106
- #
107
- # @return [Integer, nil]
108
- optional :expires, Integer
109
-
110
- # @!attribute failures
111
- # Count of consecutive registration failures (uac_external_credential).
112
- #
113
- # @return [Integer, nil]
114
- optional :failures, Integer
115
-
116
- # @!attribute last_modified
117
- # Timestamp when the registration was last modified (telephony_credential and
118
- # sip_credential_connection).
119
- #
120
- # @return [String, nil]
121
- optional :last_modified, String
122
-
123
- # @!attribute next_action_at
124
- # Unix timestamp of the next scheduled registration action
125
- # (uac_external_credential).
126
- #
127
- # @return [Integer, nil]
128
- optional :next_action_at, Integer
129
-
130
- # @!attribute sip_uri_user_host
131
- # SIP URI user@host of the registered contact (uac_external_credential).
132
- #
133
- # @return [String, nil]
134
- optional :sip_uri_user_host, String
135
-
136
- # @!attribute transport
137
- # Transport used for the registration, e.g. UDP/TCP/TLS (telephony_credential and
138
- # sip_credential_connection).
139
- #
140
- # @return [String, nil]
141
- optional :transport, String
142
-
143
- # @!attribute ua_ip
144
- # IP address of the registered user agent (telephony_credential and
145
- # sip_credential_connection).
146
- #
147
- # @return [String, nil]
148
- optional :ua_ip, String
149
-
150
- # @!attribute ua_port
151
- # Port of the registered user agent (telephony_credential and
152
- # sip_credential_connection).
153
- #
154
- # @return [Integer, nil]
155
- optional :ua_port, Integer
156
-
157
- # @!attribute uptime
158
- # Registration uptime reported by the registrar (uac_external_credential).
159
- #
160
- # @return [Integer, nil]
161
- optional :uptime, Integer
162
-
163
- # @!method initialize(auth_retries: nil, expires: nil, failures: nil, last_modified: nil, next_action_at: nil, sip_uri_user_host: nil, transport: nil, ua_ip: nil, ua_port: nil, uptime: nil)
164
- # Some parameter documentations has been truncated, see
165
- # {Telnyx::Models::SipRegistrationStatusRetrieveResponse::SipRegistrationDetails}
166
- # for more details.
167
- #
168
- # Detailed registration information reported by the registrar. The populated
169
- # fields depend on `credential_type`: UAC external credentials report
170
- # `auth_retries`, `uptime`, `next_action_at`, `failures`, and `sip_uri_user_host`;
171
- # telephony credentials and SIP credential connections report `ua_ip`, `ua_port`,
172
- # `transport`, and `last_modified`. All types report `expires`.
173
- #
174
- # @param auth_retries [Integer] Number of authentication retries on the last attempt (uac_external_credential).
175
- #
176
- # @param expires [Integer] Unix timestamp when the current registration expires.
177
- #
178
- # @param failures [Integer] Count of consecutive registration failures (uac_external_credential).
179
- #
180
- # @param last_modified [String] Timestamp when the registration was last modified (telephony*credential and sip*
181
- #
182
- # @param next_action_at [Integer] Unix timestamp of the next scheduled registration action (uac_external_credentia
183
- #
184
- # @param sip_uri_user_host [String] SIP URI user@host of the registered contact (uac_external_credential).
185
- #
186
- # @param transport [String] Transport used for the registration, e.g. UDP/TCP/TLS (telephony_credential and
187
- #
188
- # @param ua_ip [String] IP address of the registered user agent (telephony_credential and sip_credential
189
- #
190
- # @param ua_port [Integer] Port of the registered user agent (telephony_credential and sip_credential_conne
191
- #
192
- # @param uptime [Integer] Registration uptime reported by the registrar (uac_external_credential).
193
- end
194
-
195
- # Human-readable registration status derived from the registrar state.
196
- #
197
- # @see Telnyx::Models::SipRegistrationStatusRetrieveResponse#sip_registration_status
198
- module SipRegistrationStatus
199
- extend Telnyx::Internal::Type::Enum
200
-
201
- UNREGISTERING = :unregistering
202
- CONNECTION_DISABLED = :connection_disabled
203
- STANDBY = :standby
204
- FAILED = :failed
205
- TRYING = :trying
206
- REGISTERED = :registered
207
- UNKNOWN = :unknown
208
-
209
- # @!method self.values
210
- # @return [Array<Symbol>]
211
- end
212
- end
213
- end
214
- end