-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get variable through getvar() function -> Session.getvar()
should return a Future
.
#64
Comments
@KozlovAO thanks for reporting. Very interesting. I don't think we have any tests for this currently. |
Thanks for the quick response! :)
It is not clear why he returned "undef"... If execute "uuid_getvar bac24ca0-e411-407e-ab56-73f5947fb5d8 test_var" in fs_cli - returns "test_val" (as need)
I can provide everything for the tests. |
@KozlovAO it seems that the Maybe try adjusting the timeout by making the It's possible this is just a latency problem with FS - the variable isn't being set on the server side yet? |
Here is that found:
Screen, with error: https://i.imgur.com/IL3vYqk.png Еt seems the exchange is done as follows: |
Tried to do "sess.con.cmd("uuid_setvar {} {} {}".format(sess.uuid, "test_var", "test_val"))"... Screen: https://i.imgur.com/T9rYESd.png |
Ahh I see what you mean. So it's a synchronization problem. We need to block for the Hmm, let me just check the code. |
@KozlovAO Oh wait, shoot. We need to change Do you have a copy of the source to try this? |
@KozlovAO try this: |
Yes, that's better. But the error persists: https://i.imgur.com/Mbl4uZl.png Execution code:
|
Yeah, so now the problem is that the Maybe try,
That shouldn't block by default and you can again await the future for the response. |
Yes, it works, but only if you put "time.sleep(1)" between "setvar" and "getvar" ...
result: "{'Content-Type': 'api/response', 'Content-Length': '8', 'Body': 'test_val\n'}" |
Yeah, so as I suspected that means FS is not blocking until the value is set and is too slow to have had the value set by the time you call Is there a reason you need to use a channel variable for whatever you are doing? |
No, it's only for test Typically, one event stores a variable and the other one reads it. |
Cool. Yeah so we need a PR to fix the |
hmm... what is PR? )) |
https://help.github.com/articles/about-pull-requests/ @KozlovAO btw if you'd like to chat more real-time see our riot room. |
Session.getvar()
should return a Future
.
Hi!
I'm trying to get a variable through * .getvar() and everything ends in an error.
My code:
Traceback:
The request for receiving is not visible in the FreeSwitch console...
The text was updated successfully, but these errors were encountered: