ADAPT::enable

Description

The ADAPT::enable command sets or returns the enable attribute

Syntax

ADAPT::enable
ADAPT::enable request
ADAPT::enable response
ADAPT::enable <bool>
ADAPT::enable request <bool>
ADAPT::enable response <bool>

#v12 introduces optional context parameter, where <ctx> represents a context handle
ADAPT::enable [<ctx>]
ADAPT::enable [<ctx>] request
ADAPT::enable [<ctx>] response
ADAPT::enable [<ctx>] <bool>
ADAPT::enable [<ctx>] request <bool>
ADAPT::enable [<ctx>] response <bool>

Notes: The request-adapt side cannot modify attributes on the response-adapt side until the connection has been established with the server. The bool formats allowed are below, though disable / enable is the recommended approach.
  • 0 / 1
  • false / true
  • disable / enable
  • no / yes

ADAPT::enable [<ctx>]

  • Get the enable attribute for the current side

ADAPT::enable [<ctx>] request

  • Get the enabled attribute for the request-adapt side

ADAPT::enable [<ctx>] response

  • Get the enabled attribute for the response-adapt side

ADAPT::enable [<ctx>] <bool>

  • Disable or enable the current side

ADAPT::enable [<ctx>] request <bool>

  • Disable or enable the request-adapt side

ADAPT::enable [<ctx>] response <bool>

  • Disable or enable the response-adapt side

Examples

when HTTP_REQUEST {
    log local0. “Event HTTP_REQUEST"
    # Disable the static configs (templates for dynamic)
    ADAPT::enable request false
    ADAPT::enable response false
    # Create the first dynamic context on the clientside and configure it.
    set req_ctx1 [ADAPT::context_create req_ctx1]
    ADAPT::select $req_ctx1 /Common/ivs-req1-example
    ADAPT::enable $req_ctx1 true
    # Create the first dynamic context on the serverside and configure it (pending).
    set rsp_ctx1 [ADAPT::context_create response rsp_ctx1]
    ADAPT::select $rsp_ctx1 /Common/ivs-rsp1-example
    ADAPT::enable $rsp_ctx1 true
}
when ADAPT_REQUEST_RESULT {
    set ctx [ADAPT::context_current]
    set ctx_name [ADAPT::context_name $ctx]
    log local0. "Event ADAPT_REQUEST_RESULT in context $ctx_name"
    if {$ctx == $req_ctx1} {
        # Create the second dynamic context on the clientside and configure it.
        set req_ctx2 [ADAPT::context_create req_ctx2]
        ADAPT::select $req_ctx2 /Common/ivs-req2-example
        ADAPT::enable $req_ctx2 true
        # Create the second dynamic context on the serverside and configure it.
        set rsp_ctx2 [ADAPT::context_create response demo_rsp_ctx2]
        ADAPT::select $rsp_ctx2 /Common/ivs-rsp2-example
        ADAPT::enable $rsp_ctx2 true
    }
}