Delete a Dialing Context

Complete these tasks to delete a dialing-context configuration element.

Table - Prerequisites

Prerequisite More Information
Authenticate Authenticate

This example assumes you have exported the access token to the variable $TOKEN.

  1. Acquire the configuration lock.
    curl -X POST \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.2/configuration/lock"
  2. Delete the dialing context.

    To delete a specific dial-pattern for a dialing-context:

    curl -X DELETE \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.2/configuration/configElements?elementType=dialing-context&name=<childKey>&parent=<parentKey>&dial-pattern=<removePrefix>/<pattern>"

    To delete a specific dial-pattern for a dialing-context when the pattern only is present:

    curl -X DELETE \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.2/configuration/configElements?elementType=dialing-context&name=<childKey>&parent=<parentKey>&dial-pattern=/<pattern>"

    To delete a specific dial-pattern for a dialing-context when the remove-prefix only is present:

    curl -X DELETE \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.2/configuration/configElements?elementType=dialing-context&name=<childKey>&parent=<parentKey>&dial-pattern=<removePrefix>/"

    To delete all dial patterns for a dialing-context, use removeAll as the value of the dial-pattern parameter.

    curl -X DELETE \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.2/configuration/configElements?elementType=dialing-context&name=<childKey>&parent=<parentKey>&dial-pattern=<removeAll>"

    To delete a dialing-context:

    curl -X DELETE \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.2/configuration/configElements?elementType=dialing-context&name=<childKey>&parent=<parentKey>"

    If the dialing context you want to delete is at the root level, leave the parent parameter blank.

  3. If done editing the configuration, save, verify, and activate the configuration.
  4. Release the configuration lock.
    curl -X POST \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.2/configuration/unlock"