11 Dial String Rewriting

11.1 Get

GET https://<HOST>:<PORT>/api/dialStringRewriting/get?version=0

Returns the specified dial string rewriting object.

Required Permissions

  • API

  • Configuration Mode Read Access

Request parameters

  • dialStringRewriting

    Display name or ID of the dial string rewriting object. If not provided, all dial string rewriting objects will be returned.

Response Body Structure

The response body is strutured as an array. The array consists of DialStringRewriting JSON objects. A description for its fields is at section 27.13.1. For the JSON schema refer to section 27.13.2.

Example

GET http://127.0.0.1:8111/api/dialStringRewriting/get?version=0
HTTP Response
HTTP/1.1 200 OK
HTTP Response Body
[
  {
    "displayName": "RD 1",
    "rules": [{
      "prefix": "123",
      "displayName": "test",
      "addSuffix": "3",
      "matchTags": {
        "tagSet": [
          "userIp",
          "userPhone"
        ],
        "type": "xor"
      },
      "index": 0,
      "deleteTrailingCharacters": 2,
      "suffix": "456",
      "deleteLeadingCharacters": 1,
      "clearDisplayName": false,
      "rewriteType": "prefixAndSuffix",
      "skipRulesBelow": false,
      "skipFurtherRules": true,
      "comment": "Prefix Suffix Rewrite",
      "tagRewrite": {
        "operations": [
          {
            "tag": "userIp",
            "type": "keep"
          },
          {
            "tag": "userPhone",
            "type": "delete"
          }
        ],
        "clearTags": false
      },
      "applyToSourceDialString": true,
      "case": "lowercase",
      "addPrefix": "2"
    }],
    "id": "94b6df47-a230-4e1c-8109-10a94b63bcfd"
  },
  {
    "displayName": "",
    "rules": [
      {
        "clearDisplayName": false,
        "prefix": "00",
        "rewriteType": "prefixAndSuffix",
        "skipRulesBelow": false,
        "index": 0,
        "skipFurtherRules": false,
        "applyToAllDialStrings": true,
        "deleteLeadingCharacters": 2,
        "addPrefix": "+"
      },
      {
        "clearDisplayName": false,
        "prefix": "0",
        "rewriteType": "prefixAndSuffix",
        "skipRulesBelow": false,
        "index": 1,
        "skipFurtherRules": false,
        "applyToAllDialStrings": true,
        "deleteLeadingCharacters": 1,
        "addPrefix": "+41"
      }
    ],
    "id": "9e1ea384-85d5-456b-aa5b-6d56def9ffdd"
  }
]

11.2 Set

PUT https://<HOST>:<PORT>/api/dialStringRewriting/set?version=0

Modifies the selected dial string rewriting object.

Required Permissions

  • API

  • Configuration Mode Read/Write Access

Request parameters

  • dialStringRewriting

    The ID of the dial string rewriting object.

Request Body Structure

The request body is structured as DialStringRewriting JSON object. A description for its fields is at section 27.13.1. For the JSON schema refer to section 27.13.2.

Response Body Structure

The response body is structured as DialStringRewriting JSON object. A description for its fields is at section 27.13.1. For the JSON schema refer to section 27.13.2.

Example

PUT http://127.0.0.1:8111/api/dialStringRewriting/set?dialStringRewriting=94b6df47-a230-4e1c-8109-10a94b63bcfd&version=0
HTTP Request Body
{
  "displayName": "RD 1",
  "rules": []
}
HTTP Response
HTTP/1.1 200 OK
HTTP Response Body
{
  "displayName": "RD 1",
  "rules": [],
  "id": "94b6df47-a230-4e1c-8109-10a94b63bcfd"
}

11.3 Add

POST https://<HOST>:<PORT>/api/dialStringRewriting/add?version=0

Adds a new dial string rewriting object.

Required Permissions

  • API

  • Configuration Mode Read/Write Access

