Create A Session Group

Complete these tasks to create the session-group 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 session-group 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=session-group"
    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 session-group.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 - > session-group.xml
  3. If a non-default attribute is desired, set the attribute to its desired value. If using the default settings, do not modify session-group.xml.

    The following shows an example of the contents of session-group.xml:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <configElement>
    	<elementType>session-group</elementType>
    	<attribute>
    		<name>group-name</name>
    		<value>group3</value>
    	</attribute>
    	<attribute>
    		<name>description</name>
    		<value>new group 3</value>
    	</attribute>
    	<attribute>
    		<name>state</name>
    		<value>enabled</value>
    	</attribute>
    	<attribute>
    		<name>app-protocol</name>
    		<value>SIP</value>
    	</attribute>
    	<attribute>
    		<name>strategy</name>
    		<value>Hunt</value>
    	</attribute>
    	<attribute>
    		<name>dest</name>
    		<value/>
    	</attribute>
    	<attribute>
    		<name>trunk-group</name>
    		<value/>
    	</attribute>
    	<attribute>
    		<name>sag-recursion</name>
    		<value>disabled</value>
    	</attribute>
    	<attribute>
    		<name>stop-sag-recurse</name>
    		<value>401,407</value>
    	</attribute>
    	<attribute>
    		<name>sip-recursion-policy</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-08 21:15:10</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 session-group configuration element to the ECB.
    curl -X POST \
        -d@session-group.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"