-
Notifications
You must be signed in to change notification settings - Fork 14
Add SIP endpoints documentation #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9e3cd21
Add SIP endpoints documentation
diego-signalwire cad59e8
tweaks and fixes
diego-signalwire 47c07a5
Merge branch 'main' into diego/13745/sip-gateways-endpoints
Devon-White 8e86dd5
Merge branch 'main' into diego/13745/sip-gateways-endpoints
Devon-White 43214c4
Merge branch 'main' into diego/13745/sip-gateways-endpoints
diego-signalwire 63d03b2
put back sip_gateway folder to the main build list
diego-signalwire c59ed3d
update _spec.yaml with sip gateways endpoints
diego-signalwire 5c65e65
Merge branch 'main' into diego/13745/sip-gateways-endpoints
diego-signalwire 0a1725b
Merge branch 'main' into diego/13745/sip-gateways-endpoints
Devon-White File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import "@typespec/http"; | ||
import "./models/core.tsp"; | ||
import "./models/requests.tsp"; | ||
import "./models/responses.tsp"; | ||
import "./models/errors.tsp"; | ||
import "../../types"; | ||
|
||
using TypeSpec.Http; | ||
using Types.StatusCodes; | ||
|
||
@route("/resources/sip_gateways") | ||
namespace FabricAPI.SipGateways { | ||
@tag("SIP Gateway") | ||
@friendlyName("SIP Gateway") | ||
interface SipGateways { | ||
@summary("List SIP Gateways") | ||
@doc("Returns a paginated list of SIP Gateways for the authenticated project.") | ||
list(): | ||
SipGatewayListResponse | | ||
StatusCode401 | | ||
StatusCode404; | ||
|
||
@summary("Get SIP Gateway") | ||
@doc("Returns an SIP Gateway by ID") | ||
read(...SipGatewayID): { | ||
@statusCode statusCode: 200; | ||
@body sip_gateway: SipGatewayResponse; | ||
} | | ||
StatusCode401 | | ||
StatusCode404; | ||
|
||
@summary("Create SIP Gateway") | ||
@doc("Creates a Subscriber Guest Token to be used for server-side API calls. The token is authorized using an existing API token.") | ||
@post create(...SipGatewayCreateRequest): | ||
{ @statusCode statusCode: 201; @body sip_gateway: SipGatewayCreateResponse; } | | ||
StatusCode401 | | ||
StatusCode404 | | ||
SipGatewayCreateStatusCode422; | ||
|
||
@summary("Update SIP Gateway") | ||
@doc("Updates a SIP Gateway by ID") | ||
@patch update(...SipGatewayID, ...SipGatewayUpdateRequest): { | ||
@statusCode statusCode: 200; @body cxml_application: SipGatewayUpdateResponse; | ||
Devon-White marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | | ||
StatusCode401 | | ||
StatusCode404 | | ||
SipGatewayCreateStatusCode422; | ||
|
||
@summary("Delete SIP Gateway") | ||
@doc("Deletes a SIP Gateway} by ID") | ||
@delete delete(...SipGatewayID): | ||
{ @statusCode statusCode: 204; } | | ||
StatusCode401 | | ||
StatusCode404; | ||
|
||
@summary("List Fabric Addresses assigned to a SIP Gateway") | ||
@doc("Returns a paginated list of Fabric Addresses associated with the specified SIP Gateway.") | ||
@route("/{resource_id}/addresses") | ||
readAddressesByResourceId(@path resource_id: string): | ||
SipGatewayAddressListResponse | | ||
StatusCode401 | | ||
StatusCode404; | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
api/signalwire-rest/fabric-api/sip_gateways/models/core.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import "../../../types"; | ||
|
||
using TypeSpec.Http; | ||
|
||
model SipGatewayID { | ||
@doc("Unique ID of a SIP Gateway.") | ||
@path | ||
id: uuid | ||
} | ||
|
||
model SipGatewayAddressPaginationResponse { | ||
@doc("Link of the current page") | ||
@example("https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") | ||
self: url; | ||
|
||
@doc("Link to the first page") | ||
@example("https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") | ||
first: url; | ||
|
||
@doc("Link to the next page") | ||
@example("https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") | ||
next: url; | ||
} | ||
|
||
model SipGatewayAddress { | ||
@doc("Unique ID of the Fabric Address.") | ||
@example("691af061-cd86-4893-a605-173f47afc4c2") | ||
id: uuid; | ||
|
||
@doc("Fabric resource ID that the Fabric Address belongs to.") | ||
@example("691af061-cd86-4893-a605-173f47afc4c2") | ||
resource_id: uuid; | ||
|
||
@doc("Name of the Fabric Address.") | ||
@example("justice-league") | ||
name: string; | ||
|
||
@doc("Display name of the Fabric Address.") | ||
@example("Justice League") | ||
display_name: string; | ||
|
||
@doc("Type of the Fabric Address.") | ||
@example(DisplayTypes.App) | ||
type: DisplayTypes; | ||
|
||
@doc("Cover url of the Fabric Address.") | ||
@example("https://coverurl.com") | ||
cover_url: string; | ||
|
||
@doc("Preview url of the Fabric Address.") | ||
@example("https://previewurl.com") | ||
preview_url: string; | ||
|
||
@doc("Channels of the Fabric Address.") | ||
channel: AddressChannel; | ||
} |
15 changes: 15 additions & 0 deletions
15
api/signalwire-rest/fabric-api/sip_gateways/models/errors.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import "../../../types/status-codes"; | ||
|
||
using Types.StatusCodes; | ||
|
||
@example(#{ | ||
errors: #[#{ | ||
type: "validation_error", | ||
code: "missing_required_parameter", | ||
message: "Name can't be blank", | ||
attribute: "name", | ||
url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter" | ||
}], | ||
}) | ||
model SipGatewayCreateStatusCode422 is StatusCode422; | ||
|
23 changes: 23 additions & 0 deletions
23
api/signalwire-rest/fabric-api/sip_gateways/models/requests.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
model SipGatewayCreateRequest { | ||
@doc("Display name for the SIP Gateway.") | ||
@example("Different SIP Endpoint Name") | ||
name: string; | ||
|
||
@doc("SIP URI for the endpoint.") | ||
@example("[email protected]") | ||
uri: string; | ||
Devon-White marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
@doc("Specifies the encryption requirement for the SIP connection.") | ||
@example("required") | ||
encryption: "optional" | "required" | "disabled"; | ||
|
||
@doc("List of supported SIP ciphers.") | ||
@example(#[ "AEAD_AES_256_GCM_8", "AES_256_CM_HMAC_SHA1_80" ]) | ||
ciphers: string[]; | ||
|
||
@doc("List of supported codecs for media transmission.") | ||
@example(#["OPUS"]) | ||
codecs: string[]; | ||
} | ||
|
||
alias SipGatewayUpdateRequest = SipGatewayCreateRequest; |
89 changes: 89 additions & 0 deletions
89
api/signalwire-rest/fabric-api/sip_gateways/models/responses.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import "../../../types"; | ||
|
||
using TypeSpec.Http; | ||
using TypeSpec.OpenAPI; | ||
|
||
model SipGatewayCreateResponse { | ||
@doc("Unique ID of the resource.") | ||
@example("0823a606-0aff-4c90-9eba-f88ba118fe05") | ||
id: string; | ||
|
||
@doc("Project ID associated with the resource.") | ||
@example("bc949800-7b40-43cf-8438-a85facfcbdd1") | ||
project_id: string; | ||
|
||
@doc("Display name of the SIP Gateway.") | ||
@example("Different SIP Endpoint Name") | ||
display_name: string; | ||
|
||
@doc("Type of the resource.") | ||
@example("sip_gateway") | ||
type: "sip_gateway"; | ||
|
||
@doc("Timestamp when the resource was created.") | ||
@example(utcDateTime.fromISO("2025-04-01T19:05:42Z")) | ||
created_at: utcDateTime; | ||
|
||
@doc("Timestamp when the resource was last updated.") | ||
@example(utcDateTime.fromISO("2025-04-01T19:05:42Z")) | ||
updated_at: utcDateTime; | ||
|
||
@doc("SIP Gateway configuration details.") | ||
sip_gateway: SipGateway; | ||
} | ||
|
||
model SipGatewayUpdateResponse extends SipGatewayCreateResponse {} | ||
model SipGatewayResponse extends SipGatewayCreateResponse {} | ||
|
||
model SipGateway { | ||
@doc("Unique ID of the SIP Gateway.") | ||
@example("cce59cad-104d-4c28-ada4-98cfd102ae09") | ||
id: string; | ||
|
||
@doc("SIP URI for the endpoint.") | ||
Devon-White marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@example("[email protected]") | ||
uri: string; | ||
|
||
@doc("Display name of the SIP Gateway.") | ||
@example("Different SIP Endpoint Name") | ||
Devon-White marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name: string; | ||
|
||
@doc("List of supported SIP ciphers.") | ||
@example(#["AEAD_AES_256_GCM_8", "AES_256_CM_HMAC_SHA1_80"]) | ||
ciphers: string[]; | ||
|
||
@doc("List of supported codecs.") | ||
@example(#["OPUS"]) | ||
codecs: string[]; | ||
|
||
@doc("Specifies the encryption requirement.") | ||
@example("required") | ||
encryption: "optional" | "required" | "disabled"; | ||
} | ||
|
||
model SipGatewayListResponse { | ||
@doc("List of SIP Gateways.") | ||
data: SipGatewayCreateResponse[]; | ||
|
||
@doc("Pagination links for the response.") | ||
links: SipGatewayPaginationResponse; | ||
} | ||
|
||
model SipGatewayPaginationResponse { | ||
@doc("Link of the current page") | ||
@example("https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways?page_number=0&page_size=50") | ||
self: url; | ||
|
||
@doc("Link to the first page") | ||
@example("https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways?page_number=0&page_size=50") | ||
first: url; | ||
|
||
@doc("Link to the next page") | ||
@example("https://{space_name}.signalwire.com/api/fabric/resources/sip_gateways?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") | ||
next: url; | ||
} | ||
|
||
model SipGatewayAddressListResponse { | ||
data: SipGatewayAddress[]; | ||
links: SipGatewayAddressPaginationResponse; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.