- REST API for <ProductName>REST API for Enterprise Communications Broker, Release 4.0.0
- Examples
- Create A Session Agent
Create A Session Agent
Complete these tasks to create the session-agent configuration element.
Table - Prerequisites
Prerequisite | More Information |
Authenticate | Authenticate |
This example assumes you have exported the access token to the variable $TOKEN
.
- Retrieve the session-agent 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-agent"
The response is saved to the fileresponse.xml
. - Copy the content between the opening and closing <configElement> tags to a new file called
session-agent.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-agent.xml
- If a non-default attribute is desired, set the attribute to its desired value. If using the default settings, do not modify
session-agent.xml
.The following shows an example of the contents of
session-agent.xml
:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <configElement> <elementType>session-agent</elementType> <attribute> <name>hostname</name> <value>SA2</value> </attribute> <attribute> <name>ip-address</name> <value>10.176.226.222</value> </attribute> <attribute> <name>port</name> <value>5080</value> </attribute> <attribute> <name>state</name> <value>enabled</value> </attribute> <attribute> <name>RURI-with-Hostname</name> <value>disabled</value> </attribute> <attribute> <name>app-protocol</name> <value>SIP</value> </attribute> <attribute> <name>app-type</name> <value/> </attribute> <attribute> <name>transport-method</name> <value>UDP</value> </attribute> <attribute> <name>TLS-profile</name> <value>ecbTLS</value> </attribute> <attribute> <name>realm-id</name> <value>ecb</value> </attribute> <attribute> <name>egress-realm-id</name> <value/> </attribute> <attribute> <name>description</name> <value/> </attribute> <attribute> <name>source-context</name> <value/> </attribute> <attribute> <name>egress-URI-mode</name> <value>no-conversion</value> </attribute> <attribute> <name>egress-number-translation-mode</name> <value>E164</value> </attribute> <attribute> <name>number-of-digits-for-n-digit-dialing</name> <value>4</value> </attribute> <attribute> <name>prepend-prefix-on-egress</name> <value/> </attribute> <attribute> <name>outbound-translate-from-number</name> <value>disabled</value> </attribute> <attribute> <name>tags</name> <value/> </attribute> <attribute> <name>carriers</name> <value/> </attribute> <attribute> <name>allow-next-hop-lp</name> <value>enabled</value> </attribute> <attribute> <name>associated-agents</name> <value/> </attribute> <attribute> <name>stop-recurse</name> <value/> </attribute> <attribute> <name>constraints</name> <value>disabled</value> </attribute> <attribute> <name>max-sessions</name> <value>0</value> </attribute> <attribute> <name>max-inbound-sessions</name> <value>0</value> </attribute> <attribute> <name>max-outbound-sessions</name> <value>0</value> </attribute> <attribute> <name>max-burst-rate</name> <value>0</value> </attribute> <attribute> <name>max-inbound-burst-rate</name> <value>0</value> </attribute> <attribute> <name>max-outbound-burst-rate</name> <value>0</value> </attribute> <attribute> <name>max-sustain-rate</name> <value>0</value> </attribute> <attribute> <name>max-inbound-sustain-rate</name> <value>0</value> </attribute> <attribute> <name>max-outbound-sustain-rate</name> <value>0</value> </attribute> <attribute> <name>min-seizures</name> <value>5</value> </attribute> <attribute> <name>min-asr</name> <value>0</value> </attribute> <attribute> <name>session-max-life-limit</name> <value>0</value> </attribute> <attribute> <name>time-to-resume</name> <value>0</value> </attribute> <attribute> <name>ttr-no-response</name> <value>0</value> </attribute> <attribute> <name>in-service-period</name> <value>0</value> </attribute> <attribute> <name>burst-rate-window</name> <value>0</value> </attribute> <attribute> <name>sustain-rate-window</name> <value>0</value> </attribute> <attribute> <name>req-uri-carrier-mode</name> <value>None</value> </attribute> <attribute> <name>proxy-mode</name> <value/> </attribute> <attribute> <name>redirect-action</name> <value/> </attribute> <attribute> <name>loose-routing</name> <value>enabled</value> </attribute> <attribute> <name>send-media-session</name> <value>enabled</value> </attribute> <attribute> <name>response-map</name> <value/> </attribute> <attribute> <name>ping-method</name> <value/> </attribute> <attribute> <name>ping-interval</name> <value>0</value> </attribute> <attribute> <name>ping-send-mode</name> <value>keep-alive</value> </attribute> <attribute> <name>ping-all-addresses</name> <value>disabled</value> </attribute> <attribute> <name>ping-in-service-response-codes</name> <value/> </attribute> <attribute> <name>out-service-response-codes</name> <value/> </attribute> <attribute> <name>load-balance-dns-query</name> <value>hunt</value> </attribute> <attribute> <name>options</name> <value/> </attribute> <attribute> <name>spl-options</name> <value/> </attribute> <attribute> <name>media-profiles</name> <value/> </attribute> <attribute> <name>in-translationid</name> <value/> </attribute> <attribute> <name>out-translationid</name> <value/> </attribute> <attribute> <name>apply-outbound-manipulation-on</name> <value>next-hop-only</value> </attribute> <attribute> <name>trust-me</name> <value>disabled</value> </attribute> <attribute> <name>request-uri-headers</name> <value/> </attribute> <attribute> <name>local-response-map</name> <value/> </attribute> <attribute> <name>ping-to-user-part</name> <value/> </attribute> <attribute> <name>ping-from-user-part</name> <value/> </attribute> <attribute> <name>in-manipulationid</name> <value/> </attribute> <attribute> <name>out-manipulationid</name> <value/> </attribute> <attribute> <name>manipulation-string</name> <value/> </attribute> <attribute> <name>manipulation-pattern</name> <value/> </attribute> <attribute> <name>p-asserted-id</name> <value/> </attribute> <attribute> <name>trunk-group</name> <value/> </attribute> <attribute> <name>max-register-sustain-rate</name> <value>0</value> </attribute> <attribute> <name>early-media-allow</name> <value/> </attribute> <attribute> <name>invalidate-registrations</name> <value>disabled</value> </attribute> <attribute> <name>rfc2833-mode</name> <value>none</value> </attribute> <attribute> <name>rfc2833-payload</name> <value>0</value> </attribute> <attribute> <name>codec-policy</name> <value/> </attribute> <attribute> <name>enforcement-profile</name> <value/> </attribute> <attribute> <name>early-media-inhibit</name> <value>disabled</value> </attribute> <attribute> <name>enable-OPTIONS-ping</name> <value>disabled</value> </attribute> <attribute> <name>LDAP</name> <value/> </attribute> <attribute> <name>additional-target-group</name> <value/> </attribute> <attribute> <name>fork-group</name> <value>1</value> </attribute> <attribute> <name>refer-call-transfer</name> <value>disabled</value> </attribute> <attribute> <name>refer-notify-provisional</name> <value>none</value> </attribute> <attribute> <name>reuse-connections</name> <value>NONE</value> </attribute> <attribute> <name>tcp-keepalive</name> <value>none</value> </attribute> <attribute> <name>tcp-reconn-interval</name> <value>0</value> </attribute> <attribute> <name>max-register-burst-rate</name> <value>0</value> </attribute> <attribute> <name>register-burst-window</name> <value>0</value> </attribute> <attribute> <name>sip-profile</name> <value/> </attribute> <attribute> <name>sip-isup-profile</name> <value/> </attribute> <attribute> <name>kpml-interworking</name> <value>inherit</value> </attribute> <attribute> <name>precedence</name> <value>0</value> </attribute> <attribute> <name>monitoring-filters</name> <value/> </attribute> <attribute> <name>session-recording-server</name> <value/> </attribute> <attribute> <name>session-recording-required</name> <value>disabled</value> </attribute> <attribute> <name>hold-refer-reinvite</name> <value>disabled</value> </attribute> <attribute> <name>send-tcp-fin</name> <value>disabled</value> </attribute> <attribute> <name>sip-recursion-policy</name> <value/> </attribute> <attribute> <name>sm-icsi-match-for-invite</name> <value/> </attribute> <attribute> <name>sm-icsi-match-for-message</name> <value/> </attribute> <attribute> <name>last-modified-by</name> <value>REST-admin@10.138.222.146</value> </attribute> <attribute> <name>last-modified-date</name> <value>2019-07-08 21:01:15</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 session-agent configuration element to the ECB.
curl -X POST \ -d@session-agent.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"