Multiple variables on post to ari/channels


I’m trying to originate a call through ARI using python requests module. I get the call but I cannot see on the dialplan any of the vars I set in the request.
I can see in the docs this but I don’t know what I’m doing wrong:

variables: containers - The “variables” key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { “endpoint”: “SIP/Alice”, “variables”: { “CALLERID(name)”: “Alice” } }

Here is the code I’m using to test this:

import requests

USER = "asterisk"
PASS = "asterisk"
IP = ""
PORT = "8088"

number = "123456789"

url = (

body = {
    "variables": {
        "call_id": "1234",
        "number": number,
        "question": "1a",
        "bot": "54321"

resp =
        auth=(USER, PASS),


In the dialplan I’m trying to get the variables like this:

NoOp(IDENTIFICADOR =====> ${call_id})

Thank you in advance.

Nevermind… I was sending body as a string instead of json. Changing data parameter to json it works perfect:

resp =
        auth=(USER, PASS),

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.