我如何仅使用会话uuid(使用lua)就可以获取会话变量.
How am i able to get session variable using just session uuid (using lua).
因此,例如,我们有一个leg_a会话(当有人连接了sip电话时).当对方回答时,我们将在其他会话中(leg_b 的会话).
So for example, we have session of leg_a (when someone connect sip phone). When other side answers, we will be within other session (session of leg_b).
仅使用
session:getVariable("variable_name")在这种情况下不会有帮助,因为 session 指的是当前 session.
will not help in that case because session refers to the current session.
当我知道会话uuid时,如何使用lua来获取变量名.(这样我就可以获取其他会话变量,即使我们在当前会话中也是如此)
How am i able to use lua to get variable name when i know session uuid. (so i can get other sessions variable, even we are within current session which is different)
我是否可以提供两个参数,变量名和会话uuid?
Is there some kind of function where I am able to provide two parameteres, variable name and session uuid?
推荐答案您需要执行API调用 uuid_getvar .
you need to execute the API call uuid_getvar.
value = api:execute("uuid_getvar", "UUID VARNAME");(我忘记了如何在Lua中连接字符串,但您应该明白了)
(I forgot how to concatenate strings in Lua, but you should get the idea)
更多推荐
使用会话uuid获取会话变量
发布评论