Skip to content

ARI: Added paths to get and set multiple channel variables.#1869

Closed
bkford wants to merge 1 commit intoasterisk:masterfrom
bkford:ari-multiple-get-set
Closed

ARI: Added paths to get and set multiple channel variables.#1869
bkford wants to merge 1 commit intoasterisk:masterfrom
bkford:ari-multiple-get-set

Conversation

@bkford
Copy link
Copy Markdown
Contributor

@bkford bkford commented Apr 15, 2026

Two new paths exist for ARI to get and set multiple channel variables at
the same time. This is done via GET and POST like the single get and set
variable equivalents. Leading and trailing whitespace will be stripped
from the variable names for both paths. When setting variables, the
values will be read as-is, whitespace included. GET takes in a single
string with comma-separated values, while POST takes in a dictionary of
key value pairs. The code follows the same paths as when setting
multiple variables when originating a channel via ARI.

UserNote: Added new ARI paths for getting and setting multiple channel
variables at a time. For GET, this takes in a single string of
comma-separated variable names, while POST takes in a dictionary of key
value pairs. The behavior is the same as passing in variables when
originating a channel.

@bkford
Copy link
Copy Markdown
Contributor Author

bkford commented Apr 15, 2026

cherry-pick-to: 23
cherry-pick-to: 22
cherry-pick-to: 20

@github-actions
Copy link
Copy Markdown

Workflow Check completed successfully

@github-actions
Copy link
Copy Markdown

Workflow Check completed successfully

Comment thread rest-api/api-docs/channels.json
@gtjoseph
Copy link
Copy Markdown
Member

In the commit message, I don't understand what the following means...

You can also use getChannelVars and setChannelVars in your applications.

@bkford
Copy link
Copy Markdown
Contributor Author

bkford commented Apr 17, 2026

NOTE
One concern I have is the locking, so extra eyes on that would be greatly appreciated. The main concerns are:

  1. When setting multiple variables, ast_set_variables is called and locks the channel. It eventually gets to pbx_builtin_setvar_helper, which ALSO locks the channel. Originating a channel also does this.
  2. When setting a single variable (the original, existing path), it calls a different function: stasis_app_control_set_channel_var. This does NOT lock the channel before calling, but it ALSO eventually gets to pbx_builtin_setvar_helper.
  3. In the original, existing get variable function, it makes a note of not locking when reading from the channel due to potential locking issues, especially with autoservice dialplan functions. It may not have anything to do with a write, but it's a concern I had.

@github-actions
Copy link
Copy Markdown

Workflow Check completed successfully

Comment thread rest-api/api-docs/channels.json Outdated
Comment thread res/ari/resource_channels.c Outdated
@github-actions
Copy link
Copy Markdown

Workflow Check completed successfully

@bkford bkford requested a review from gtjoseph April 20, 2026 14:47
Comment thread res/ari/resource_channels.c Outdated
Comment thread res/ari/resource_channels.c Outdated
Comment thread res/ari/resource_channels.c Outdated
@github-actions
Copy link
Copy Markdown

Workflow Check failed
master-app_dial: FAILED TEST: apps/queues/transfer/caller_attended
master-ari2: FAILED TEST: rest_api/channels/channel_variables/get_set_multiple

@gtjoseph gtjoseph dismissed their stale review April 28, 2026 13:11

Need failing testsuite test corrected.

Copy link
Copy Markdown
Member

@gtjoseph gtjoseph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need failing get_set testsuite test to pass.

Two new paths exist for ARI to get and set multiple channel variables at
the same time. This is done via GET and POST like the single get and set
variable equivalents. Leading and trailing whitespace will be stripped
from the variable names for both paths. When setting variables, the
values will be read as-is, whitespace included. GET takes in a single
string with comma-separated values, while POST takes in a dictionary of
key value pairs. The code follows the same paths as when setting
multiple variables when originating a channel via ARI.

UserNote: Added new ARI paths for getting and setting multiple channel
variables at a time. For GET, this takes in a single string of
comma-separated variable names, while POST takes in a dictionary of key
value pairs. The behavior is the same as passing in variables when
originating a channel.
@github-actions
Copy link
Copy Markdown

Workflow Check failed
master-pjs2: FAILED TEST: channels/pjsip/transfers/attended_transfer/nominal/callee_local

@github-actions
Copy link
Copy Markdown

Workflow Check failed
master-pjs5: FAILED TEST: channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/batched

@gtjoseph gtjoseph added the cherry-pick-test Trigger dry run of cherry-picks label Apr 28, 2026
@github-actions github-actions Bot added cherry-pick-testing-in-progress Cherry-Pick tests in progress cherry-pick-checks-passed Cherry-Pick checks passed and removed cherry-pick-test Trigger dry run of cherry-picks cherry-pick-testing-in-progress Cherry-Pick tests in progress labels Apr 28, 2026
@github-actions
Copy link
Copy Markdown

Workflow CPCheck completed successfully

@gtjoseph gtjoseph marked this pull request as draft April 30, 2026 13:21
@gtjoseph
Copy link
Copy Markdown
Member

Moving to DRAFT because @mbradeen has a related PR coming and we want to make sure they're in sync before merging.

@bkford bkford closed this May 7, 2026
@bkford
Copy link
Copy Markdown
Contributor Author

bkford commented May 7, 2026

Included in #1917

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants