Hello,
Is it possible to use variables inside a textops search_hf function? I am trying to compare variable content against From header content and return true or false.
I tried the following statement but with no luck:
search_hf("From", "$var(MYVARIABLE)", "f") { ... }
If this cannot be done, any suggestions on how to achieve this kind of comparsion? The variable content is pulled out from a htable entry.
Cheers,
--Olli
Hello,
the search_hf() is accepting only static regexp as parameter at this moment.
Do you want to match only the From header in this case, or there could be the case of another header as well?
Cheers, Daniel
On 07.04.17 14:25, Olli Attila wrote:
Hello,
Is it possible to use variables inside a textops search_hf function? I am trying to compare variable content against From header content and return true or false.
I tried the following statement but with no luck:
search_hf("From", "$var(MYVARIABLE)", "f") { ... }
If this cannot be done, any suggestions on how to achieve this kind of comparsion? The variable content is pulled out from a htable entry.
Cheers,
--Olli
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
In this case From header only but it might also be handy to compare to other headers as well.
--Olli
Daniel-Constantin Mierla kirjoitti 2017-04-07 15:33:
Hello,
the search_hf() is accepting only static regexp as parameter at this moment.
Do you want to match only the From header in this case, or there could be the case of another header as well?
Cheers, Daniel
On 07.04.17 14:25, Olli Attila wrote:
Hello,
Is it possible to use variables inside a textops search_hf function? I am trying to compare variable content against From header content and return true or false.
I tried the following statement but with no luck:
search_hf("From", "$var(MYVARIABLE)", "f") { ... }
If this cannot be done, any suggestions on how to achieve this kind of comparsion? The variable content is pulled out from a htable entry.
Cheers,
--Olli
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
I asked because some headers can appear more than once.
For From header, try directly with regexp operator '=~', like:
if($hdr(From) =~ $var(MYVARIABLE)) {
}
It should work, if not let me know.
Cheers, Daniel
On 07.04.17 14:36, Olli Attila wrote:
Hello,
In this case From header only but it might also be handy to compare to other headers as well.
--Olli
Daniel-Constantin Mierla kirjoitti 2017-04-07 15:33:
Hello,
the search_hf() is accepting only static regexp as parameter at this moment.
Do you want to match only the From header in this case, or there could be the case of another header as well?
Cheers, Daniel
On 07.04.17 14:25, Olli Attila wrote:
Hello,
Is it possible to use variables inside a textops search_hf function? I am trying to compare variable content against From header content and return true or false.
I tried the following statement but with no luck:
search_hf("From", "$var(MYVARIABLE)", "f") { ... }
If this cannot be done, any suggestions on how to achieve this kind of comparsion? The variable content is pulled out from a htable entry.
Cheers,
--Olli
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
Yes, this does the trick. Thank you.
--Olli
Daniel-Constantin Mierla kirjoitti 2017-04-07 15:42:
Hello,
I asked because some headers can appear more than once.
For From header, try directly with regexp operator '=~', like:
if($hdr(From) =~ $var(MYVARIABLE)) {
}
It should work, if not let me know.
Cheers, Daniel
On 07.04.17 14:36, Olli Attila wrote:
Hello,
In this case From header only but it might also be handy to compare to other headers as well.
--Olli
Daniel-Constantin Mierla kirjoitti 2017-04-07 15:33:
Hello,
the search_hf() is accepting only static regexp as parameter at this moment.
Do you want to match only the From header in this case, or there could be the case of another header as well?
Cheers, Daniel
On 07.04.17 14:25, Olli Attila wrote:
Hello,
Is it possible to use variables inside a textops search_hf function? I am trying to compare variable content against From header content and return true or false.
I tried the following statement but with no luck:
search_hf("From", "$var(MYVARIABLE)", "f") { ... }
If this cannot be done, any suggestions on how to achieve this kind of comparsion? The variable content is pulled out from a htable entry.
Cheers,
--Olli
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
great!
Btw, check also diaplan module, it can be used for matching only if substitution/replacement expressions are not provided -- I think there were enhancements to allow variables in matching expressions and you can keep everything in database, but with caching at runtime for speeding up.
Cheers, Daniel
On 07.04.17 14:53, Olli Attila wrote:
Hello,
Yes, this does the trick. Thank you.
--Olli
Daniel-Constantin Mierla kirjoitti 2017-04-07 15:42:
Hello,
I asked because some headers can appear more than once.
For From header, try directly with regexp operator '=~', like:
if($hdr(From) =~ $var(MYVARIABLE)) {
}
It should work, if not let me know.
Cheers, Daniel
On 07.04.17 14:36, Olli Attila wrote:
Hello,
In this case From header only but it might also be handy to compare to other headers as well.
--Olli
Daniel-Constantin Mierla kirjoitti 2017-04-07 15:33:
Hello,
the search_hf() is accepting only static regexp as parameter at this moment.
Do you want to match only the From header in this case, or there could be the case of another header as well?
Cheers, Daniel
On 07.04.17 14:25, Olli Attila wrote:
Hello,
Is it possible to use variables inside a textops search_hf function? I am trying to compare variable content against From header content and return true or false.
I tried the following statement but with no luck:
search_hf("From", "$var(MYVARIABLE)", "f") { ... }
If this cannot be done, any suggestions on how to achieve this kind of comparsion? The variable content is pulled out from a htable entry.
Cheers,
--Olli
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users