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
Cannot use environment variables in modparam() function #2276
Comments
This should be possible via:
There is another alternative to use command line parameters to set defined values or substdef rules, see Note that you may have to use kamailio 5.3.x for some of the above. I am going to close this one, having alternatives for it. If one wants to implement direct evaluation in modparams, then just do a pull request. |
I finally got around to test this but it seems I'm doing something wrong:
Now trying to start Kamailio (5.3.3 as suggested) fails:
I also tried the following but it doesn't make a difference:
|
Try to load pv module before subsdef definitions. I haven't added this feature to know its constraints, but I see that the error is not finding $env() |
This looks way better, the error is gone now. Thanks. :-) |
Description
I tried to use the
$env(NAME)
pseudovariable as argument formodparam()
calls but evidently the result was empty.Troubleshooting
Reproduction
Set up
auth_ephemeral
and add this to your configuration:Now export
AUTH_EPHEMERAL_SECRET=something
and start Kamailio with sufficient debug output. You'll see that Kamailio literally uses$env(AUTH_EPHEMERAL_SECRET)
as secret instead of inserting the value of the environment variable.Log Messages
Should be:
Possible Solutions
Replacement of environment variables should be supported in
modparams()
. (And possibly in all functions.)Additional Information
kamailio -v
(Using the Docker image
kamailio/kamailio:5.2.1-xenial
ATM.)The text was updated successfully, but these errors were encountered: