Complete these tasks to update a dialing-context configuration element.
This example assumes you have exported the access token to the variable $TOKEN
.
- Retrieve the dialing-context configuration you want to modify.
curl -X GET -o response.xml \
--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>"
If the dialing context you want to retrieve is at the root level, leave the parent parameter blank. The dial-pattern parameter is optional.
The response is saved to the file response.xml
.
- Copy the content between the opening and closing <configElement> tags to a new file
called
dialing-context.xml
.
If you are on a Linux system with xmllint
installed, you may optionally
format the XML before writing it to the file system.
sed -n '/<configElement>/,/<\/configElement>/p' response.xml | xmllint --format - > dialing-context.xml
- Update the values in the XML file to their desired values.
- 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"
- Update the dialing-context configuration element.
curl -X PUT \
-d@dialing-context.xml \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://10.0.0.2/rest/v1.2/configuration/configElements"
- If done editing the configuration, save, verify, and activate the configuration.
- 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"