[Serusers] exec module question

Samuel Osorio Calvo samuel.osorio at nl.thalesgroup.com
Mon May 23 10:36:26 CEST 2005


Hi,

I am not sure if SER config file get the error code from the exit()
call of your script but I just think so. Assuming it gets the return
code, youn should be aware that only three possibilities can be checked
from the config file:

ret>0 --> config command was successfull
ret<0 --> ERROR
but:
ret=0 --> drop message!!!

So, if you return 0 from your script, the message will be dropped, just
af it a break had occur...

To allow this structure:

      if (exec_msg("/usr/local/bin/check_register.pl"))
        {
                break;
        } else {
                if (!radius_www_authorize("")) {

You should return a positive value if the scrpit ended OK or a negative
value if an error occurred.

BTW, using exec|* commands can be a worse solution.......just take a
look at older posts about this subject.

Hope it helps,
Samuel.



Unclassified.
>>> Daniel Corbe <daniel.junkmail at gmail.com> 05/20/05 05:31PM >>>
Hello,

I've noticed that 90% of my SIP traffic is REGISTER requests.  I am
trying to implement some sort of caching mechanism (which will
inherently be faster than doing a RADIUS lookup on every REGISTER
request) using exec and a perl script which does a lookup from a
memory-cached file.

I'm using exec_msg() to call the perl script; however it is not
behaving as I would expect.

Here's the code snippet from my SER config.

      if (exec_msg("/usr/local/bin/check_register.pl"))
        {
                break;
        } else {
                if (!radius_www_authorize("")) {

I am just in preliminary testing stage so I have the perl script
merely exiting with 0 status.  exec documentation is not clear as to
whether it uses the shell return codes to determine the exit status of
exec_msg

If I am exit(0)ing from the perl script I would expect the if( to
fail, not break and do the radius_www_authorize.  Is that not correct?

Thanks for the help!

Regards,
Daniel Corbe

_______________________________________________
Serusers mailing list
serusers at lists.iptel.org 
http://lists.iptel.org/mailman/listinfo/serusers




More information about the sr-users mailing list