Dialplan question to the experts...

Status
Not open for further replies.

MrWeb

New Member
Mar 8, 2021
23
1
3
49
Hi at all,

i have a problem with my dialplan and i hope, someone can tell me,
how can i set up to my needs.

I attached a dialplan example, but this do not work and i did not know why...

My goal is as follows.
myapp.lua is running...
inside the lua i set the variable myvar to true or to false
Is the lua app is finished, i want now to use the variable as a condition.
If the variable is true, i want a action (at the moment only a set var, to see it in the log)
Also, is the var is false, i want a other action. here also a set var for testing.
But after the lua app nothing happens. Why ?
What i have to do/to change, that i can use the variable as contidion in two branches...

Any ideas ? Or can someone tell my where i am false in my thinking ?

(Sorry for my bad english...)

Best regards,
MrWeb
 

Attachments

  • dialplan-example.jpg
    dialplan-example.jpg
    263.3 KB · Views: 8

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
In your .lua script, get the UUID for the call (the easiest way is to pass in $uuid as argv1), then call uuid_setvar:

uuid = argv[1];

my_lua_variable = "Hello_World"
api:executeString("uuid_setvar " .. uuid .. " myvar " .. my_lua_variable);

I hope that helps.
 

MrWeb

New Member
Mar 8, 2021
23
1
3
49
Hi Adrian,

thank you. I know that. Setting of the variable is not my problem.
I want to know a way, how i can use a dialplan like the image.

If i set a variable in the dialplan with the inline argument, i can use
the variable later in the dialplan.
But how can i use a variable in the dialplan, when i set these within
a lua script ?

My action problem from the dialplan i solved inside lua.

But the question is the same, how i can use a dialplan like the image.

Best regards,
MrWeb
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
What you are doing in your dialplan looks largely OK. You need "Action set" not "Condition set", change this, it should work.

EDIT; forgot to say, you need Abbrechen (Break) = never on the condition statement so processing continues (does not stop on the first match).
 
Status
Not open for further replies.