Are pseudo variables sopposed to work in replace() function?
The pseudo variables documentation web page says that they are supported only by avpops and xlog, but the OpenSER 1.0.0 announcement web page says that they are supported by textops too...
Who is right?
Thanks.
Federico Giannici wrote:
Are pseudo variables sopposed to work in replace() function?
The pseudo variables documentation web page says that they are supported only by avpops and xlog, but the OpenSER 1.0.0 announcement web page says that they are supported by textops too...
Who is right?
Looking at the examples I found that AVPs usage is supported at least on the "replacement" string of subst(), but it appears to me that it isn't supported in the regular expression.
So, how can I make a regular expression with variable content? Something like the following:
subst( "/^Proxy-Authorization:.*realm="$avp(s:realm)".*\n//i" );
Thanks.
Hi Federico,
the usage of pseudo-variables inside the regexp was avoided due performance reasons - all regexp are compiled at startup, they being only evaluated on runtime. By having variables into regexp, the compilation of the expression will must be done each time at runtime :(.
there is only one attempt in this direction - it might help you ; see the fm operator in avp_check : http://www.openser.org/docs/modules/1.0.x/avpops.html#AEN325 or http://www.voice-system.ro/docs/avpops/ar01s06.html#avp_check
regards, bogdan
Federico Giannici wrote:
Federico Giannici wrote:
Are pseudo variables sopposed to work in replace() function?
The pseudo variables documentation web page says that they are supported only by avpops and xlog, but the OpenSER 1.0.0 announcement web page says that they are supported by textops too...
Who is right?
Looking at the examples I found that AVPs usage is supported at least on the "replacement" string of subst(), but it appears to me that it isn't supported in the regular expression.
So, how can I make a regular expression with variable content? Something like the following:
subst( "/^Proxy-Authorization:.*realm="$avp(s:realm)".*\n//i" );
Thanks.
Bogdan-Andrei Iancu wrote:
Hi Federico,
the usage of pseudo-variables inside the regexp was avoided due performance reasons - all regexp are compiled at startup, they being only evaluated on runtime. By having variables into regexp, the compilation of the expression will must be done each time at runtime :(.
What about to implement an "e" regular expressions modifier that make the regular expression be evaluated every time?
there is only one attempt in this direction - it might help you ; see the fm operator in avp_check : http://www.openser.org/docs/modules/1.0.x/avpops.html#AEN325 or http://www.voice-system.ro/docs/avpops/ar01s06.html#avp_check
Humm... I cannot find a way to use it to implement the following. Do you?
subst( "/^Proxy-Authorization:.*realm="$avp(s:realm)".*\n//i" );
Thanks.
Federico Giannici wrote:
Federico Giannici wrote:
Are pseudo variables sopposed to work in replace() function?
The pseudo variables documentation web page says that they are supported only by avpops and xlog, but the OpenSER 1.0.0 announcement web page says that they are supported by textops too...
Who is right?
Looking at the examples I found that AVPs usage is supported at least on the "replacement" string of subst(), but it appears to me that it isn't supported in the regular expression.
So, how can I make a regular expression with variable content? Something like the following:
subst( "/^Proxy-Authorization:.*realm="$avp(s:realm)".*\n//i" );
Thanks.
Frederico,
as far as I can see, the subst() you try should remove the Proxy-Auth hdr, right? why don't you use consume_credential() functions?
regards, bogdan
Federico Giannici wrote:
Bogdan-Andrei Iancu wrote:
Hi Federico,
the usage of pseudo-variables inside the regexp was avoided due performance reasons - all regexp are compiled at startup, they being only evaluated on runtime. By having variables into regexp, the compilation of the expression will must be done each time at runtime :(.
What about to implement an "e" regular expressions modifier that make the regular expression be evaluated every time?
there is only one attempt in this direction - it might help you ; see the fm operator in avp_check : http://www.openser.org/docs/modules/1.0.x/avpops.html#AEN325 or http://www.voice-system.ro/docs/avpops/ar01s06.html#avp_check
Humm... I cannot find a way to use it to implement the following. Do you?
subst( "/^Proxy-Authorization:.*realm="$avp(s:realm)".*\n//i" );
Bogdan-Andrei Iancu wrote:
Frederico,
as far as I can see, the subst() you try should remove the Proxy-Auth hdr, right? why don't you use consume_credential() functions?
Because the credential are not used!
I noticed that some UAs send authorization data even when not required and NOT supposed to send (ACKs, BYEs, etc.).
As I don't want to forward over the credentials, I need a way to remove then, IF they exists AND are for my realm (and the realm is not known a priori).
Any solution?
Thanks.
Federico Giannici wrote:
Bogdan-Andrei Iancu wrote:
Hi Federico,
the usage of pseudo-variables inside the regexp was avoided due performance reasons - all regexp are compiled at startup, they being only evaluated on runtime. By having variables into regexp, the compilation of the expression will must be done each time at runtime :(.
What about to implement an "e" regular expressions modifier that make the regular expression be evaluated every time?
there is only one attempt in this direction - it might help you ; see the fm operator in avp_check : http://www.openser.org/docs/modules/1.0.x/avpops.html#AEN325 or http://www.voice-system.ro/docs/avpops/ar01s06.html#avp_check
Humm... I cannot find a way to use it to implement the following. Do you?
subst( "/^Proxy-Authorization:.*realm="$avp(s:realm)".*\n//i" );
Hello,
On 11/05/05 20:52, Federico Giannici wrote:
Federico Giannici wrote:
Are pseudo variables sopposed to work in replace() function?
The pseudo variables documentation web page says that they are supported only by avpops and xlog, but the OpenSER 1.0.0 announcement web page says that they are supported by textops too...
Who is right?
Looking at the examples I found that AVPs usage is supported at least on the "replacement" string of subst(), but it appears to me that it isn't supported in the regular expression.
So, how can I make a regular expression with variable content? Something like the following:
subst( "/^Proxy-Authorization:.*realm="$avp(s:realm)".*\n//i" );
this was not introduced because the regular expressions are pre-compiled at startup. Otherwise there will be a lot of speed penalty. However, it may be an option to allow such case, being admin decision whether to use it or not -- first it has to be analyzed if it is simple to do it :-)
Cheers, Daniel
Thanks.