Request Body Structure

The request body is structured as DialStringRewriting JSON object. A description for its fields is at section 27.13.1. For the JSON schema refer to section 27.13.2.

Response Body Structure

The response body is structured as DialStringRewriting JSON object. A description for its fields is at section 27.13.1. For the JSON schema refer to section 27.13.2.

Example

POST http://127.0.0.1:8111/api/dialStringRewriting/add?version=0
HTTP Request Body
{
  "displayName": "RD 1",
  "rules": [{
    "applyToDestinationDialString": false,
    "prefix": "123",
    "displayName": "test",
    "addSuffix": "3",
    "matchTags": {
      "tagSet": [
        "userIp",
        "userPhone"
      ],
      "type": "xor"
    },
    "index": 0,
    "deleteTrailingCharacters": 2,
    "suffix": "456",
    "deleteLeadingCharacters": 1,
    "clearDisplayName": false,
    "rewriteType": "prefixAndSuffix",
    "skipRulesBelow": false,
    "skipFurtherRules": true,
    "comment": "Prefix Suffix Rewrite",
    "tagRewrite": {
      "operations": [
        {
          "tag": "userIp",
          "type": "keep"
        },
        {
          "tag": "userPhone",
          "type": "delete"
        }
      ],
      "clearTags": false
    },
    "applyToSourceDialString": true,
    "applyToAllDialStrings": false,
    "case": "lowercase",
    "addPrefix": "2"
  }]
}
HTTP Response
HTTP/1.1 200 OK
HTTP Response Body
{
  "displayName": "RD 1",
  "rules": [{
    "prefix": "123",
    "displayName": "test",
    "addSuffix": "3",
    "matchTags": {
      "tagSet": [
        "userIp",
        "userPhone"
      ],
      "type": "xor"
    },
    "index": 0,
    "deleteTrailingCharacters": 2,
    "suffix": "456",
    "deleteLeadingCharacters": 1,
    "clearDisplayName": false,
    "rewriteType": "prefixAndSuffix",
    "skipRulesBelow": false,
    "skipFurtherRules": true,
    "comment": "Prefix Suffix Rewrite",
    "tagRewrite": {
      "operations": [
        {
          "tag": "userIp",
          "type": "keep"
        },
        {
          "tag": "userPhone",
          "type": "delete"
        }
      ],
      "clearTags": false
    },
    "applyToSourceDialString": true,
    "case": "lowercase",
    "addPrefix": "2"
  }],
  "id": "94b6df47-a230-4e1c-8109-10a94b63bcfd"
}

11.4 Remove

DELETE https://<HOST>:<PORT>/api/dialStringRewriting/remove?version=0

Removes a dial string rewriting object.

Required Permissions

  • API

  • Configuration Mode Read/Write Access

Request parameters

  • dialStringRewriting

    Display name or ID of the dial string rewriting object to be removed.

Example

DELETE http://127.0.0.1:8110/api/dialStringRewriting/remove?dialStringRewriting=a12e9b86-a953-4fd0-8862-600659c4e9b4&version=0
HTTP Response Body
[
  {
    "displayName": "",
    "rules": [
      {
        "clearDisplayName": false,
        "prefix": "00",
        "rewriteType": "prefixAndSuffix",
        "skipRulesBelow": false,
        "index": 0,
        "skipFurtherRules": false,
        "applyToAllDialStrings": true,
        "deleteLeadingCharacters": 2,
        "addPrefix": "+"
      },
      {
        "clearDisplayName": false,
        "prefix": "0",
        "rewriteType": "prefixAndSuffix",
        "skipRulesBelow": false,
        "index": 1,
        "skipFurtherRules": false,
        "applyToAllDialStrings": true,
        "deleteLeadingCharacters": 1,
        "addPrefix": "+41"
      }
    ],
    "id": "d3daab5c-1d66-4451-8feb-c2ab1c44bbff"
  },
  {
    "displayName": "",
    "rules": [{
      "clearDisplayName": false,
      "prefix": "+41",
      "rewriteType": "prefixAndSuffix",
      "skipRulesBelow": false,
      "index": 0,
      "skipFurtherRules": false,
      "applyToSourceDialString": true,
      "deleteLeadingCharacters": 3,
      "addPrefix": "0"
    }],
    "id": "fc27d8a0-13cc-475f-85e0-558118b59577"
  }
]

11.5 Get Rules

GET https://<HOST>:<PORT>/api/dialStringRewriting/rules/get?version=0

Returns the rewriting rules of the choosen dial string rewriting object.

Required Permissions

  • API

  • Configuration Mode Read Access

Request parameters

  • dialStringRewriting

    Display name or ID of the dial string rewriting object to request rules from.

Response Body Structure

The response body is strutured as an array. The array consists of DialStringRewriting JSON objects. A description for its fields is at section 27.13.1. For the JSON schema refer to section 27.13.2.

Example

GET http://127.0.0.1:8111/api/dialStringRewriting/rules/get?dialStringRewriting=94b6df47-a230-4e1c-8109-10a94b63bcfd&version=0
HTTP Response
HTTP/1.1 200 OK
HTTP Response Body
[{
  "prefix": "123",
  "displayName": "test",
  "addSuffix": "3",
  "matchTags": {
    "tagSet": [
      "userIp",
      "userPhone"
    ],
    "type": "xor"
  },
  "index": 0,
  "deleteTrailingCharacters": 2,
  "suffix": "456",
  "deleteLeadingCharacters": 1,
  "clearDisplayName": false,
  "rewriteType": "prefixAndSuffix",
  "skipRulesBelow": false,
  "skipFurtherRules": true,
  "comment": "Prefix Suffix Rewrite",
  "tagRewrite": {
    "operations": [
      {
        "tag": "userIp",
        "type": "keep"
      },
      {
        "tag": "userPhone",
        "type": "delete"
      }
    ],
    "clearTags": false
  },
  "applyToSourceDialString": true,
  "case": "lowercase",
  "addPrefix": "2"
}]

11.6 Set Rules

PUT https://<HOST>:<PORT>/api/dialStringRewriting/rules/set?version=0

Replaces the rewriting rules of the choosen dial string rewriting object.

Required Permissions

  • API

  • Configuration Mode Read/Write Access

Request parameters

  • dialStringRewriting

    Display name or ID of the dial string rewriting object the rewriting rules should be modified of.

Request Body Structure

The request body is strutured as JSON array. The array consists of DialStringRewrite JSON objects. A description for its fields is at section 27.14.1. For the JSON schema refer to section 27.14.2.

Response Body Structure

The response body is strutured as an array. The array consists of DialStringRewrite JSON objects. A description for its fields is at section 27.14.1. For the JSON schema refer to section 27.14.2.

Example

PUT http://127.0.0.1:8110/api/dialStringRewriting/rules/set?dialStringRewriting=a12e9b86-a953-4fd0-8862-600659c4e9b4&version=0
HTTP Request Body
[{
  "applyToDestinationDialString": false,
  "prefix": "123",
  "displayName": "test",
  "addSuffix": "3",
  "matchTags": {
    "tagSet": [
      "userIp",
      "userPhone"
    ],
    "type": "xor"
  },
  "index": 0,
  "deleteTrailingCharacters": 2,
  "suffix": "456",
  "deleteLeadingCharacters": 1,
  "clearDisplayName": false,
  "rewriteType": "prefixAndSuffix",
  "skipRulesBelow": false,
  "skipFurtherRules": true,
  "comment": "Prefix Suffix Rewrite",
  "tagRewrite": {
    "operations": [
      {
        "tag": "userIp",
        "type": "keep"
      },
      {
        "tag": "userPhone",
        "type": "delete"
      }
    ],
    "clearTags": false
  },
  "applyToSourceDialString": true,
  "applyToAllDialStrings": false,
  "case": "lowercase",
  "addPrefix": "2"
}]
HTTP Response Body
[{
  "prefix": "123",
  "displayName": "test",
  "addSuffix": "3",
  "matchTags": {
    "tagSet": [
      "userIp",
      "userPhone"
    ],
    "type": "xor"
  },
  "index": 0,
  "deleteTrailingCharacters": 2,
  "suffix": "456",
  "deleteLeadingCharacters": 1,
  "clearDisplayName": false,
  "rewriteType": "prefixAndSuffix",
  "skipRulesBelow": false,
  "skipFurtherRules": true,
  "comment": "Prefix Suffix Rewrite",
  "tagRewrite": {
    "operations": [
      {
        "tag": "userIp",
        "type": "keep"
      },
      {
        "tag": "userPhone",
        "type": "delete"
      }
    ],
    "clearTags": false
  },
  "applyToSourceDialString": true,
  "case": "lowercase",
  "addPrefix": "2"
}]

11.7 Import Rules

PUT https://<HOST>:<PORT>/api/dialStringRewriting/rules/import?version=0

Imports dial string rewriting rules into the specified dial string rewriting object.

Required Permissions

  • API

  • Configuration Mode Read/Write Access

Request parameters

  • filename

    The path to the file that will be imported.

  • json

    Type: Boolean

    Determines if the uploaded file is in the JSON format. Defaults to false.

  • dialStringRewriting

    Display name or ID of the dial string rewriting object to add rewriting rules to.

Request Body Structure

The request expects the .csv or .json file that should be imported.

Example

PUT http://127.0.0.1:8110/api/dialStringRewriting/rules/import?dialStringRewriting=3a91c8be-f169-4fa4-bbce-fff6e15927b3&version=0
HTTP Response Body
[{
  "clearDisplayName": false,
  "rewriteType": "cutExtensionNumber",
  "skipRulesBelow": false,
  "index": 0,
  "skipFurtherRules": false,
  "applyToAllDialStrings": true
}]

11.8 Export Rules

GET https://<HOST>:<PORT>/api/dialStringRewriting/rules/export?version=0

Exports dial string rewriting rules from the specified dial string rewriting object as JSON.

Required Permissions

  • API

  • Configuration Mode Read Access

Request parameters

  • filename

    (Optional) Name of the exported file.

  • backendName

    (Optional) If there are additionally configured backends...

  • dialStringRewriting

    Display name or ID of the dial string rewriting object to add rewriting rules to.

Example

GET http://127.0.0.1:8111/api/dialStringRewriting/rules/export?dialStringRewriting=94b6df47-a230-4e1c-8109-10a94b63bcfd&version=0
HTTP Response
HTTP/1.1 200 OK

11.9 Add Rules

POST https://<HOST>:<PORT>/api/dialStringRewriting/rules/add?version=0

Add dial string rewriting rules to the specified dial string rewriting object.

Required Permissions

  • API

  • Configuration Mode Read/Write Access

Request parameters

  • dialStringRewriting

    Display name or ID of the dial string rewriting object the rewriting rules should be modified of.

Request Body Structure

The request body is structured as DialStringRewrite JSON object. A description for its fields is at section 27.14.1. For the JSON schema refer to section 27.14.2.

Response Body Structure

The response body is structured as DialStringRewriting JSON object. A description for its fields is at section 27.13.1. For the JSON schema refer to section 27.13.2.

Example

POST http://127.0.0.1:8110/api/dialStringRewriting/rules/add?dialStringRewriting=a12e9b86-a953-4fd0-8862-600659c4e9b4&version=0
HTTP Request Body
{
  "applyToDestinationDialString": false,
  "prefix": "123",
  "displayName": "test",
  "addSuffix": "3",
  "matchTags": {
    "tagSet": [
      "userIp",
      "userPhone"
    ],
    "type": "xor"
  },
  "index": 0,
  "deleteTrailingCharacters": 2,
  "suffix": "456",
  "deleteLeadingCharacters": 1,
  "clearDisplayName": false,
  "rewriteType": "prefixAndSuffix",
  "skipRulesBelow": false,
  "skipFurtherRules": true,
  "comment": "Prefix Suffix Rewrite",
  "tagRewrite": {
    "operations": [
      {
        "tag": "userIp",
        "type": "keep"
      },
      {
        "tag": "userPhone",
        "type": "delete"
      }
    ],
    "clearTags": false
  },
  "applyToSourceDialString": true,
  "applyToAllDialStrings": false,
  "case": "lowercase",
  "addPrefix": "2"
}
HTTP Response Body
{
  "displayName": "RD 1",
  "rules": [{
    "prefix": "123",
    "displayName": "test",
    "addSuffix": "3",
    "matchTags": {
      "tagSet": [
        "userIp",
        "userPhone"
      ],
      "type": "xor"
    },
    "index": 0,
    "deleteTrailingCharacters": 2,
    "suffix": "456",
    "deleteLeadingCharacters": 1,
    "clearDisplayName": false,
    "rewriteType": "prefixAndSuffix",
    "skipRulesBelow": false,
    "skipFurtherRules": true,
    "comment": "Prefix Suffix Rewrite",
    "tagRewrite": {
      "operations": [
        {
          "tag": "userIp",
          "type": "keep"
        },
        {
          "tag": "userPhone",
          "type": "delete"
        }
      ],
      "clearTags": false
    },
    "applyToSourceDialString": true,
    "case": "lowercase",
    "addPrefix": "2"
  }],
  "id": "a12e9b86-a953-4fd0-8862-600659c4e9b4"
}

11.10 Remove Rules

DELETE https://<HOST>:<PORT>/api/dialStringRewriting/rules/remove?version=0

Removes a dial string rewriting rule of the specified dial string rewriting object.

Required Permissions

  • API

  • Configuration Mode Read/Write Access

Request parameters

  • index

    The index of the rule that will be removed. Either this or the parameter rule must be provided.

  • rule

    The display name of the rule that will be removed. Either this or the parameter index must be provided.

  • dialStringRewriting

    Display name or ID of the dial string rewriting object the rewriting rules should be modified of.

Response Body Structure

The response body is structured as DialStringRewriting JSON object. A description for its fields is at section 27.13.1. For the JSON schema refer to section 27.13.2.

Example

DELETE http://127.0.0.1:8110/api/dialStringRewriting/rules/remove?index=0&dialStringRewriting=a12e9b86-a953-4fd0-8862-600659c4e9b4&version=0
HTTP Response Body
{
  "displayName": "RD 1",
  "rules": [],
  "id": "a12e9b86-a953-4fd0-8862-600659c4e9b4"
}

11.11 Clear Rules

DELETE https://<HOST>:<PORT>/api/dialStringRewriting/rules/clear?version=0

Removes all dial string rewriting rules of the specified dial string rewriting object.

Required Permissions

  • API

  • Configuration Mode Read/Write Access

Request parameters

  • dialStringRewriting

    Display name or ID of the dial string rewriting object the rewriting rules should be modified of.

Response Body Structure

The response body is structured as DialStringRewriting JSON object. A description for its fields is at section 27.13.1. For the JSON schema refer to section 27.13.2.

Example

DELETE http://127.0.0.1:8111/api/dialStringRewriting/rules/clear?dialStringRewriting=94b6df47-a230-4e1c-8109-10a94b63bcfd&version=0
HTTP Response
HTTP/1.1 200 OK
HTTP Response Body
{
  "displayName": "RD 1",
  "rules": [],
  "id": "94b6df47-a230-4e1c-8109-10a94b63bcfd"
}