Complete these tasks to create the user-number configuration element.
This example assumes you have exported the access token to the variable $TOKEN
.
- Retrieve the user-number template.
The template of a configuration element is a data structure containing all required sub-elements and supported attributes with their default values, along with any specified optional sub-elements.
curl -X GET -o response.xml \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://10.0.0.2/rest/v1.1/configuration/elementTypes/template?elementType=user-number"
The response is saved to the file
response.xml
.
- Copy the content between the opening and closing <configElement> tags to a new file called
user-number.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 - > user-number.xml
- If a non-default attribute is desired, set the attribute to its desired value. If using the default settings, do not modify
user-number.xml
.
The following shows an example of the contents of user-number.xml
:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configElement>
<elementType>user-number</elementType>
<attribute>
<name>AoR</name>
<value>sip:bob@oracle.com</value>
</attribute>
<attribute>
<name>number-or-pattern</name>
<value>121212121</value>
</attribute>
<attribute>
<name>description</name>
<value/>
</attribute>
<attribute>
<name>Dialing-context</name>
<value/>
</attribute>
<attribute>
<name>agent</name>
<value/>
</attribute>
<attribute>
<name>policy</name>
<value/>
</attribute>
<attribute>
<name>tags</name>
<value/>
</attribute>
<attribute>
<name>last-modified-by</name>
<value>REST-admin@10.0.0.6</value>
</attribute>
<attribute>
<name>last-modified-date</name>
<value>2019-07-02 15:46:33</value>
</attribute>
</configElement>
- Acquire the configuration lock.
curl -X POST \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://10.0.0.2/rest/v1.1/configuration/lock"
- Add the user-number configuration element to the ECB.
curl -X POST \
-d@user-number.xml \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://10.0.0.2/rest/v1.1/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.1/configuration/unlock"