Skip to content

Commit

Permalink
Workinf towards moving schema version from v1beta1 to v1
Browse files Browse the repository at this point in the history
  • Loading branch information
psanders committed Aug 29, 2019
1 parent f3e7c15 commit 67be394
Show file tree
Hide file tree
Showing 45 changed files with 249 additions and 237 deletions.
12 changes: 0 additions & 12 deletions config/dids.yml

This file was deleted.

2 changes: 1 addition & 1 deletion config/domains.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
domainUri: sip.local
egressPolicy:
rule: .*
didRef: dd76afc94b
numberRef: dd76afc94b
- apiVersion: v1beta1
kind: Domain
metadata:
Expand Down
11 changes: 11 additions & 0 deletions config/gateways.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,14 @@
credentials:
username: 'youruser'
secret: 'yoursecret'
- apiVersion: v1beta1
kind: Gateway
metadata:
name: Provider Inc.
spec:
host: sip2.provider.net
port: 5061
transport: udp
credentials:
username: 'youruser'
secret: 'yoursecret'
2 changes: 1 addition & 1 deletion config/stack.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This entry is needed to avoid connections issues with the end-to-end tests
gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY=gov.nist.javax.sip.stack.OIOMessageProcessorFactory
# gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY=gov.nist.javax.sip.stack.OIOMessageProcessorFactory

# Logging settings
#gov.nist.javax.sip.LOG_MESSAGE_CONTENT=true
Expand Down
34 changes: 17 additions & 17 deletions docs/administration/cli/cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ The --filter flag uses [JsonPath](https://github.com/json-path/JsonPath) to perf
All you need to add is the path to the property and the filter operators. For example:

```
# This returns all the DIDs in Gateway 'gweef506'
./rctl get dids --filter "@.metadata.gwRef=='gweef506'"
# This returns all the Numbers in Gateway 'gweef506'
./rctl get numbers --filter "@.metadata.gwRef=='gweef506'"
```

If you need help, just run `rctl --help` from the terminal window.
Expand Down Expand Up @@ -80,14 +80,14 @@ $ rctl reg
`rctl get` - List one or more resources.

```
// List all dids
$ rctl get dids
// List all numbers
$ rctl get numbers
// List all dids that belong to gateway reference gweef506
$ rctl get dids --filter "@.metadata.ref=='gweef506'"
// List all numbers that belong to gateway reference gweef506
$ rctl get numbers --filter "@.metadata.ref=='gweef506'"
// List did by reference
$ rctl get dids dd50baa4
// List numberby reference
$ rctl get numbers dd50baa4
// List all agents
$ rctl get agents
Expand All @@ -110,8 +110,8 @@ $ rctl apply -f new-gateway.yaml
`rctl delete` - delete a resource.

```
// Delete all did for gateway reference gweef506
$ rctl delete dids --filter "@.metadata.gwRef=='gweef506'"
// Delete all numbers for gateway reference gweef506
$ rctl delete numbers --filter "@.metadata.gwRef=='gweef506'"
// Delete a single agent (using delete alias)
$ rctl del agent ag3f77f6
Expand Down Expand Up @@ -139,7 +139,7 @@ $ rctl registry # Shows only current regis

```
# Find all sip devices available at the location service
$ rctl locate # This list does not include did-ingress-routes or domain-egress-routes
$ rctl locate # This list does not include number-ingress-routes or domain-egress-routes
```

### Creating Resources
Expand All @@ -153,11 +153,11 @@ $ rctl create -f agents-list.yaml # Create Agents in file ag
### Finding Resources

```
# Get DIDs
$ rctl get dids # List all available DIDs
$ rctl get did # List all available DIDs
$ rctl get did --filter "@.metadata.ref=='dd50baa4'" # Shows DID with reference 'DID0001'
$ rctl get did --filter "@.metadata.gwRef=='gweef506'" # Shows DIDs with Gateway reference 'GW1232'
# Get Numbers
$ rctl get numbers # List all available Numbers
$ rctl get number # List all available Numbers
$ rctl get number--filter "@.metadata.ref=='dd50baa4'" # Shows Number with reference 'Number0001'
$ rctl get number--filter "@.metadata.gwRef=='gweef506'" # Shows Numbers with Gateway reference 'GW1232'
# Get agents
$ rctl get agents # List all Agents
Expand All @@ -168,7 +168,7 @@ $ rctl get agents # List all Agents
```
# Delete command by refernce or filter
$ rctl delete agent ag3f77f6 # Delete Agent by reference
$ rctl del dids --filter '@.metadata.gwRef=gweef506' # Delete DIDs using a filter
$ rctl del numbers --filter '@.metadata.gwRef=gweef506' # Delete Numbers using a filter
```

### Updating Resources
Expand Down
12 changes: 6 additions & 6 deletions docs/api/dids/create.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Creates a new DID resource. The Gateway must exist before creating the DID.
Creates a new Number. The Gateway must exist before creating the Number.
Otherwise, this method responds with a `UNFULFILLED_DEPENDENCY_RESPONSE`.

**URL**

`/dids`
`/numbers`

**Method**

Expand All @@ -15,19 +15,19 @@ This method does not receive any parameters.

**Request body**

A file containing a [DID](/configuration/dids) resource in `json` format.
A file containing a [Number](/configuration/numbers) resource in `json` format.

**Response**

If successful this method creates an DID resource.
If successful this method creates a Number.

**Sample Call**

```json
POST /api/v1beta1/dids
POST /api/v1beta1/numbers
{
"apiVersion": "v1beta1",
"kind": "DID",
"kind": "Number",
"metadata": {
"gwRef": "gweef506",
"geoInfo": {
Expand Down
8 changes: 4 additions & 4 deletions docs/api/dids/delete.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Removes a DID resource from a persistent database.
Removes a Number from a persistent database.

**URL**

`/dids/{ref}`
`/numbers/{ref}`

**Method**

Expand All @@ -20,12 +20,12 @@ Do not supply a request body with this method.

**Response**

If successful this method removes a DID resource.
If successful this method removes a Number.

**Sample Call**

```json
DELETE /api/v1beta1/dids/dd50baa4
DELETE /api/v1beta1/numbers/dd50baa4
{

}
Expand Down
8 changes: 4 additions & 4 deletions docs/api/dids/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This method returns an Agent resource.

**URL**

`/dids/{ref}`
`/numbers/{ref}`

**Method**

Expand All @@ -20,12 +20,12 @@ Do not supply a request body with this method.

**Response**

If successful this method returns a DID resource.
If successful this method returns a Number.

**Sample Call**

```json
GET /api/v1beta1/dids/dd50baa4
GET /api/v1beta1/numbers/dd50baa4
{

}
Expand All @@ -36,7 +36,7 @@ HTTP/1.1 200 OK
"message": "Successful request",
"result" : {
"apiVersion": "v1beta1",
"kind": "DID",
"kind": "Number",
"metadata": {
"ref": "dd50baa4",
"gwRef": "gweef506",
Expand Down
10 changes: 5 additions & 5 deletions docs/api/dids/list.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
This method returns a list of DID resources.
This method returns a list of Numbers.

**URL**

`/dids`
`/numbers`

**Method**

Expand All @@ -22,12 +22,12 @@ Do not supply a request body with this method.

**Response**

If successful this method returns a list of DID resources.
If successful this method returns a list of Numbers.

**Sample Call**

```json
GET /api/v1beta1/dids
GET /api/v1beta1/numbers
{

}
Expand All @@ -38,7 +38,7 @@ HTTP/1.1 200 OK
"message": "Successful request",
"result" : [{
"apiVersion": "v1beta1",
"kind": "DID",
"kind": "Number",
"metadata": {
"ref": "dd50baa4",
"gwRef": "gweef506",
Expand Down
12 changes: 6 additions & 6 deletions docs/api/dids/update.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Updates an existing DID resource.
Updates an existing Number.

**URL**

`/dids/{ref}`
`/numbers/{ref}`

**Method**

Expand All @@ -14,19 +14,19 @@ This method does not receive any parameters.

**Request body**

A file containing a [DID](/configuration/dids) resource in `json` format.
A file containing a [Number](/configuration/numbers) resource in `json` format.

**Response**

If successful this method updates a DID resource.
If successful this method updates a Number.

**Sample Call**

```json
PUT /api/v1beta1/dids/dd50baa4
PUT /api/v1beta1/numbers/dd50baa4
{
"apiVersion": "v1beta1",
"kind": "DID",
"kind": "Number",
"metadata": {
"ref": "dd50baa4",
"gwRef": "gweef506",
Expand Down
2 changes: 1 addition & 1 deletion docs/api/gateways/delete.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Removes a Gateway resource from a persistent database. Before removing
a Gateway, ensure you have remove all of it child DIDs. Otherwise,
a Gateway, ensure you have remove all of it child Numbers. Otherwise,
this method returns a `FOUND_DEPENDENT_OBJECTS_RESPONSE`

**URL**
Expand Down
16 changes: 8 additions & 8 deletions docs/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ In Routr, the process of receiving a call from PSTN to a Domain is as _Domain In
registries: [sip.nyc.provider.net] # These are additional registrars within the provider's network
```

You also need to define DIDs. Routr uses the Address Of Record(AOR) to routes incoming calls from a DID to an existing Agent or Peer. The AOR must be available in the location service at the time of the call, or the call gets rejected.
You also need to define Numbers. Routr uses the Address Of Record(AOR) to routes incoming calls from a Number to an existing Agent or Peer. The AOR must be available in the location service at the time of the call, or the call gets rejected.

Please examine the following example:

```yaml
- apiVersion: v1beta1
kind: DID
kind: Number
metadata:
gwRef: dd50baa4
geoInfo:
Expand All @@ -105,21 +105,21 @@ Please examine the following example:
aorLink: 'sip:[email protected]' # This is the sip uri of an agent that is expected to be logged in
```

Easy right? Any incoming call is routed from this Gateway and DID to "Jhon Doe" @ Ocean New York.
Easy right? Any incoming call is routed from this Gateway and Number to "Jhon Doe" @ Ocean New York.

**Routing Rules**

The `spec.location` block of a `DID` resource configuration, determines the path of an inbound call from the PSTN. The `aorLink` refers to an Address of Record(Agent or Peer) that is available in the `location service`.
The `spec.location` block of a `Number` resource configuration, determines the path of an inbound call from the PSTN. The `aorLink` refers to an Address of Record(Agent or Peer) that is available in the `location service`.

## Domain Egress Routing

_Domain Egress Routing(DER)_ is the way that **Routr** deals with a call request to a _callee_ that exists in the Public Switched Telephone Network(PSTN) and not in the _callers'_ Domain. The EgressPolicy consists of a `rule`, and a `didRef` defined in the `spec.context` section of `Domains` resources.
_Domain Egress Routing(DER)_ is the way that **Routr** deals with a call request to a _callee_ that exists in the Public Switched Telephone Network(PSTN) and not in the _callers'_ Domain. The EgressPolicy consists of a `rule`, and a `numberRef` defined in the `spec.context` section of `Domains` resources.

The `rule` and `didRef` is defined as follows:
The `rule` and `numberRef` is defined as follows:

* `rule` is a regex to match callee in the call request. The location service uses this only after a search in the caller's Domain first.

* `didRef` is the identifier of the DID that will to route the call. The DID must already exist and have a parent Gateway.
* `numberRef` is the identifier of the Number that will to route the call. The Number must already exist and have a parent Gateway.

**Routing Rules**

Expand All @@ -131,7 +131,7 @@ Peers are very similar to Agents, but they are not bound to any Domain, and usua

Peers can perform inbound/outbound signaling within the network without any special consideration since they exist inside the _Location Service_ just like Agents. So it is possible to perform signaling from Peer to Peer, Peer to Agent.

The same is true for Inbound from the PSTN. For example, we can redirect incoming calls from the PSTN using the `spec.location` settings in the `dids.yml` configuration file.
The same is true for Inbound from the PSTN. For example, we can redirect incoming calls from the PSTN using the `spec.location` settings in the `numbers.yml` configuration file.

**Routing Rules**

Expand Down
6 changes: 3 additions & 3 deletions docs/configuration/domains.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ outgoing calling. The domains configuration can be provided using the file `conf
| kind | Defines the type of resource | Yes |
| metadata.name | Friendly name for the SIP domain | Yes |
| spec.context.domainUri | Domain URI. FQDN is recommended | Yes |
| spec.context.egressPolicy.rule | Regular expression indicating when a call will be routed via $spec.context.egressPolicy.didRef | No |
| spec.context.egressPolicy.didRef | Reference to the DID that will route the call | No |
| spec.context.egressPolicy.rule | Regular expression indicating when a call will be routed via $spec.context.egressPolicy.numberRef | No |
| spec.context.egressPolicy.numberRef | Reference to the Number that will route the call | No |
| spec.context.accessControlList.allow[*] | Traffic allow for Network in list | No |
| spec.context.accessControlList.deny[*] | Traffic disabled for Network in list| No |

Expand All @@ -34,7 +34,7 @@ ACL Rules may be in CIDR, IP/Mask, or single IP format. Example of rules are:
domainUri: sip.local
egressPolicy:
rule: .*
didRef: DID0001
numberRef: Number0001
accessControlList:
deny: [0.0.0.0/1] # Deny all
allow: [192.168.0.1/31]
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/gateways.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For static IP authentication be sure to properly configure the `spec.externAddr`
| apiVersion | Indicates the version of the resource (Not yet implemented)| Yes |
| kind | Defines the type of resource | Yes |
| metadata.name | Friendly name for the SIP device | Yes |
| metadata.ref | Reference to this resource | Yes |
| metadata.ref | Reference to this resource | No |
| spec.credentials.username | Gateway username. No required for static IP authentication | No |
| spec.credentials.secret | Gateway secret. No required for static IP authentication | No |
| spec.host | Gateway host | Yes |
Expand Down
Loading

0 comments on commit 67be394

Please sign in to comment.