How to interactively display the value of an asterisk function

Running asterisk 16

Is there away to display the value of a function from the Asterisk CLI?

functions don’t have ‘values’, you can list them with

core show functions

and get info about any one with

core show function xxxx

as with all things asterisk CLI wise you can use tab completion

The result of a function can be assigned to a variable. After the assignment, I would like to display the value of the variable

No, you can’t execute a dialplan function from the CLI and look at the result.

So there is nothing like a print or echo function in the Asterisk scripting language?
Like

mydate = date(now)
print mydate

The CLI language is not the Asterisk scripting language. The only scripting languages are the dialplan languages, as found in extensions.conf, etc. The CLI language is primarily for direct human use.

Noop?

Not sure what you mean

is there any means of doing what I want to do? I want to interactively display the value of a function when assigned to a variable?

If you know Linux, for example, bash is not python but, it is possible to execute python in the shell

The OP specifically asked for the CLI, not for the dialplan.

Noop doesn’t actually display it, you would need to use something like Verbose for that. Noop does nothing; you are simply relying on the verbosity being high enough for the pre-processed dialplan command to be displayed.

in the dialplan you can do a a DumpChan() , in google you can look up Asterisk Variables ( list of)

If you have already had it copied to a channel variable, the CLI command “core show channel xxxxx” will list all the variables, but it will produce a lot of output besides what you want.

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