exec environmental var

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

exec environmental var

Tito Cumpen
Group,


I am trying to migrate to the latest opensips 2.3 but I am having issues when setting this in my script.


                  $avp(env) = "";
      xlog(" $var(input) being executed\n");       
         exec("php /etc/opensips/authenticate.php $var(input2)", "", "$var(outinvite)", "$var(err)", "$avp(env)");

I get this error in my log.

Jul 18 21:34:30 cloud-server-09 /sbin/opensips[31402]: DBG:core:__search_avp_map: looking for [env] avp  - found 4
Jul 18 21:34:30 cloud-server-09 /sbin/opensips[31402]: ERROR:exec:exec_fixup: env var must be a single variable


Any idea why this may be ?


Thanks

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: exec environmental var

Liviu Chircu
Hi Tito,

This seems to be caused by some misused startup optimization logic.
Below is a scripting trick that should solve your problem until we take
care of providing the official solution.

Change this:

..., "$avp(env)");

into this:

..., "$avp(env) ");

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 19.07.2017 00:42, Tito Cumpen wrote:
> Group,
>
>
> I am trying to migrate to the latest opensips 2.3 but I am having
> issues when setting this in my script.


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: exec environmental var

Johan De Clercq
to me that seems like the same.

2017-07-19 10:15 GMT+02:00 Liviu Chircu <[hidden email]>:
Hi Tito,

This seems to be caused by some misused startup optimization logic. Below is a scripting trick that should solve your problem until we take care of providing the official solution.

Change this:

..., "$avp(env)");

into this:

..., "$avp(env) ");

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 19.07.2017 00:42, Tito Cumpen wrote:
Group,


I am trying to migrate to the latest opensips 2.3 but I am having issues when setting this in my script.


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: exec environmental var

Liviu Chircu

I didn't call it a "trick" without good reason :) Notice the extra whitespace (" "), which changes the internal type of that parameter from "single variable" to "variable format string".

Nevertheless, the proper fix is already available [1]

[1]: https://github.com/OpenSIPS/opensips/commit/8a1b3ef3e456

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 19.07.2017 12:35, Johan De Clercq wrote:
to me that seems like the same.

2017-07-19 10:15 GMT+02:00 Liviu Chircu <[hidden email]>:
Hi Tito,

This seems to be caused by some misused startup optimization logic. Below is a scripting trick that should solve your problem until we take care of providing the official solution.

Change this:

..., "$avp(env)");

into this:

..., "$avp(env) ");

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 19.07.2017 00:42, Tito Cumpen wrote:
Group,


I am trying to migrate to the latest opensips 2.3 but I am having issues when setting this in my script.


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: exec environmental var

Tito Cumpen
This is happening with the output variable now in the latest 2.2 clone


"output var must be a single variable"

I tried adding a space like it was previously suggested for the environmental variable 

On Wed, Jul 19, 2017 at 2:43 AM, Liviu Chircu <[hidden email]> wrote:

I didn't call it a "trick" without good reason :) Notice the extra whitespace (" "), which changes the internal type of that parameter from "single variable" to "variable format string".

Nevertheless, the proper fix is already available [1]

[1]: https://github.com/OpenSIPS/opensips/commit/8a1b3ef3e456

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 19.07.2017 12:35, Johan De Clercq wrote:
to me that seems like the same.

2017-07-19 10:15 GMT+02:00 Liviu Chircu <[hidden email]>:
Hi Tito,

This seems to be caused by some misused startup optimization logic. Below is a scripting trick that should solve your problem until we take care of providing the official solution.

Change this:

..., "$avp(env)");

into this:

..., "$avp(env) ");

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 19.07.2017 00:42, Tito Cumpen wrote:
Group,


I am trying to migrate to the latest opensips 2.3 but I am having issues when setting this in my script.


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users