Add A User Number

Complete these tasks to create the user-number configuration element.

Table - Prerequisites

Prerequisite More Information
Authenticate Authenticate

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

  1. 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.
  2. 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
  3. 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>
  4. 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"
  5. 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"
  6. If done editing the configuration, save, verify, and activate the configuration.
  7. 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"